From f06956efd2dc4bf77244a9fcce2b883a00b925af Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Thu, 21 Dec 2023 22:46:53 +0800 Subject: updated node modules --- node_modules/@babel/traverse/lib/path/comments.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'node_modules/@babel/traverse/lib/path/comments.js') diff --git a/node_modules/@babel/traverse/lib/path/comments.js b/node_modules/@babel/traverse/lib/path/comments.js index 0a4eed6f..43b3b72a 100644 --- a/node_modules/@babel/traverse/lib/path/comments.js +++ b/node_modules/@babel/traverse/lib/path/comments.js @@ -36,12 +36,10 @@ function shareCommentsWithSiblings() { } } function removeIfExisting(list, toRemove) { - if (!toRemove) return list; - let lastFoundIndex = -1; + if (!(toRemove != null && toRemove.length)) return list; + const set = new Set(toRemove); return list.filter(el => { - const i = toRemove.indexOf(el, lastFoundIndex); - if (i === -1) return true; - lastFoundIndex = i; + return !set.has(el); }); } function addComment(type, content, line) { -- cgit v1.2.3