Skip to content

Commit 4730af1

Browse files
committed
Decompression filtering option array now allows RegExp objects as members
1 parent 15ece54 commit 4730af1

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/schemas.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,24 @@
1010
*/
1111

1212
import path from "node:path";
13-
import { array, boolean, min, number, object, optional, refine, string, union } from "superstruct";
13+
import {
14+
array,
15+
boolean,
16+
min,
17+
number,
18+
object,
19+
optional,
20+
refine,
21+
regexp,
22+
string,
23+
union,
24+
} from "superstruct";
1425
import validator from "validator";
1526
import * as c from "./constants.js";
1627
import utils from "./utils.js";
1728

1829
export const DecompressionOptionsStruct = object({
19-
filter: optional(array(string())),
30+
filter: optional(array(union([regexp(), string()]))),
2031
strip: optional(min(number(), 0)),
2132
});
2233

types/internal.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface UrlDest {
1919
}
2020

2121
export interface DecompressionOptions {
22-
filter?: string[];
22+
filter?: (RegExp | string)[];
2323
strip?: number;
2424
}
2525

0 commit comments

Comments
 (0)