es-toolkit/benchmarks/performance/isArguments.bench.ts
Dayong Lee a02b4158eb
feat(isObjectLike, isArguments): Add isObjectLike and isArguments with compatibility test (#279)
* Add isObjectLike

* Add isArguments

* remove duplicate function noop

* Remove un duplicated function

* add bench

* update compatibility

* Add docs

---------

Co-authored-by: Sojin Park <raon0211@toss.im>
2024-07-25 16:36:57 +09:00

26 lines
734 B
TypeScript

import { bench, describe } from 'vitest';
import { isArguments as isArgumentsToolkit } from 'es-toolkit';
import { isArguments as isArgumentsLodash } from 'lodash';
describe('isArguments', () => {
bench('es-toolkit/isArguments', () => {
isArgumentsToolkit([1, 2, 3]);
isArgumentsToolkit(true);
isArgumentsToolkit(new Date());
isArgumentsToolkit(new Error());
isArgumentsToolkit(1);
isArgumentsToolkit(/x/);
isArgumentsToolkit('a');
});
bench('lodash/isArguments', () => {
isArgumentsLodash([1, 2, 3]);
isArgumentsLodash(true);
isArgumentsLodash(new Date());
isArgumentsLodash(new Error());
isArgumentsLodash(1);
isArgumentsLodash(/x/);
isArgumentsLodash('a');
});
});