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

16 lines
392 B
TypeScript
Raw Normal View History

import { bench, describe } from 'vitest';
import { snakeCase as snakeCaseToolkit } from 'es-toolkit';
import { snakeCase as snakeCaseLodash } from 'lodash';
describe('snakeCase', () => {
bench('es-toolkit/snakeCase', () => {
2024-07-11 09:48:16 +03:00
const str = 'camelCase';
snakeCaseToolkit(str);
});
bench('lodash/snakeCase', () => {
const str = 'camelCase';
snakeCaseLodash(str);
});
});