createStatusNormalizer
createStatusNormalizer<
Known>(map): (raw) =>NormalizedStatusResult
Defined in: packages/core/src/order-status.ts:49
Build a status normalizer from an SDK-owned, exhaustive map of that
marketplace’s known statuses. Because the map key type is a closed union,
forgetting to map a newly added known status is a compile-time error in the
SDK — while an unknown value arriving on the wire stays safe at runtime
({ normalized: 'unknown', mapped: false }).
Type Parameters
Section titled “Type Parameters”Known extends string
Parameters
Section titled “Parameters”Record<Known, NormalizedOrderStatus>
Returns
Section titled “Returns”(raw) => NormalizedStatusResult
Example
Section titled “Example”const statusMap = { Created: 'created', Shipped: 'shipped' } as const;const normalizeStatus = createStatusNormalizer(statusMap);normalizeStatus('Shipped'); // { normalized: 'shipped', raw: 'Shipped', mapped: true }normalizeStatus('Martian'); // { normalized: 'unknown', raw: 'Martian', mapped: false }Unofficial. Lonca is an independent, community-maintained project — not affiliated with, endorsed by, or supported by Trendyol, Hepsiburada, or any other marketplace. All marketplace names and trademarks belong to their respective owners.