@shakerquiz/utilities 0.5.202 → 0.5.203

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.202",
4
+ "version": "0.5.203",
5
5
  "author": "yurkimus <yurkimus@gmail.com>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -19,26 +19,30 @@ export const AffilationIcon = Object.freeze({
19
19
  })
20
20
 
21
21
  const ValueAffilation = Object.freeze({
22
- [false]: Affilation['Branch'],
23
- [true]: Affilation['Franchise'],
22
+ 'false': Affilation['Branch'],
23
+ 'true': Affilation['Franchise'],
24
24
  })
25
25
 
26
26
  const AffilationShape = Object.freeze({
27
- [Affilation['Branch']]: {
27
+ [Affilation['Branch']]: Object.freeze({
28
28
  is_franchise: false,
29
- },
29
+ }),
30
30
 
31
- [Affilation['Franchise']]: {
31
+ [Affilation['Franchise']]: Object.freeze({
32
32
  is_franchise: true,
33
- },
33
+ }),
34
34
  })
35
35
 
36
36
  /** @returns {keyof typeof Affilation | 'Unknown'} */
37
- export const inferAffilation = value =>
37
+ export const inferAffilation = Object.freeze(value =>
38
38
  ValueAffilation[value?.is_franchise]
39
39
  ?? ValueAffilation[value]
40
40
  ?? Affilation[value]
41
41
  ?? 'Unknown'
42
+ )
42
43
 
43
44
  /** @returns {typeof AffilationShape[keyof typeof AffilationShape] | { is_franchise: null }} */
44
- export const inferAffilationShape = value => AffilationShape[value] ?? { is_franchise: null }
45
+ export const inferAffilationShape = Object.freeze(value =>
46
+ AffilationShape[value]
47
+ ?? { is_franchise: null }
48
+ )
@@ -1,40 +1,43 @@
1
- export var ChatappVersion = /** @type {const} */ ({
1
+ export const Version = Object.freeze({
2
2
  'Actual': 'Actual',
3
3
  'Legacy': 'Legacy',
4
4
  })
5
5
 
6
- export var ChatappVersions = [
7
- ChatappVersion['Actual'],
8
- ChatappVersion['Legacy'],
9
- ]
6
+ export const Versions = Object.freeze([
7
+ Version['Actual'],
8
+ Version['Legacy'],
9
+ ])
10
10
 
11
- export var VersionTitle = {
12
- [ChatappVersion['Actual']]: 'Актуальная',
13
- [ChatappVersion['Legacy']]: 'Старая',
14
- }
11
+ export const VersionTitle = Object.freeze({
12
+ [Version['Actual']]: 'Актуальная',
13
+ [Version['Legacy']]: 'Старая',
14
+ })
15
15
 
16
- var ValueChatappVersion = {
17
- ['false']: ChatappVersion['Actual'],
18
- ['true']: ChatappVersion['Legacy'],
19
- }
16
+ const ValueChatappVersion = Object.freeze({
17
+ 'false': Version['Actual'],
18
+ 'true': Version['Legacy'],
19
+ })
20
20
 
21
- var ChatappVersionShape = /** @type {const} */ ({
22
- [ChatappVersion['Actual']]: {
21
+ const ChatappVersionShape = Object.freeze({
22
+ [Version['Actual']]: Object.freeze({
23
23
  chatapp_legacy: false,
24
- },
24
+ }),
25
25
 
26
- [ChatappVersion['Legacy']]: {
26
+ [Version['Legacy']]: Object.freeze({
27
27
  chatapp_legacy: true,
28
- },
28
+ }),
29
29
  })
30
30
 
31
- /** @returns {keyof typeof ChatappVersion | 'Unknown'} */
32
- export var inferChatappVersion = value =>
31
+ /** @returns {keyof typeof Version | 'Unknown'} */
32
+ export const inferChatappVersion = Object.freeze(value =>
33
33
  ValueChatappVersion[value?.chatapp_legacy]
34
- ?? ChatappVersion[value]
34
+ ?? ValueChatappVersion[value]
35
+ ?? Version[value]
35
36
  ?? 'Unknown'
37
+ )
36
38
 
37
- /** @returns {typeof ChatappVersionShape[keyof typeof ChatappVersionShape] | { readonly chatapp_legacy: null }} */
38
- export var inferChatappVersionShape = value =>
39
+ /** @returns {typeof ChatappVersionShape[keyof typeof ChatappVersionShape] | { chatapp_legacy: null }} */
40
+ export const inferChatappVersionShape = Object.freeze(value =>
39
41
  ChatappVersionShape[value]
40
42
  ?? { chatapp_legacy: null }
43
+ )