@shakerquiz/utilities 0.5.93 → 0.5.94

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,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@shakerquiz/utilities",
4
- "version": "0.5.93",
4
+ "version": "0.5.94",
5
5
  "author": "yurkimus <yurkimus@gmail.com>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -70,6 +70,9 @@ export var AffilationShapes = Object.entries(AffilationShape)
70
70
  * @param {Affilation | typeof AffilationShape[Affilation]} value
71
71
  */
72
72
  export var getAffilation = value => {
73
+ if (value === null)
74
+ return Affilation['Unknown']
75
+
73
76
  switch (typeof value) {
74
77
  case 'object':
75
78
  return AffilationShapes
@@ -33,6 +33,9 @@ var getter = value =>
33
33
  : CitiesMode['unknown']
34
34
 
35
35
  export var getCitiesMode = value => {
36
+ if (value === null)
37
+ return getter(undefined)
38
+
36
39
  switch (typeof value) {
37
40
  case 'string':
38
41
  return getter(value)
@@ -24,6 +24,9 @@ var getter = value =>
24
24
  : PasswordMode['unknown']
25
25
 
26
26
  export var getPasswordMode = value => {
27
+ if (value === null)
28
+ return getter(undefined)
29
+
27
30
  switch (typeof value) {
28
31
  case 'string':
29
32
  return getter(value)
@@ -24,6 +24,9 @@ var getter = value =>
24
24
  : RoleMode['unknown']
25
25
 
26
26
  export var getRoleMode = value => {
27
+ if (value === null)
28
+ return getter(undefined)
29
+
27
30
  switch (typeof value) {
28
31
  case 'string':
29
32
  return getter(value)
@@ -55,6 +55,9 @@ export var ChatappVersionShape = /** @type {const} */ ({
55
55
  export var ChatappVersionShapes = Object.entries(ChatappVersionShape)
56
56
 
57
57
  export var getChatappVersion = value => {
58
+ if (value === null)
59
+ return ChatappVersion['Unknown']
60
+
58
61
  switch (typeof value) {
59
62
  case 'object':
60
63
  return ChatappVersionShapes