mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
add "extensions" arg to require-dir (#44494)
Co-authored-by: Justin Reidy <justin.reidy@airbnb.com>
This commit is contained in:
parent
9a94747cbf
commit
7a2dba0578
11
types/require-dir/index.d.ts
vendored
11
types/require-dir/index.d.ts
vendored
@ -4,11 +4,12 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface options {
|
||||
recurse?: boolean;
|
||||
duplicates?: boolean;
|
||||
filter?: any;
|
||||
mapKey?: any;
|
||||
mapValue?: any;
|
||||
recurse?: boolean;
|
||||
duplicates?: boolean;
|
||||
extensions?: string[];
|
||||
filter?: any;
|
||||
mapKey?: any;
|
||||
mapValue?: any;
|
||||
}
|
||||
|
||||
declare function requireDir(directory: string, options?: options): { [path: string]: any };
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
import requireDir = require('require-dir');
|
||||
|
||||
requireDir('./test-directory');
|
||||
requireDir('./test-directory', {
|
||||
recurse: false,
|
||||
extensions: ['.js', '.ts'],
|
||||
filter: (path: string) => path.match(/\.test\.[jt]s/),
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user