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>
18 lines
440 B
Text
18 lines
440 B
Text
const BYTE_LIMIT = 1024;
|
|
export function encodeFeatures(features) {
|
|
let buffer = "";
|
|
for (const key in features) {
|
|
const val = features[key];
|
|
if (buffer.length + val.length + 1 <= BYTE_LIMIT) {
|
|
if (buffer.length) {
|
|
buffer += "," + val;
|
|
}
|
|
else {
|
|
buffer += val;
|
|
}
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
return buffer;
|
|
}
|