@shakerquiz/utilities 0.5.7 → 0.5.9
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
|
@@ -47,7 +47,7 @@ export var CityAffilationShape = {
|
|
|
47
47
|
is_franchise: false,
|
|
48
48
|
},
|
|
49
49
|
|
|
50
|
-
[CityAffilation.
|
|
50
|
+
[CityAffilation.Franchise]: {
|
|
51
51
|
is_franchise: true,
|
|
52
52
|
},
|
|
53
53
|
}
|
|
@@ -58,15 +58,17 @@ export var CityAffilationShapes = Object.entries(CityAffilationShape)
|
|
|
58
58
|
* @param {CityAffilation | typeof CityAffilationShape[CityAffilation]} value
|
|
59
59
|
*/
|
|
60
60
|
export var getCityAffilation = value => {
|
|
61
|
+
console.log('[getCityAffilation]', value)
|
|
62
|
+
|
|
61
63
|
switch (typeof value) {
|
|
62
64
|
case 'object':
|
|
63
65
|
let found = CityAffilationShapes
|
|
64
|
-
.find(([, object]) => object.is_franchise === value.
|
|
66
|
+
.find(([, object]) => object.is_franchise === value.is_franchise)
|
|
65
67
|
?.at(0)
|
|
66
68
|
|
|
67
69
|
if (!CityAffilations.includes(found))
|
|
68
70
|
throw TypeError(
|
|
69
|
-
`[Function: getCityAffilation] Parameter 'found': '${found}' must be a member of '
|
|
71
|
+
`[Function: getCityAffilation] Parameter 'found': '${found}' must be a member of 'CityAffilations'.`,
|
|
70
72
|
)
|
|
71
73
|
|
|
72
74
|
return found
|
|
@@ -74,7 +76,7 @@ export var getCityAffilation = value => {
|
|
|
74
76
|
case 'string':
|
|
75
77
|
if (!CityAffilations.includes(value))
|
|
76
78
|
throw TypeError(
|
|
77
|
-
`[Function: getCityAffilation] Parameter 'value': '${value}' must be a member of '
|
|
79
|
+
`[Function: getCityAffilation] Parameter 'value': '${value}' must be a member of 'CityAffilations'.`,
|
|
78
80
|
)
|
|
79
81
|
|
|
80
82
|
return CityAffilationShape[value]
|