From 23b60dc1975db38c280d8a123aff97544d1673e0 Mon Sep 17 00:00:00 2001 From: HelenHuang <LinHuang@pollex.com.tw> Date: 星期四, 09 六月 2022 15:34:21 +0800 Subject: [PATCH] TODO#139890 FAQ 常見問題 1-文案調整 --- PAMapp/node_modules/picomatch/lib/parse.js | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/PAMapp/node_modules/picomatch/lib/parse.js b/PAMapp/node_modules/picomatch/lib/parse.js index c16d59d..58269d0 100644 --- a/PAMapp/node_modules/picomatch/lib/parse.js +++ b/PAMapp/node_modules/picomatch/lib/parse.js @@ -250,7 +250,14 @@ } if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { - output = token.close = `)${rest})${extglobStar})`; + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; } if (token.prev.type === 'bos') { -- Gitblit v1.8.0