@shakerquiz/utilities 0.5.201 → 0.5.202
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/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const Affilation = Object.freeze({
|
|
2
2
|
'Branch': 'Branch',
|
|
3
3
|
'Franchise': 'Franchise',
|
|
4
4
|
})
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const Affilations = Object.freeze([
|
|
7
7
|
Affilation['Branch'],
|
|
8
8
|
Affilation['Franchise'],
|
|
9
|
-
]
|
|
9
|
+
])
|
|
10
10
|
|
|
11
|
-
export
|
|
11
|
+
export const AffilationTitle = Object.freeze({
|
|
12
12
|
[Affilation['Branch']]: 'Филиал',
|
|
13
13
|
[Affilation['Franchise']]: 'Франшиза',
|
|
14
|
-
}
|
|
14
|
+
})
|
|
15
15
|
|
|
16
|
-
export
|
|
16
|
+
export const AffilationIcon = Object.freeze({
|
|
17
17
|
[Affilation['Branch']]: 'hero/outline/building-office-2',
|
|
18
18
|
[Affilation['Franchise']]: 'hero/outline/building-storefront',
|
|
19
|
-
}
|
|
19
|
+
})
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
}
|
|
21
|
+
const ValueAffilation = Object.freeze({
|
|
22
|
+
[false]: Affilation['Branch'],
|
|
23
|
+
[true]: Affilation['Franchise'],
|
|
24
|
+
})
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
const AffilationShape = Object.freeze({
|
|
27
27
|
[Affilation['Branch']]: {
|
|
28
28
|
is_franchise: false,
|
|
29
29
|
},
|
|
@@ -31,15 +31,14 @@ var AffilationShape = {
|
|
|
31
31
|
[Affilation['Franchise']]: {
|
|
32
32
|
is_franchise: true,
|
|
33
33
|
},
|
|
34
|
-
}
|
|
34
|
+
})
|
|
35
35
|
|
|
36
36
|
/** @returns {keyof typeof Affilation | 'Unknown'} */
|
|
37
|
-
export
|
|
37
|
+
export const inferAffilation = value =>
|
|
38
38
|
ValueAffilation[value?.is_franchise]
|
|
39
|
+
?? ValueAffilation[value]
|
|
39
40
|
?? Affilation[value]
|
|
40
41
|
?? 'Unknown'
|
|
41
42
|
|
|
42
|
-
/** @returns {typeof AffilationShape[keyof typeof AffilationShape] | {
|
|
43
|
-
export
|
|
44
|
-
AffilationShape[value]
|
|
45
|
-
?? { is_franchise: null }
|
|
43
|
+
/** @returns {typeof AffilationShape[keyof typeof AffilationShape] | { is_franchise: null }} */
|
|
44
|
+
export const inferAffilationShape = value => AffilationShape[value] ?? { is_franchise: null }
|