es-toolkit/benchmarks/performance/camelCase.bench.ts
Dayong Lee 9c7218330e
Some checks are pending
CI / codecov (push) Waiting to run
Release / release (push) Waiting to run
feat(camelCase): implement camelCase in compat layer (#507)
* feat(camelCase): implement `camelCase` in compat layer

* A bench

* Change normalize way
2024-09-10 21:05:04 +09:00

22 lines
584 B
TypeScript

import { bench, describe } from 'vitest';
import { camelCase as camelCaseToolkit } from 'es-toolkit';
import { camelCase as camelCaseToolkitCompat } from 'es-toolkit/compat';
import { camelCase as camelCaseLodash } from 'lodash';
describe('camelCase', () => {
bench('es-toolkit/camelCase', () => {
const str = 'kebab-case';
camelCaseToolkit(str);
});
bench('es-toolkit/compat/camelCase', () => {
const str = 'kebab-case';
camelCaseToolkitCompat(str);
});
bench('lodash/camelCase', () => {
const str = 'kebab-case';
camelCaseLodash(str);
});
});