Skip to content

Commit

Permalink
Do not support the s flag
Browse files Browse the repository at this point in the history
  • Loading branch information
tjenkinson committed Oct 21, 2023
1 parent a6d0ed7 commit 8ed3676
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/redos-detector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ describe('RedosDetector', () => {
expect(() => isSafe(/a/m)).toThrowError('Unsupported flag: m');
});

['u', 'g', 's', 'y', 'i'].forEach((flag) => {
['u', 'g', 'y', 'i'].forEach((flag) => {
it(`supports the "${flag}" flag`, () => {
expect(() => isSafe(new RegExp('a', flag))).not.toThrowError();
});
Expand Down
8 changes: 1 addition & 7 deletions src/redos-detector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,7 @@ export const defaultMaxBacktracks = 200;
export const defaultMaxSteps = 20000;
export const defaultUnicode = false;
export const defaultCaseInsensitive = false;
const supportedJSFlags: ReadonlySet<string> = new Set([
'u',
'g',
's',
'y',
'i',
]);
const supportedJSFlags: ReadonlySet<string> = new Set(['u', 'g', 'y', 'i']);

type PatternWithAtomicGroupOffsets = Readonly<{
atomicGroupOffsets: ReadonlySet<number>;
Expand Down

0 comments on commit 8ed3676

Please sign in to comment.