@shakerquiz/utilities 0.5.222 → 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.
Files changed (70) hide show
  1. package/package.json +3 -5
  2. package/source/entities/blend.js +5 -0
  3. package/source/entities/cardinality-routes.js +82 -0
  4. package/source/entities/cardinality.js +8 -0
  5. package/source/entities/category.js +4 -0
  6. package/source/entities/city-affilation.js +16 -0
  7. package/source/entities/city-chatapp-version.js +9 -0
  8. package/source/entities/game-status.js +110 -0
  9. package/source/{enumerations → entities}/gender.js +7 -0
  10. package/source/entities/icon.js +654 -0
  11. package/source/entities/method.js +22 -0
  12. package/source/entities/mode.js +14 -0
  13. package/source/entities/network.js +9 -0
  14. package/source/entities/numerosity.js +5 -0
  15. package/source/entities/phase.js +23 -0
  16. package/source/entities/quantifier.js +41 -0
  17. package/source/entities/registration-attribute.js +68 -0
  18. package/source/entities/registration-channel.js +17 -0
  19. package/source/entities/registration-lineup.js +19 -0
  20. package/source/entities/registration-mailing.js +20 -0
  21. package/source/{enumerations/registration/status.js → entities/registration-status.js} +1 -13
  22. package/source/entities/role.js +25 -0
  23. package/source/entities/route-cardinality-route.js +112 -0
  24. package/source/entities/route-cardinality.js +175 -0
  25. package/source/entities/route-pathname-params.js +12 -0
  26. package/source/entities/route-pathname.js +70 -0
  27. package/source/entities/route-service.js +65 -0
  28. package/source/entities/route.js +70 -0
  29. package/source/entities/service-routes.js +34 -0
  30. package/source/entities/service-runtime.js +22 -0
  31. package/source/entities/service.js +39 -0
  32. package/source/entities/theme-status.js +14 -0
  33. package/source/entities/venue-audience.js +14 -0
  34. package/source/entities/venue-status.js +15 -0
  35. package/source/helpers/hydrate-route-pathname.js +32 -0
  36. package/source/helpers/string-tag.js +7 -0
  37. package/source/helpers/tag.js +37 -0
  38. package/source/index.js +41 -38
  39. package/source/prototypes/reflection.js +53 -0
  40. package/source/enumerations/blend.js +0 -11
  41. package/source/enumerations/cardinality.js +0 -13
  42. package/source/enumerations/category.js +0 -9
  43. package/source/enumerations/entities/affilation.js +0 -29
  44. package/source/enumerations/entities/game-status.js +0 -122
  45. package/source/enumerations/entities/registration-attribute.js +0 -83
  46. package/source/enumerations/entities/registration-channel.js +0 -26
  47. package/source/enumerations/entities/registration-mailing.js +0 -24
  48. package/source/enumerations/entities/role.js +0 -40
  49. package/source/enumerations/entities/version.js +0 -23
  50. package/source/enumerations/icon.js +0 -655
  51. package/source/enumerations/method.js +0 -31
  52. package/source/enumerations/mode.js +0 -48
  53. package/source/enumerations/network.js +0 -9
  54. package/source/enumerations/numerosity.js +0 -5
  55. package/source/enumerations/phase.js +0 -31
  56. package/source/enumerations/quantifier.js +0 -87
  57. package/source/enumerations/registration/lineup.js +0 -33
  58. package/source/enumerations/route.js +0 -515
  59. package/source/enumerations/service.js +0 -62
  60. package/source/enumerations/theme/status.js +0 -27
  61. package/source/enumerations/venue/audience.js +0 -27
  62. package/source/enumerations/venue/status.js +0 -27
  63. package/source/functions/hydrate-route-params.js +0 -18
  64. package/source/functions/hydrate-route-pathname.js +0 -26
  65. package/source/functions/string-tag.js +0 -5
  66. package/source/functions/tag.js +0 -37
  67. /package/source/{enumerations → entities}/constants.js +0 -0
  68. /package/source/{enumerations → entities}/display.js +0 -0
  69. /package/source/{enumerations → entities}/pattern.js +0 -0
  70. /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
- })
@@ -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)))
@@ -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} method
12
- * @param {R} route
13
- * @param {any[]} params
14
- *
15
- * @returns {`${M}/${P}`}
16
- */
17
- (method, route, params) => {
18
- var method = inferMethod(method)
19
-
20
- if (method === 'Unknown')
21
- throw TypeError(`Could not infer method of: '${method}'.`)
22
-
23
- return method + '/' + hydrateRoutePathname(route, params)
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} method
33
- * @param {R} route
34
- * @param {any[]} params
35
- */
36
- (method, route, params) => new RegExp(`^${tag(method, route, params)}$`),
37
- )
File without changes
File without changes
File without changes
File without changes