From fdfd7100fa2e419a330e0bf6d4decc8b218e609d Mon Sep 17 00:00:00 2001 From: howel52 Date: Wed, 6 Jan 2021 11:42:44 +0800 Subject: [PATCH] fix: support file which named '....' --- index.js | 3 ++- test/others.js | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 9dcee20..649c5f6 100644 --- a/index.js +++ b/index.js @@ -17,7 +17,8 @@ const REGEX_SPLITALL_CRLF = /\r?\n/g // ../foo, // . // .. -const REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/ + +const REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/ const SLASH = '/' const KEY_IGNORE = typeof Symbol !== 'undefined' diff --git a/test/others.js b/test/others.js index 85177ff..d60fcdd 100644 --- a/test/others.js +++ b/test/others.js @@ -188,6 +188,12 @@ const IGNORE_TEST_CASES = [ ['*.js', '!a/a.js'], 'a/a.js', [false, true] + ], + [ + `test: file which named '...'`, + 'foo', + '...', + [false, false] ] ]