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

16 lines
386 B
TypeScript
Raw Normal View History

2024-08-15 14:58:58 +03:00
import { bench, describe } from 'vitest';
import { padEnd as padStartToolkit } from 'es-toolkit/compat';
import { padEnd as padStartLodash } from 'lodash';
describe('padEnd', () => {
bench('es-toolkit/padEnd', () => {
const str = 'abc';
padStartToolkit(str, 6, '_-');
});
bench('lodash/padEnd', () => {
const str = 'abc';
padStartLodash(str, 6, '_-');
});
});