es-toolkit/benchmarks/performance/isMatch.bench.ts
2024-08-11 10:54:13 +09:00

13 lines
444 B
TypeScript

import { bench, describe } from 'vitest';
import { isMatch as isMatchToolkit } from 'es-toolkit/compat';
import { isMatch as isMatchLodash } from 'lodash';
describe('isMatch', () => {
bench('es-toolkit/isMatch', () => {
isMatchToolkit({ a: { b: { c: 1, d: 2 }, e: 3 }, f: 4 }, { a: { b: { c: 1 } } });
});
bench('lodash/isMatch', () => {
isMatchLodash({ a: { b: { c: 1, d: 2 }, e: 3 }, f: 4 }, { a: { b: { c: 1 } } });
});
});