es-toolkit/benchmarks/takeWhile.bench.ts

13 lines
359 B
TypeScript
Raw Normal View History

2024-04-25 14:56:13 +03:00
import { bench, describe } from 'vitest';
import { takeWhile as takeWhileToolkit } from 'es-toolkit';
import { takeWhile as takeWhileLodash } from 'lodash';
describe('takeWhile', () => {
bench('es-toolkit', () => {
takeWhileToolkit([5, 4, 3, 2, 1], n => n < 4);
})
bench('lodash', () => {
takeWhileLodash([5, 4, 3, 2, 1], n => n < 4);
})
});