@lasterp/shared 1.0.0-alpha.0

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.
@@ -0,0 +1,42 @@
1
+ import type {Colour, Item, ItemVariant, ModelNumber} from '../catalog/types'
2
+
3
+ export interface Category {
4
+ name: string
5
+ categoryName: string
6
+ sequenceId: number
7
+ itemCode: string[]
8
+ itemGroup: string[]
9
+ brand: string[]
10
+ os: string[]
11
+ }
12
+
13
+ export interface Product extends Item {
14
+ name: string
15
+ image: string
16
+ }
17
+
18
+ export interface ProductVariant extends ItemVariant {
19
+ id: string
20
+ specs: Record<string, string>
21
+ price: number
22
+ stock: number
23
+ }
24
+
25
+ export interface ShopContext {
26
+ title?: string
27
+ categories?: Category[]
28
+ selectedCategory?: Category
29
+ grades?: string[]
30
+ selectedGrade?: string
31
+ products: Product[]
32
+ }
33
+
34
+ export interface ProductContext {
35
+ currency: string
36
+ product: Product
37
+ specs: Record<string, string[]>
38
+ variants: ProductVariant[]
39
+ modelNumbers: Record<string, ModelNumber>
40
+ colours: Record<string, Colour>
41
+ variantImages: Record<string, string[]>
42
+ }
@@ -0,0 +1,8 @@
1
+ import type {ModelNumber} from "../lasterp";
2
+
3
+ export function toDescription(modelNumber: ModelNumber) {
4
+ if (!modelNumber) {
5
+ return null;
6
+ }
7
+ return modelNumber.simCardType;
8
+ }
@@ -0,0 +1,10 @@
1
+ // Re-export humps utilities with backward-compatible names
2
+ export {
3
+ camelize as snakeToCamel,
4
+ decamelize as camelToSnake,
5
+ camelizeKeys as objectSnakeToCamel,
6
+ decamelizeKeys as objectCamelToSnake,
7
+ } from 'humps';
8
+
9
+ export * from './catalog'
10
+ export * from './types'
@@ -0,0 +1,3 @@
1
+ export function equalsIgnoreCase(str1: string, str2: string): boolean {
2
+ return str1.localeCompare(str2, undefined, { sensitivity: 'accent' }) === 0;
3
+ };