es-toolkit/benchmarks/takeRightWhile.bench.ts
Minsoo Kim cf65b2c601
style(*): Setup prettier and apply formatting (#24)
* chore: add prettierrc

* chore: apply format with prettier config

* chore: eslint error fix
2024-06-04 17:19:26 +09:00

14 lines
397 B
TypeScript

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