@koine/next 1.0.69 → 1.0.70
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/config/index.d.ts +1 -1
- package/config/index.js +7 -6
- package/node/config/index.js +7 -6
- package/node/to.js +1 -1
- package/package.json +3 -3
- package/to.js +1 -1
package/config/index.d.ts
CHANGED
package/config/index.js
CHANGED
|
@@ -56,8 +56,8 @@ export function encodePathname(pathname) {
|
|
|
56
56
|
*
|
|
57
57
|
* Here we add the wildcard flag maybe found in the pathname to the template
|
|
58
58
|
* name too, this is because we do not want to have the wildcard in the JSON
|
|
59
|
-
* keys as those are also used to
|
|
60
|
-
*
|
|
59
|
+
* keys as those are also used to throught the `useT` hook and having asterisks
|
|
60
|
+
* there is a bit cumbersome.
|
|
61
61
|
*
|
|
62
62
|
* @see https://nextjs.org/docs/messages/invalid-multi-match
|
|
63
63
|
*/
|
|
@@ -69,13 +69,14 @@ function transformRoute(route) {
|
|
|
69
69
|
var pathname = pathnameParts
|
|
70
70
|
.map(function (part) {
|
|
71
71
|
var _a, _b;
|
|
72
|
+
var hasWildcard = part.endsWith("*");
|
|
73
|
+
part = part.replace("*", "");
|
|
72
74
|
var isDynamic = part.startsWith("{{") && part.endsWith("}}");
|
|
73
75
|
var asValue = isDynamic
|
|
74
76
|
? (_b = (_a = part.match(/{{(.+)}}/)) === null || _a === void 0 ? void 0 : _a[1].trim()) !== null && _b !== void 0 ? _b : ""
|
|
75
77
|
: part.trim();
|
|
76
|
-
var
|
|
77
|
-
|
|
78
|
-
mapPartsByIdx[asValue.replace("*", "")] = {
|
|
78
|
+
var asPath = encodeURIComponent(asValue) + (hasWildcard ? "*" : "");
|
|
79
|
+
mapPartsByIdx[asValue] = {
|
|
79
80
|
isDynamic: isDynamic,
|
|
80
81
|
hasWildcard: hasWildcard,
|
|
81
82
|
};
|
|
@@ -90,7 +91,7 @@ function transformRoute(route) {
|
|
|
90
91
|
? (_b = (_a = part.match(/\[(.+)\]/)) === null || _a === void 0 ? void 0 : _a[1].trim()) !== null && _b !== void 0 ? _b : ""
|
|
91
92
|
: part.trim();
|
|
92
93
|
var hasWildcard = (_c = mapPartsByIdx[asValue]) === null || _c === void 0 ? void 0 : _c.hasWildcard;
|
|
93
|
-
var asPath = encodeURIComponent(asValue
|
|
94
|
+
var asPath = encodeURIComponent(asValue) + (hasWildcard ? "*" : "");
|
|
94
95
|
return isDynamic ? ":".concat(asPath) : asPath;
|
|
95
96
|
})
|
|
96
97
|
.join("/");
|
package/node/config/index.js
CHANGED
|
@@ -62,8 +62,8 @@ exports.encodePathname = encodePathname;
|
|
|
62
62
|
*
|
|
63
63
|
* Here we add the wildcard flag maybe found in the pathname to the template
|
|
64
64
|
* name too, this is because we do not want to have the wildcard in the JSON
|
|
65
|
-
* keys as those are also used to
|
|
66
|
-
*
|
|
65
|
+
* keys as those are also used to throught the `useT` hook and having asterisks
|
|
66
|
+
* there is a bit cumbersome.
|
|
67
67
|
*
|
|
68
68
|
* @see https://nextjs.org/docs/messages/invalid-multi-match
|
|
69
69
|
*/
|
|
@@ -75,13 +75,14 @@ function transformRoute(route) {
|
|
|
75
75
|
var pathname = pathnameParts
|
|
76
76
|
.map(function (part) {
|
|
77
77
|
var _a, _b;
|
|
78
|
+
var hasWildcard = part.endsWith("*");
|
|
79
|
+
part = part.replace("*", "");
|
|
78
80
|
var isDynamic = part.startsWith("{{") && part.endsWith("}}");
|
|
79
81
|
var asValue = isDynamic
|
|
80
82
|
? (_b = (_a = part.match(/{{(.+)}}/)) === null || _a === void 0 ? void 0 : _a[1].trim()) !== null && _b !== void 0 ? _b : ""
|
|
81
83
|
: part.trim();
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
mapPartsByIdx[asValue.replace("*", "")] = {
|
|
84
|
+
var asPath = encodeURIComponent(asValue) + (hasWildcard ? "*" : "");
|
|
85
|
+
mapPartsByIdx[asValue] = {
|
|
85
86
|
isDynamic: isDynamic,
|
|
86
87
|
hasWildcard: hasWildcard,
|
|
87
88
|
};
|
|
@@ -96,7 +97,7 @@ function transformRoute(route) {
|
|
|
96
97
|
? (_b = (_a = part.match(/\[(.+)\]/)) === null || _a === void 0 ? void 0 : _a[1].trim()) !== null && _b !== void 0 ? _b : ""
|
|
97
98
|
: part.trim();
|
|
98
99
|
var hasWildcard = (_c = mapPartsByIdx[asValue]) === null || _c === void 0 ? void 0 : _c.hasWildcard;
|
|
99
|
-
var asPath = encodeURIComponent(asValue
|
|
100
|
+
var asPath = encodeURIComponent(asValue) + (hasWildcard ? "*" : "");
|
|
100
101
|
return isDynamic ? ":".concat(asPath) : asPath;
|
|
101
102
|
})
|
|
102
103
|
.join("/");
|
package/node/to.js
CHANGED
package/package.json
CHANGED
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": "^16.8 || ^17 || ^18",
|
|
20
20
|
"next": "^12.2.3",
|
|
21
|
-
"@koine/utils": "1.0.
|
|
21
|
+
"@koine/utils": "1.0.70",
|
|
22
22
|
"framer-motion": "^6.5.1",
|
|
23
|
-
"@koine/react": "1.0.
|
|
23
|
+
"@koine/react": "1.0.70",
|
|
24
24
|
"styled-components": "^5.3.5",
|
|
25
25
|
"@mui/base": "^5.0.0-alpha.90",
|
|
26
26
|
"react-icons": "^4.4.0",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"next-seo": "^5.5.0",
|
|
42
42
|
"@hookform/resolvers": "^2.9.6"
|
|
43
43
|
},
|
|
44
|
-
"version": "1.0.
|
|
44
|
+
"version": "1.0.70",
|
|
45
45
|
"module": "./index.js",
|
|
46
46
|
"types": "./index.d.ts"
|
|
47
47
|
}
|