@shakerquiz/utilities 0.5.68 → 0.5.69

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.68",
4
+ "version": "0.5.69",
5
5
  "author": "yurkimus <yurkimus@gmail.com>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -1,16 +1,20 @@
1
1
  export var Service = /** @type {const} */ ({
2
2
  'Users': 'Users',
3
3
  'Roles': 'Roles',
4
- 'Checkin': 'Checkin',
5
4
  'Locations': 'Locations',
6
5
  'Cities': 'Cities',
7
6
  'Venues': 'Venues',
8
7
  'Themes': 'Themes',
9
8
  'Games': 'Games',
10
9
  'Registrations': 'Registrations',
10
+ 'Files': 'Files',
11
+ 'Checkin': 'Checkin',
11
12
  'Procedures': 'Procedures',
12
13
  'Integrations': 'Integrations',
13
14
  'Updates': 'Updates',
15
+ 'Hub': 'Hub',
16
+ 'Landing': 'Landing',
17
+ 'Vkma': 'Vkma',
14
18
  })
15
19
 
16
20
  export var Services = Object.values(Service)
@@ -536,7 +540,7 @@ export var getPluralSingularRouteRelation = value => {
536
540
  /**
537
541
  * @param {keyof Route} value
538
542
  */
539
- export var getRoutePathname = value => {
543
+ export var getRoutePathnamePattern = value => {
540
544
  var route = getRoute(value)
541
545
 
542
546
  if (!(route in RoutePathname))
@@ -545,9 +549,21 @@ export var getRoutePathname = value => {
545
549
  return RoutePathname[route]
546
550
  }
547
551
 
552
+ /**
553
+ * @param {keyof Route} value
554
+ */
555
+ export var getRoutePathnamePattern = value => {
556
+ var route = getRoute(value)
557
+
558
+ if (!(route in RoutePathname))
559
+ throw TypeError(`[getRoutePathname] Route '${route}' must be a member of RoutePathname.`)
560
+
561
+ return new URLPattern({ pathname: '/' + RoutePathname[route] })
562
+ }
563
+
548
564
  export var hydrateRoutePathname = (value, parameters) => {
549
565
  var route = getRoute(value)
550
- var pathname = getRoutePathname(route)
566
+ var pathname = getRoutePathnamePattern(route)
551
567
  var params = getRouteParams(route)
552
568
 
553
569
  return params.reduce(