Skip to content

Commit 299e25b

Browse files
committed
👍 Add benchmark for strict mode of isObjectOf<T>
1 parent fbfda27 commit 299e25b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

is_bench.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ Deno.bench({
170170
}
171171
},
172172
});
173+
Deno.bench({
174+
name: "is.ObjectOf (strict)",
175+
fn: () => {
176+
const pred = is.ObjectOf(predObj, { strict: true });
177+
for (const c of cs) {
178+
pred(c);
179+
}
180+
},
181+
});
173182

174183
const isObjectOfPred = is.ObjectOf(predObj);
175184
Deno.bench({
@@ -181,6 +190,16 @@ Deno.bench({
181190
},
182191
});
183192

193+
const isObjectOfStrictPred = is.ObjectOf(predObj, { strict: true });
194+
Deno.bench({
195+
name: "is.ObjectOf (pre, strict)",
196+
fn: () => {
197+
for (const c of cs) {
198+
isObjectOfStrictPred(c);
199+
}
200+
},
201+
});
202+
184203
Deno.bench({
185204
name: "is.Function",
186205
fn: () => {

0 commit comments

Comments
 (0)