mirror of
https://github.com/toss/es-toolkit.git
synced 2025-01-07 16:59:26 +03:00
9c7218330e
* feat(camelCase): implement `camelCase` in compat layer * A bench * Change normalize way
22 lines
584 B
TypeScript
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);
|
|
});
|
|
});
|