es-toolkit/benchmarks/performance/takeWhile.bench.ts
2024-07-17 11:47:39 +09:00

14 lines
382 B
TypeScript

import { bench, describe } from 'vitest';
import { takeWhile as takeWhileToolkit } from 'es-toolkit';
import { takeWhile as takeWhileLodash } from 'lodash';
describe('takeWhile', () => {
bench('es-toolkit/takeWhile', () => {
takeWhileToolkit([5, 4, 3, 2, 1], n => n < 4);
});
bench('lodash/takeWhile', () => {
takeWhileLodash([5, 4, 3, 2, 1], n => n < 4);
});
});