es-toolkit/benchmarks/capitalize.bench.ts
Atajan 16d326c4b2
feat(capitalize): add capitalize (#161)
* feat(capitalize): add capitalize

* fix(capitalize): return type

* Update docs/ko/reference/string/capitalize.md

---------

Co-authored-by: Sojin Park <raon0211@gmail.com>
2024-07-12 10:07:40 +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);
});
});