es-toolkit/benchmarks/omitBy.bench.ts
Minsoo Kim cf65b2c601
style(*): Setup prettier and apply formatting (#24)
* chore: add prettierrc

* chore: apply format with prettier config

* chore: eslint error fix
2024-06-04 17:19:26 +09:00

18 lines
559 B
TypeScript

import { omitBy as omitByToolkit } from 'es-toolkit';
import { omitBy as omitByLodash } from 'lodash';
import { bench, describe } from 'vitest';
describe('omitBy', () => {
bench('es-toolkit', () => {
const obj = { a: 1, b: 'omit', c: 3 };
const shouldOmit = (value: number | string) => typeof value === 'string';
omitByToolkit(obj, shouldOmit);
});
bench('lodash', () => {
const obj = { a: 1, b: 'omit', c: 3 };
const shouldOmit = (value: number | string) => typeof value === 'string';
omitByLodash(obj, shouldOmit);
});
});