Rocky_Mountain_Vending/.pnpm-store/v10/files/e8/56027d883fd0af6e526dbf770ede863590b36bb0b4d777ed2577112c1f4e17bb0b3e1567561e5a2b8bfcc3e7e4db8ea00a1ff58e928f254d63b75335e17979
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

30 lines
934 B
Text

'use strict';
const TEXT_ENCODER = typeof TextEncoder == "function" ? new TextEncoder() : null;
const calculateBodyLength = (body) => {
if (typeof body === "string") {
if (TEXT_ENCODER) {
return TEXT_ENCODER.encode(body).byteLength;
}
let len = body.length;
for (let i = len - 1; i >= 0; i--) {
const code = body.charCodeAt(i);
if (code > 0x7f && code <= 0x7ff)
len++;
else if (code > 0x7ff && code <= 0xffff)
len += 2;
if (code >= 0xdc00 && code <= 0xdfff)
i--;
}
return len;
}
else if (typeof body.byteLength === "number") {
return body.byteLength;
}
else if (typeof body.size === "number") {
return body.size;
}
throw new Error(`Body Length computation failed for ${body}`);
};
exports.calculateBodyLength = calculateBodyLength;