@shakerquiz/utilities 0.5.221 → 0.6.0
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 +3 -5
- package/source/entities/blend.js +5 -0
- package/source/entities/cardinality-routes.js +82 -0
- package/source/entities/cardinality.js +8 -0
- package/source/entities/category.js +4 -0
- package/source/entities/city-affilation.js +16 -0
- package/source/entities/city-chatapp-version.js +9 -0
- package/source/entities/game-status.js +110 -0
- package/source/{enumerations → entities}/gender.js +7 -0
- package/source/entities/icon.js +654 -0
- package/source/entities/method.js +22 -0
- package/source/entities/mode.js +14 -0
- package/source/entities/network.js +9 -0
- package/source/entities/numerosity.js +5 -0
- package/source/entities/phase.js +23 -0
- package/source/entities/quantifier.js +41 -0
- package/source/entities/registration-attribute.js +68 -0
- package/source/entities/registration-channel.js +17 -0
- package/source/entities/registration-lineup.js +19 -0
- package/source/entities/registration-mailing.js +20 -0
- package/source/{enumerations/registration/status.js → entities/registration-status.js} +1 -13
- package/source/entities/role.js +25 -0
- package/source/entities/route-cardinality-route.js +112 -0
- package/source/entities/route-cardinality.js +175 -0
- package/source/entities/route-pathname-params.js +12 -0
- package/source/entities/route-pathname.js +70 -0
- package/source/entities/route-service.js +65 -0
- package/source/entities/route.js +70 -0
- package/source/entities/service-routes.js +34 -0
- package/source/entities/service-runtime.js +22 -0
- package/source/entities/service.js +39 -0
- package/source/entities/theme-status.js +14 -0
- package/source/entities/venue-audience.js +14 -0
- package/source/entities/venue-status.js +15 -0
- package/source/helpers/hydrate-route-pathname.js +32 -0
- package/source/helpers/string-tag.js +7 -0
- package/source/helpers/tag.js +37 -0
- package/source/index.js +41 -38
- package/source/prototypes/reflection.js +53 -0
- package/source/enumerations/blend.js +0 -11
- package/source/enumerations/cardinality.js +0 -13
- package/source/enumerations/category.js +0 -9
- package/source/enumerations/entities/affilation.js +0 -29
- package/source/enumerations/entities/game-status.js +0 -122
- package/source/enumerations/entities/registration-attribute.js +0 -83
- package/source/enumerations/entities/registration-channel.js +0 -26
- package/source/enumerations/entities/registration-mailing.js +0 -24
- package/source/enumerations/entities/role.js +0 -40
- package/source/enumerations/entities/version.js +0 -23
- package/source/enumerations/icon.js +0 -655
- package/source/enumerations/method.js +0 -31
- package/source/enumerations/mode.js +0 -48
- package/source/enumerations/network.js +0 -9
- package/source/enumerations/numerosity.js +0 -5
- package/source/enumerations/phase.js +0 -31
- package/source/enumerations/quantifier.js +0 -87
- package/source/enumerations/registration/lineup.js +0 -33
- package/source/enumerations/route.js +0 -515
- package/source/enumerations/service.js +0 -62
- package/source/enumerations/theme/status.js +0 -27
- package/source/enumerations/venue/audience.js +0 -27
- package/source/enumerations/venue/status.js +0 -27
- package/source/functions/hydrate-route-params.js +0 -18
- package/source/functions/hydrate-route-pathname.js +0 -26
- package/source/functions/key.js +0 -37
- package/source/functions/string-tag.js +0 -5
- /package/source/{enumerations → entities}/constants.js +0 -0
- /package/source/{enumerations → entities}/display.js +0 -0
- /package/source/{enumerations → entities}/pattern.js +0 -0
- /package/source/{enumerations → entities}/runtime.js +0 -0
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { inferRoute, inferRouteParams } from '../enumerations/route.js'
|
|
2
|
-
|
|
3
|
-
export const hydrateRouteParams = Object.freeze((r, p) => {
|
|
4
|
-
if (typeof p !== 'object' || p === null)
|
|
5
|
-
throw TypeError(`Parameter 'maybeParams' must be 'Object'.`)
|
|
6
|
-
|
|
7
|
-
var route = inferRoute(r)
|
|
8
|
-
|
|
9
|
-
if (route === 'Unknown')
|
|
10
|
-
throw TypeError(`Could not infer route of: '${r}'.`)
|
|
11
|
-
|
|
12
|
-
var routeParams = inferRouteParams(route)
|
|
13
|
-
|
|
14
|
-
if (routeParams === 'Unknown')
|
|
15
|
-
throw TypeError(`Could not infer route params of: '${route}'.`)
|
|
16
|
-
|
|
17
|
-
return routeParams.map(key => p[key.replace(':', '')] ?? key)
|
|
18
|
-
})
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { inferRoute, inferRouteParams, inferRoutePathname } from '../enumerations/route.js'
|
|
2
|
-
|
|
3
|
-
export const hydrateRoutePathname = Object.freeze((r, p) => {
|
|
4
|
-
if (!Array.isArray(p))
|
|
5
|
-
throw TypeError(`Parameter 'maybeRouteParams' must be 'Array'.`)
|
|
6
|
-
|
|
7
|
-
var route = inferRoute(r)
|
|
8
|
-
|
|
9
|
-
if (route === 'Unknown')
|
|
10
|
-
throw TypeError(`Could not infer route of: '${r}'.`)
|
|
11
|
-
|
|
12
|
-
var routePathname = inferRoutePathname(route)
|
|
13
|
-
|
|
14
|
-
if (routePathname === 'Unknown')
|
|
15
|
-
throw TypeError(`Could not infer route pathname of: '${route}'.`)
|
|
16
|
-
|
|
17
|
-
var routeParams = inferRouteParams(route)
|
|
18
|
-
|
|
19
|
-
if (routeParams === 'Unknown')
|
|
20
|
-
throw TypeError(`Could not infer route params of: '${route}'.`)
|
|
21
|
-
|
|
22
|
-
return routeParams.reduce(
|
|
23
|
-
(pathname, param, index) => pathname.replace(param, p[index]),
|
|
24
|
-
routePathname,
|
|
25
|
-
)
|
|
26
|
-
})
|
package/source/functions/key.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { inferMethod } from '../enumerations/method.js'
|
|
2
|
-
|
|
3
|
-
import { hydrateRoutePathname } from './hydrate-route-pathname.js'
|
|
4
|
-
|
|
5
|
-
export const tag = Object.freeze(
|
|
6
|
-
/**
|
|
7
|
-
* @template {keyof typeof import('../enumerations/method.js').Method} M
|
|
8
|
-
* @template {keyof typeof import('../enumerations/route.js').Route} R
|
|
9
|
-
* @template {typeof import('../enumerations/route.js').RoutePathname[R]} P
|
|
10
|
-
*
|
|
11
|
-
* @param {M} m
|
|
12
|
-
* @param {R} r
|
|
13
|
-
* @param {string[]} p
|
|
14
|
-
*
|
|
15
|
-
* @returns {`${M}/${P}`}
|
|
16
|
-
*/
|
|
17
|
-
(m, r, p) => {
|
|
18
|
-
var method = inferMethod(m)
|
|
19
|
-
|
|
20
|
-
if (method === 'Unknown')
|
|
21
|
-
throw TypeError(`Could not infer method of: '${m}'.`)
|
|
22
|
-
|
|
23
|
-
return method + '/' + hydrateRoutePathname(r, p)
|
|
24
|
-
},
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
export const tagexp = Object.freeze(
|
|
28
|
-
/**
|
|
29
|
-
* @template {keyof typeof import('../enumerations/method.js').Method} M
|
|
30
|
-
* @template {keyof typeof import('../enumerations/route.js').Route} R
|
|
31
|
-
*
|
|
32
|
-
* @param {M} m
|
|
33
|
-
* @param {R} r
|
|
34
|
-
* @param {string[]} p
|
|
35
|
-
*/
|
|
36
|
-
(m, r, p) => new RegExp(`^${tag(m, r, p)}$`),
|
|
37
|
-
)
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export const toStringTag = Object.freeze(x => Object.prototype.toString.call(x).slice(8, -1))
|
|
2
|
-
|
|
3
|
-
export const isStringTag = Object.freeze((tag, x) => tag === Object.prototype.toString.call(x).slice(8, -1))
|
|
4
|
-
|
|
5
|
-
export const isValue = Object.freeze((x, ...tags) => tags.includes(toStringTag(x)))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|