@docusaurus/plugin-client-redirects 0.0.0-4685 → 0.0.0-4687
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/lib/collectRedirects.js
CHANGED
|
@@ -106,9 +106,7 @@ function createRedirectsOptionRedirects(redirectsOption) {
|
|
|
106
106
|
// Create redirects from the "createRedirects" fn provided by the user
|
|
107
107
|
function createCreateRedirectsOptionRedirects(paths, createRedirects) {
|
|
108
108
|
function createPathRedirects(path) {
|
|
109
|
-
const fromsMixed = createRedirects
|
|
110
|
-
? createRedirects(path) || []
|
|
111
|
-
: [];
|
|
109
|
+
const fromsMixed = createRedirects?.(path) ?? [];
|
|
112
110
|
const froms = typeof fromsMixed === 'string' ? [fromsMixed] : fromsMixed;
|
|
113
111
|
return froms.map((from) => ({
|
|
114
112
|
from,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-client-redirects",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-4687",
|
|
4
4
|
"description": "Client redirects plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-client-redirects.d.ts",
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "0.0.0-
|
|
22
|
-
"@docusaurus/logger": "0.0.0-
|
|
23
|
-
"@docusaurus/utils": "0.0.0-
|
|
24
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
25
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
21
|
+
"@docusaurus/core": "0.0.0-4687",
|
|
22
|
+
"@docusaurus/logger": "0.0.0-4687",
|
|
23
|
+
"@docusaurus/utils": "0.0.0-4687",
|
|
24
|
+
"@docusaurus/utils-common": "0.0.0-4687",
|
|
25
|
+
"@docusaurus/utils-validation": "0.0.0-4687",
|
|
26
26
|
"eta": "^1.12.3",
|
|
27
27
|
"fs-extra": "^10.0.1",
|
|
28
28
|
"lodash": "^4.17.21",
|
|
29
29
|
"tslib": "^2.3.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@docusaurus/types": "0.0.0-
|
|
32
|
+
"@docusaurus/types": "0.0.0-4687"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": "^16.8.4 || ^17.0.0",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=14"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "07732e16aa86d21c9c5713e03c7159201c2457de"
|
|
42
42
|
}
|
package/src/collectRedirects.ts
CHANGED
|
@@ -166,9 +166,7 @@ function createCreateRedirectsOptionRedirects(
|
|
|
166
166
|
createRedirects: PluginOptions['createRedirects'],
|
|
167
167
|
): RedirectMetadata[] {
|
|
168
168
|
function createPathRedirects(path: string): RedirectMetadata[] {
|
|
169
|
-
const fromsMixed: string | string[] = createRedirects
|
|
170
|
-
? createRedirects(path) || []
|
|
171
|
-
: [];
|
|
169
|
+
const fromsMixed: string | string[] = createRedirects?.(path) ?? [];
|
|
172
170
|
|
|
173
171
|
const froms: string[] =
|
|
174
172
|
typeof fromsMixed === 'string' ? [fromsMixed] : fromsMixed;
|