es-toolkit/benchmarks/performance/capitalize.bench.ts
2024-07-17 11:47:39 +09:00

16 lines
401 B
TypeScript

import { bench, describe } from 'vitest';
import { capitalize as capitalizeToolkit } from 'es-toolkit';
import { capitalize as capitalizeLodash } from 'lodash';
describe('capitalize', () => {
bench('es-toolkit/capitalize', () => {
const str = 'camelCase';
capitalizeToolkit(str);
});
bench('lodash/capitalize', () => {
const str = 'camelCase';
capitalizeLodash(str);
});
});