es-toolkit/benchmarks/performance/isArray.bench.ts
Dongho Kim fb51b98732
feat(isArray): Add isArray (#267)
* feat(isArray): Add `isArray`

* refactor(isArray): Simplify the return type of `isArray`
2024-07-21 10:35:59 +09:00

18 lines
440 B
TypeScript

import { bench, describe } from 'vitest';
import { isArray as isArrayToolkit } from 'es-toolkit';
import { isArray as isArrayLodash } from 'lodash';
describe('isArray', () => {
bench('es-toolkit/isArray', () => {
isArrayToolkit([1, 2, 3]);
isArrayToolkit('abc');
isArrayToolkit(() => {});
});
bench('lodash/isArray', () => {
isArrayLodash([1, 2, 3]);
isArrayLodash('abc');
isArrayLodash(() => {});
});
});