@shakerquiz/utilities 0.5.210 → 0.5.212

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.210",
4
+ "version": "0.5.212",
5
5
  "author": "yurkimus <yurkimus@gmail.com>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -2,13 +2,36 @@ import { inferMethod } from '../enumerations/method.js'
2
2
 
3
3
  import { hydrateRoutePathname } from './hydrate-route-pathname.js'
4
4
 
5
- export const tag = Object.freeze((m, r, p) => {
6
- var method = inferMethod(m)
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)
7
19
 
8
- if (method === 'Unknown')
9
- throw TypeError(`Could not infer method of: '${m}'.`)
20
+ if (method === 'Unknown')
21
+ throw TypeError(`Could not infer method of: '${m}'.`)
10
22
 
11
- return method + '/' + hydrateRoutePathname(r, p)
12
- })
23
+ return method + '/' + hydrateRoutePathname(r, p)
24
+ },
25
+ )
13
26
 
14
- export const tagexp = Object.freeze((m, r, p) => new RegExp(`^${tag(m, r, p)}$`))
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
+ )