Rocky_Mountain_Vending/.pnpm-store/v10/files/22/a4470dd47e54e5df5d5da4f4440a43ffb18cf1676e23af7dc0395cc97dfcf5d05535beaf94d91e7e3434795b33bda8472b1163e1a5543ac78b8d53d28b4405
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

27 lines
921 B
Text

'use strict';
const validate = (str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6;
const parse = (arn) => {
const segments = arn.split(":");
if (segments.length < 6 || segments[0] !== "arn")
throw new Error("Malformed ARN");
const [, partition, service, region, accountId, ...resource] = segments;
return {
partition,
service,
region,
accountId,
resource: resource.join(":"),
};
};
const build = (arnObject) => {
const { partition = "aws", service, region, accountId, resource } = arnObject;
if ([service, region, accountId, resource].some((segment) => typeof segment !== "string")) {
throw new Error("Input ARN object is invalid");
}
return `arn:${partition}:${service}:${region}:${accountId}:${resource}`;
};
exports.build = build;
exports.parse = parse;
exports.validate = validate;