es-toolkit/benchmarks/performance/padStart.bench.ts
Péter Kovács 8249ed25f8
feat(padStart): add padStart (#323)
* feat: add padStart function

* docs: add padStart doc
2024-07-31 21:55:00 +09:00

16 lines
389 B
TypeScript

import { bench, describe } from 'vitest';
import { padStart as padStartToolkit } from 'es-toolkit';
import { padStart as padStartLodash } from 'lodash';
describe('padStart', () => {
bench('es-toolkit/padStart', () => {
const str = 'abc';
padStartToolkit(str, 6, '_-');
});
bench('lodash/padStart', () => {
const str = 'abc';
padStartLodash(str, 6, '_-');
});
});