We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd4bf23 commit b283f64Copy full SHA for b283f64
2 files changed
packages/plugin-kit/src/config-comment-parser.js
@@ -155,7 +155,7 @@ export class ConfigCommentParser {
155
* But we are supporting that. So this is a fallback for that.
156
*/
157
const normalizedString = string
158
- .replace(/([-a-zA-Z0-9/]+):/gu, '"$1":')
+ .replace(/(?<![-a-zA-Z0-9/])([-a-zA-Z0-9/]+):/gu, '"$1":')
159
.replace(/(\]|[0-9])\s+(?=")/u, "$1,");
160
161
try {
packages/plugin-kit/tests/config-comment-parser.test.js
@@ -254,6 +254,11 @@ describe("ConfigCommentParser", () => {
254
},
255
});
256
257
+
258
+ it("should not timeout for large inputs", () => {
259
+ const code = `${"A".repeat(100_000)}?: 1 B: 2`;
260
+ commentParser.parseJSONLikeConfig(code);
261
+ });
262
263
264
describe("parseDirective", () => {
0 commit comments