mirror of
https://github.com/toss/es-toolkit.git
synced 2024-12-01 10:45:08 +03:00
18 lines
573 B
TypeScript
18 lines
573 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/omitBy', () => {
|
|
const obj = { a: 1, b: 'omit', c: 3 };
|
|
const shouldOmit = (value: number | string) => typeof value === 'string';
|
|
omitByToolkit(obj, shouldOmit);
|
|
});
|
|
|
|
bench('lodash/omitBy', () => {
|
|
const obj = { a: 1, b: 'omit', c: 3 };
|
|
const shouldOmit = (value: number | string) => typeof value === 'string';
|
|
omitByLodash(obj, shouldOmit);
|
|
});
|
|
});
|