@shakerquiz/utilities 0.5.159 → 0.5.161
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
|
@@ -53,20 +53,6 @@ export var ModeTitle = {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/** @returns {typeof Mode[keyof typeof Mode]} */
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
* @returns {typeof Mode[keyof typeof Mode]}
|
|
60
|
-
*/
|
|
61
|
-
export var inferMode = value => {
|
|
62
|
-
switch (typeof value) {
|
|
63
|
-
case 'string':
|
|
64
|
-
return infer(value)
|
|
65
|
-
|
|
66
|
-
case 'object':
|
|
67
|
-
return infer(value?.mode)
|
|
68
|
-
|
|
69
|
-
default:
|
|
70
|
-
return Mode['Unknown']
|
|
71
|
-
}
|
|
72
|
-
}
|
|
56
|
+
export var inferMode = value =>
|
|
57
|
+
Mode[value?.mode ?? value]
|
|
58
|
+
?? 'Unknown'
|
package/source/index.js
CHANGED