@docusaurus/core 0.0.0-5281 → 0.0.0-5287

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.
Files changed (2) hide show
  1. package/lib/server/routes.js +2 -18
  2. package/package.json +10 -10
@@ -68,24 +68,8 @@ ${indent(subroutesCodeStrings.join(',\n'))}
68
68
  ]`);
69
69
  }
70
70
  Object.entries(props).forEach(([propName, propValue]) => {
71
- // Inspired by https://github.com/armanozak/should-quote/blob/main/packages/should-quote/src/lib/should-quote.ts
72
- const shouldQuote = ((key) => {
73
- // Pre-sanitation to prevent injection
74
- if (/[.,;:}/\s]/.test(key)) {
75
- return true;
76
- }
77
- try {
78
- // If this key can be used in an expression like ({a:0}).a
79
- // eslint-disable-next-line no-eval
80
- eval(`({${key}:0}).${key}`);
81
- return false;
82
- }
83
- catch {
84
- return true;
85
- }
86
- })(propName);
87
- // Escape quotes as well
88
- const key = shouldQuote ? JSON.stringify(propName) : propName;
71
+ const isIdentifier = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u.test(propName);
72
+ const key = isIdentifier ? propName : JSON.stringify(propName);
89
73
  parts.push(`${key}: ${JSON.stringify(propValue)}`);
90
74
  });
91
75
  return `{
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@docusaurus/core",
3
3
  "description": "Easy to Maintain Open Source Documentation Websites",
4
- "version": "0.0.0-5281",
4
+ "version": "0.0.0-5287",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -43,13 +43,13 @@
43
43
  "@babel/runtime": "^7.18.9",
44
44
  "@babel/runtime-corejs3": "^7.18.9",
45
45
  "@babel/traverse": "^7.18.10",
46
- "@docusaurus/cssnano-preset": "0.0.0-5281",
47
- "@docusaurus/logger": "0.0.0-5281",
48
- "@docusaurus/mdx-loader": "0.0.0-5281",
46
+ "@docusaurus/cssnano-preset": "0.0.0-5287",
47
+ "@docusaurus/logger": "0.0.0-5287",
48
+ "@docusaurus/mdx-loader": "0.0.0-5287",
49
49
  "@docusaurus/react-loadable": "5.5.2",
50
- "@docusaurus/utils": "0.0.0-5281",
51
- "@docusaurus/utils-common": "0.0.0-5281",
52
- "@docusaurus/utils-validation": "0.0.0-5281",
50
+ "@docusaurus/utils": "0.0.0-5287",
51
+ "@docusaurus/utils-common": "0.0.0-5287",
52
+ "@docusaurus/utils-validation": "0.0.0-5287",
53
53
  "@slorber/static-site-generator-webpack-plugin": "^4.0.7",
54
54
  "@svgr/webpack": "^6.3.1",
55
55
  "autoprefixer": "^10.4.8",
@@ -106,8 +106,8 @@
106
106
  "webpackbar": "^5.0.2"
107
107
  },
108
108
  "devDependencies": {
109
- "@docusaurus/module-type-aliases": "0.0.0-5281",
110
- "@docusaurus/types": "0.0.0-5281",
109
+ "@docusaurus/module-type-aliases": "0.0.0-5287",
110
+ "@docusaurus/types": "0.0.0-5287",
111
111
  "@types/detect-port": "^1.3.2",
112
112
  "@types/react-dom": "^18.0.6",
113
113
  "@types/react-router-config": "^5.0.6",
@@ -127,5 +127,5 @@
127
127
  "engines": {
128
128
  "node": ">=16.14"
129
129
  },
130
- "gitHead": "30e8125600e78fb976c2d0861ac89314116d6936"
130
+ "gitHead": "b9f8470692eac0939a0da86ba75c9a315961ec3a"
131
131
  }