es-toolkit/benchmarks/performance/padStart.bench.ts

16 lines
396 B
TypeScript
Raw Normal View History

import { bench, describe } from 'vitest';
2024-08-15 14:58:58 +03:00
import { padStart as padStartToolkit } from 'es-toolkit/compat';
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, '_-');
});
});