Rocky_Mountain_Vending/.pnpm-store/v10/files/48/70c95b27a777c385d19bc92682132da67293d7c7748fc74c267dd8f5c943ef9e4b68d64b06f35a70b8dad4104fce56c66b838d7011bd9475c4f7525380e1df
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

28 lines
1.2 KiB
Text

import { normalizeProvider } from "@smithy/core";
export const DEFAULT_UA_APP_ID = undefined;
function isValidUserAgentAppId(appId) {
if (appId === undefined) {
return true;
}
return typeof appId === "string" && appId.length <= 50;
}
export function resolveUserAgentConfig(input) {
const normalizedAppIdProvider = normalizeProvider(input.userAgentAppId ?? DEFAULT_UA_APP_ID);
const { customUserAgent } = input;
return Object.assign(input, {
customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent,
userAgentAppId: async () => {
const appId = await normalizedAppIdProvider();
if (!isValidUserAgentAppId(appId)) {
const logger = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger;
if (typeof appId !== "string") {
logger?.warn("userAgentAppId must be a string or undefined.");
}
else if (appId.length > 50) {
logger?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
}
}
return appId;
},
});
}