Skip to content

Commit ce7a08f

Browse files
committed
Simplified regex
1 parent 4394707 commit ce7a08f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/core/src/type.validator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ export const hasSuper = (method: any, superProp?: string): boolean => {
209209
// Remove line comments //
210210
code = code.replace(/\/\/.*/g, '');
211211

212-
// Remove strings (single quotes, double quotes, backticks) to avoid false positives
213-
// Pattern handles escaped quotes inside strings
214-
code = code.replace(/(['"`])(?:(?=(\\?))\2.)*?\1/g, '');
212+
// Remove strings to avoid false positives in string literals
213+
// Simple approach: remove quoted strings
214+
code = code.replace(/["'`]([^"'`])*?["'`]/g, '');
215215

216216
return superProp
217217
? code.includes(`super.${superProp}`)

0 commit comments

Comments
 (0)