Rocky_Mountain_Vending/.pnpm-store/v10/files/b4/4c44cadedbc264c650afaadb4801acccf3d55aa0b39e5eed83199463df2a0482ecb7e7c95ab4691882bced6eb68500fd2f2a9c1dab181d516a8b5100b52f29
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

37 lines
984 B
Text

export const splitHeader = (value) => {
const z = value.length;
const values = [];
let withinQuotes = false;
let prevChar = undefined;
let anchor = 0;
for (let i = 0; i < z; ++i) {
const char = value[i];
switch (char) {
case `"`:
if (prevChar !== "\\") {
withinQuotes = !withinQuotes;
}
break;
case ",":
if (!withinQuotes) {
values.push(value.slice(anchor, i));
anchor = i + 1;
}
break;
default:
}
prevChar = char;
}
values.push(value.slice(anchor));
return values.map((v) => {
v = v.trim();
const z = v.length;
if (z < 2) {
return v;
}
if (v[0] === `"` && v[z - 1] === `"`) {
v = v.slice(1, z - 1);
}
return v.replace(/\\"/g, '"');
});
};