@natch-the-storage/heathershaw-platform-types 1.18.15 → 1.18.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/validators.d.ts +2 -0
- package/build/validators.js +4 -0
- package/package.json +1 -1
package/build/validators.d.ts
CHANGED
|
@@ -109,6 +109,8 @@ export declare function formatAddress(addr: Address): string;
|
|
|
109
109
|
* Formats an address object into a human readable format
|
|
110
110
|
*/
|
|
111
111
|
export declare function formatOrderId(o: Pick<Order, 'id' | 'type'>): string;
|
|
112
|
+
/** Formats a number into a price string */
|
|
113
|
+
export declare function formatPrice(n: number): string;
|
|
112
114
|
export interface Address {
|
|
113
115
|
street: string;
|
|
114
116
|
suburb: string;
|
package/build/validators.js
CHANGED
|
@@ -299,6 +299,10 @@ export function formatAddress(addr) {
|
|
|
299
299
|
export function formatOrderId(o) {
|
|
300
300
|
return `#${o.id}-${o.type ?? 'HS'}`;
|
|
301
301
|
}
|
|
302
|
+
/** Formats a number into a price string */
|
|
303
|
+
export function formatPrice(n) {
|
|
304
|
+
return `$${n.toFixed(2)}`;
|
|
305
|
+
}
|
|
302
306
|
//#endregion ──────────────────────────────────────────────────────────────────────
|
|
303
307
|
//#region compound direct ────────────────────────────────────────────────────────────
|
|
304
308
|
export const CDProductCategoriesIdLabel = cDProductCategoryIdValues.map((v, i) => {
|