summaryrefslogtreecommitdiff
path: root/fs/walk.ts
diff options
context:
space:
mode:
authorVincent LE GOFF <g_n_s@hotmail.fr>2019-04-24 13:41:23 +0200
committerRyan Dahl <ry@tinyclouds.org>2019-04-24 07:41:22 -0400
commitdcd01dd02530df0e799eb4227087680ffeb80d74 (patch)
tree8cc1dec75dd17c326fea6d7fe471b7e7a31032f7 /fs/walk.ts
parente1f7a60bb326f8299f339635c0738d28431afa0a (diff)
Eslint fixes (denoland/deno_std#356)
Make warnings fail Original: https://github.com/denoland/deno_std/commit/4543b563a9a01c8c168aafcbfd9d4634effba7fc
Diffstat (limited to 'fs/walk.ts')
-rw-r--r--fs/walk.ts17
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/walk.ts b/fs/walk.ts
index 1e433e18b..b21044e72 100644
--- a/fs/walk.ts
+++ b/fs/walk.ts
@@ -14,15 +14,20 @@ function patternTest(patterns: RegExp[], path: string): boolean {
// Forced to reset last index on regex while iterating for have
// consistent results.
// See: https://stackoverflow.com/a/1520853
- return patterns.some(pattern => {
- let r = pattern.test(path);
- pattern.lastIndex = 0;
- return r;
- });
+ return patterns.some(
+ (pattern): boolean => {
+ let r = pattern.test(path);
+ pattern.lastIndex = 0;
+ return r;
+ }
+ );
}
function include(f: FileInfo, options: WalkOptions): boolean {
- if (options.exts && !options.exts.some(ext => f.path.endsWith(ext))) {
+ if (
+ options.exts &&
+ !options.exts.some((ext): boolean => f.path.endsWith(ext))
+ ) {
return false;
}
if (options.match && !patternTest(options.match, f.path)) {