From 6598377223e852dbe46352f5c0d160579c58e17a Mon Sep 17 00:00:00 2001 From: Joyce Er Date: Fri, 18 Mar 2022 10:51:55 -0700 Subject: [PATCH] Use `Set.prototype.has` over `Array.prototype.includes` --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 7ac922bc..a45e0eda 100644 --- a/index.js +++ b/index.js @@ -155,10 +155,10 @@ micromatch.not = (list, patterns, options = {}) => { items.push(state.output); }; - let matches = micromatch(list, patterns, { ...options, onResult }); + let matches = new Set(micromatch(list, patterns, { ...options, onResult })); for (let item of items) { - if (!matches.includes(item)) { + if (!matches.has(item)) { result.add(item); } }