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

16 lines
394 B
TypeScript
Raw Normal View History

2024-07-14 11:23:57 +03:00
import { bench, describe } from 'vitest';
import { camelCase as camelCaseToolkit } from 'es-toolkit';
import { camelCase as camelCaseLodash } from 'lodash';
describe('camelCase', () => {
bench('es-toolkit/camelCase', () => {
const str = 'kebab-case';
camelCaseToolkit(str);
});
bench('lodash/camelCase', () => {
const str = 'kebab-case';
camelCaseLodash(str);
});
});