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', () => {
|
2024-06-18 04:40:07 +03:00
|
|
|
bench('es-toolkit/takeWhile', () => {
|
2024-04-25 14:56:13 +03:00
|
|
|
takeWhileToolkit([5, 4, 3, 2, 1], n => n < 4);
|
2024-06-04 11:19:26 +03:00
|
|
|
});
|
2024-04-25 14:56:13 +03:00
|
|
|
|
2024-06-18 04:40:07 +03:00
|
|
|
bench('lodash/takeWhile', () => {
|
2024-04-25 14:56:13 +03:00
|
|
|
takeWhileLodash([5, 4, 3, 2, 1], n => n < 4);
|
2024-06-04 11:19:26 +03:00
|
|
|
});
|
|
|
|
});
|