mirror of
https://github.com/toss/es-toolkit.git
synced 2024-12-01 10:45:08 +03:00
15 lines
502 B
TypeScript
15 lines
502 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { matches as matchesToolkit } from 'es-toolkit/compat';
|
|
import { matches as matchesLodash } from 'lodash';
|
|
|
|
describe('matches', () => {
|
|
bench('es-toolkit/matches', () => {
|
|
const isMatch = matchesToolkit({ a: { b: { c: 1 } } });
|
|
isMatch({ a: { b: { c: 1, d: 2 }, e: 3 }, f: 4 });
|
|
});
|
|
bench('lodash/matches', () => {
|
|
const isMatch = matchesLodash({ a: { b: { c: 1 } } });
|
|
isMatch({ a: { b: { c: 1, d: 2 }, e: 3 }, f: 4 });
|
|
});
|
|
});
|