@shakerquiz/utilities 0.3.3 → 0.3.5
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
|
@@ -387,6 +387,13 @@ export var ServiceFeatureNetworkURLs = new Map([
|
|
|
387
387
|
[Networks.Public, null],
|
|
388
388
|
]),
|
|
389
389
|
],
|
|
390
|
+
[
|
|
391
|
+
Features.Exception,
|
|
392
|
+
new Map([
|
|
393
|
+
[Networks.Docker, null],
|
|
394
|
+
[Networks.Public, null],
|
|
395
|
+
]),
|
|
396
|
+
],
|
|
390
397
|
[
|
|
391
398
|
Features.Game,
|
|
392
399
|
new Map([
|
|
@@ -539,6 +546,13 @@ export var ServiceFeatureNetworkURLs = new Map([
|
|
|
539
546
|
[
|
|
540
547
|
Services.Landing,
|
|
541
548
|
new Map([
|
|
549
|
+
[
|
|
550
|
+
Features.Exception,
|
|
551
|
+
new Map([
|
|
552
|
+
[Networks.Docker, null],
|
|
553
|
+
[Networks.Public, null],
|
|
554
|
+
]),
|
|
555
|
+
],
|
|
542
556
|
[
|
|
543
557
|
Features.Game,
|
|
544
558
|
new Map([
|
|
@@ -642,6 +656,13 @@ export var ServiceFeatureNetworkURLs = new Map([
|
|
|
642
656
|
[
|
|
643
657
|
Services.MiniApp,
|
|
644
658
|
new Map([
|
|
659
|
+
[
|
|
660
|
+
Features.Exception,
|
|
661
|
+
new Map([
|
|
662
|
+
[Networks.Docker, null],
|
|
663
|
+
[Networks.Public, null],
|
|
664
|
+
]),
|
|
665
|
+
],
|
|
645
666
|
[
|
|
646
667
|
Features.Game,
|
|
647
668
|
new Map([
|
|
@@ -683,6 +704,13 @@ export var ServiceFeatureNetworkURLs = new Map([
|
|
|
683
704
|
[Networks.Public, ''],
|
|
684
705
|
]),
|
|
685
706
|
],
|
|
707
|
+
[
|
|
708
|
+
Features.Home,
|
|
709
|
+
new Map([
|
|
710
|
+
[Networks.Docker, null],
|
|
711
|
+
[Networks.Public, null],
|
|
712
|
+
]),
|
|
713
|
+
],
|
|
686
714
|
[
|
|
687
715
|
Features.User,
|
|
688
716
|
new Map([
|
|
@@ -74,52 +74,52 @@ export var useFetch = (service, feature, network) =>
|
|
|
74
74
|
function fetcher(options, init) {
|
|
75
75
|
if (!(service in Services))
|
|
76
76
|
throw TypeError(
|
|
77
|
-
`
|
|
77
|
+
`Service '${service}' is not listed in 'Services'.`,
|
|
78
78
|
)
|
|
79
79
|
|
|
80
80
|
if (!(feature in Features))
|
|
81
81
|
throw TypeError(
|
|
82
|
-
`Feature '${feature}'
|
|
82
|
+
`Feature '${feature}' is not listed in 'Features'.`,
|
|
83
83
|
)
|
|
84
84
|
|
|
85
85
|
if (!(feature in FeaturePathnames))
|
|
86
86
|
throw TypeError(
|
|
87
|
-
`Feature '${feature}'
|
|
87
|
+
`Feature '${feature}' is not listed in 'FeaturePathnames'.`,
|
|
88
88
|
)
|
|
89
89
|
|
|
90
|
-
if (!
|
|
90
|
+
if (!ServiceFeatures[service].includes(feature))
|
|
91
91
|
throw TypeError(
|
|
92
|
-
`Feature '${feature}'
|
|
92
|
+
`Feature '${feature}' is not listed in 'ServiceFeatures[${service}]'.`,
|
|
93
93
|
)
|
|
94
94
|
|
|
95
95
|
if (!(init.method in RequestMethods))
|
|
96
96
|
throw TypeError(
|
|
97
|
-
`Method '${init.method}'
|
|
97
|
+
`Method '${init.method}' is not listed in 'RequestMethods'.`,
|
|
98
98
|
)
|
|
99
99
|
|
|
100
100
|
if (!(network in Networks))
|
|
101
101
|
throw TypeError(
|
|
102
|
-
`Network '${network}'
|
|
102
|
+
`Network '${network}' is not listed in 'Networks'.`,
|
|
103
103
|
)
|
|
104
104
|
|
|
105
105
|
if (!ServiceFeatureNetworkURLs.has(service))
|
|
106
106
|
throw TypeError(
|
|
107
|
-
`Service '${service}'
|
|
107
|
+
`Service '${service}' is not listed in 'ServiceFeatureNetworkURLs'.`,
|
|
108
108
|
)
|
|
109
109
|
|
|
110
110
|
if (!ServiceFeatureNetworkURLs.get(service).has(feature))
|
|
111
111
|
throw TypeError(
|
|
112
|
-
`Feature '${feature}'
|
|
112
|
+
`Feature '${feature}' is not listed in 'ServiceFeatureNetworkURLs[${service}]'.`,
|
|
113
113
|
)
|
|
114
114
|
|
|
115
115
|
if (!ServiceFeatureNetworkURLs.get(service).get(feature).has(network))
|
|
116
116
|
throw TypeError(
|
|
117
|
-
`Network '${network}'
|
|
117
|
+
`Network '${network}' is not listed in 'ServiceFeatureNetworkURLs[${service}][${feature}]'.`,
|
|
118
118
|
)
|
|
119
119
|
|
|
120
120
|
if (!ServiceFeatureNetworkURLs.get(service).get(feature).get(network))
|
|
121
121
|
throw TypeError(
|
|
122
|
-
`Network '${network}' of 'ServiceFeatureNetworkURLs[service][feature]'
|
|
122
|
+
`Network '${network}' of 'ServiceFeatureNetworkURLs[${service}][${feature}]' has no value.`,
|
|
123
123
|
)
|
|
124
124
|
|
|
125
125
|
extensions.set(
|
|
@@ -44,6 +44,16 @@ export var setServiceNetworkOrigins = origins => {
|
|
|
44
44
|
`Feature '${feature}' must be listed in 'FeaturePathnames'.`,
|
|
45
45
|
)
|
|
46
46
|
|
|
47
|
+
if (!ServiceFeatureNetworkURLs.has(service))
|
|
48
|
+
throw TypeError(
|
|
49
|
+
`Service '${service}' must be listed in 'ServiceFeatureNetworkURLs'.`,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
if (!ServiceFeatureNetworkURLs.get(service).has(feature))
|
|
53
|
+
throw TypeError(
|
|
54
|
+
`Feature '${feature}' must be listed in 'ServiceFeatureNetworkURLs[${service}]'.`,
|
|
55
|
+
)
|
|
56
|
+
|
|
47
57
|
ServiceFeatureNetworkURLs
|
|
48
58
|
.get(service)
|
|
49
59
|
.get(feature)
|