@shakerquiz/utilities 0.5.201 → 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.201",
4
+ "version": "0.5.203",
5
5
  "author": "yurkimus <yurkimus@gmail.com>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -1,45 +1,48 @@
1
- export var Affilation = /** @type {const} */ ({
1
+ export const Affilation = Object.freeze({
2
2
  'Branch': 'Branch',
3
3
  'Franchise': 'Franchise',
4
4
  })
5
5
 
6
- export var Affilations = [
6
+ export const Affilations = Object.freeze([
7
7
  Affilation['Branch'],
8
8
  Affilation['Franchise'],
9
- ]
9
+ ])
10
10
 
11
- export var AffilationTitle = {
11
+ export const AffilationTitle = Object.freeze({
12
12
  [Affilation['Branch']]: 'Филиал',
13
13
  [Affilation['Franchise']]: 'Франшиза',
14
- }
14
+ })
15
15
 
16
- export var AffilationIcon = {
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
- var ValueAffilation = {
22
- ['false']: Affilation['Branch'],
23
- ['true']: Affilation['Franchise'],
24
- }
21
+ const ValueAffilation = Object.freeze({
22
+ 'false': Affilation['Branch'],
23
+ 'true': Affilation['Franchise'],
24
+ })
25
25
 
26
- var AffilationShape = {
27
- [Affilation['Branch']]: {
26
+ const AffilationShape = Object.freeze({
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
- },
34
- }
33
+ }),
34
+ })
35
35
 
36
36
  /** @returns {keyof typeof Affilation | 'Unknown'} */
37
- export var inferAffilation = value =>
37
+ export const inferAffilation = Object.freeze(value =>
38
38
  ValueAffilation[value?.is_franchise]
39
+ ?? ValueAffilation[value]
39
40
  ?? Affilation[value]
40
41
  ?? 'Unknown'
42
+ )
41
43
 
42
- /** @returns {typeof AffilationShape[keyof typeof AffilationShape] | { readonly is_franchise: null }} */
43
- export var inferAffilationShape = value =>
44
+ /** @returns {typeof AffilationShape[keyof typeof AffilationShape] | { is_franchise: null }} */
45
+ export const inferAffilationShape = Object.freeze(value =>
44
46
  AffilationShape[value]
45
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
+ )