@shakerquiz/utilities 0.5.221 → 0.5.222
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 +1 -1
- package/source/functions/{key.js → tag.js} +11 -11
- package/source/index.js +1 -1
package/package.json
CHANGED
|
@@ -8,19 +8,19 @@ export const tag = Object.freeze(
|
|
|
8
8
|
* @template {keyof typeof import('../enumerations/route.js').Route} R
|
|
9
9
|
* @template {typeof import('../enumerations/route.js').RoutePathname[R]} P
|
|
10
10
|
*
|
|
11
|
-
* @param {M}
|
|
12
|
-
* @param {R}
|
|
13
|
-
* @param {
|
|
11
|
+
* @param {M} method
|
|
12
|
+
* @param {R} route
|
|
13
|
+
* @param {any[]} params
|
|
14
14
|
*
|
|
15
15
|
* @returns {`${M}/${P}`}
|
|
16
16
|
*/
|
|
17
|
-
(
|
|
18
|
-
var method = inferMethod(
|
|
17
|
+
(method, route, params) => {
|
|
18
|
+
var method = inferMethod(method)
|
|
19
19
|
|
|
20
20
|
if (method === 'Unknown')
|
|
21
|
-
throw TypeError(`Could not infer method of: '${
|
|
21
|
+
throw TypeError(`Could not infer method of: '${method}'.`)
|
|
22
22
|
|
|
23
|
-
return method + '/' + hydrateRoutePathname(
|
|
23
|
+
return method + '/' + hydrateRoutePathname(route, params)
|
|
24
24
|
},
|
|
25
25
|
)
|
|
26
26
|
|
|
@@ -29,9 +29,9 @@ export const tagexp = Object.freeze(
|
|
|
29
29
|
* @template {keyof typeof import('../enumerations/method.js').Method} M
|
|
30
30
|
* @template {keyof typeof import('../enumerations/route.js').Route} R
|
|
31
31
|
*
|
|
32
|
-
* @param {M}
|
|
33
|
-
* @param {R}
|
|
34
|
-
* @param {
|
|
32
|
+
* @param {M} method
|
|
33
|
+
* @param {R} route
|
|
34
|
+
* @param {any[]} params
|
|
35
35
|
*/
|
|
36
|
-
(
|
|
36
|
+
(method, route, params) => new RegExp(`^${tag(method, route, params)}$`),
|
|
37
37
|
)
|
package/source/index.js
CHANGED
|
@@ -34,5 +34,5 @@ export * from './enumerations/registration/status.js'
|
|
|
34
34
|
|
|
35
35
|
export * from './functions/hydrate-route-params.js'
|
|
36
36
|
export * from './functions/hydrate-route-pathname.js'
|
|
37
|
-
export * from './functions/key.js'
|
|
38
37
|
export * from './functions/string-tag.js'
|
|
38
|
+
export * from './functions/tag.js'
|