Skip to content

Commit 8241157

Browse files
committed
♻️ update mnml.any and mnml.all to use Array.some and Array.every
1 parent 9a296a9 commit 8241157

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mnml.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,11 @@ export const mnml = (() => {
283283
params.cache = {} as { [key: string]: any };
284284

285285
const any = (things: any[]): boolean => {
286-
return things.filter((thing) => !!thing).length > 0;
286+
return things.some((thing) => !!thing);
287287
};
288288

289289
const all = (things: any[]): boolean => {
290-
return things.filter((thing) => !!thing).length === things.length;
290+
return things.every((thing) => !!thing);
291291
};
292292

293293
return {

0 commit comments

Comments
 (0)