es-toolkit/benchmarks/performance/isArray.bench.ts
2024-08-19 21:22:35 +09:00

18 lines
447 B
TypeScript

import { bench, describe } from 'vitest';
import { isArray as isArrayToolkit } from 'es-toolkit/compat';
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(() => {});
});
});