Files
klz-cables.com/.pnpm-store/v10/files/ce/8d03d36b46994b295fbc2605545da0e33c26414ac9f80de7704265a12e768d62d5d155352a3864eaf2877a1ae13276f4983881c605df8e5da6d714e78e12d1
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

23 lines
750 B
Plaintext

/**
* Converts a UTC offset string to a GraphQL-safe enum name.
* Uses `_TZOFFSET_` prefix to avoid conflicts with user-defined enum values.
*
* Examples:
* - '+05:30' → '_TZOFFSET_PLUS_05_30'
* - '-08:00' → '_TZOFFSET_MINUS_08_00'
* - '+00:00' → '_TZOFFSET_PLUS_00_00'
*
* @returns The GraphQL-safe name, or null if not a UTC offset
*/ export const formatUtcOffset = (value)=>{
// Match UTC offset pattern: ±HH:mm
const match = value.match(/^([+-])(\d{2}):(\d{2})$/);
if (!match) {
return null;
}
const sign = match[1] === '+' ? 'PLUS' : 'MINUS';
const hours = match[2];
const minutes = match[3];
return `_TZOFFSET_${sign}_${hours}_${minutes}`;
};
//# sourceMappingURL=formatUtcOffset.js.map