es-toolkit/benchmarks/startCase.bench.ts
Deokgyung 7ee48c0e71
Some checks are pending
CI / codecov (push) Waiting to run
Release / release (push) Waiting to run
feat(startCase): add startCase (#203)
* feat: add startCase

* docs: add docs of startCase

* fix: startcase lint error
2024-07-17 22:42:58 +09:00

22 lines
716 B
TypeScript

import { startCase as startCaseToolkit } from 'es-toolkit';
import { startCase as startCaseLodash } from 'lodash';
import { bench, describe } from 'vitest';
describe('startCase', () => {
bench('es-toolkit/startCase', () => {
startCaseToolkit('hello world');
startCaseToolkit('--foo--bar__baz 123');
startCaseToolkit('123numericValues');
startCaseToolkit('XMLHttpRequest');
startCaseToolkit('hello-World_of XML_httpRequest');
});
bench('lodash/startCase', () => {
startCaseLodash('hello world');
startCaseLodash('--foo--bar__baz 123');
startCaseLodash('123numericValues');
startCaseLodash('XMLHttpRequest');
startCaseLodash('hello-World_of XML_httpRequest');
});
});