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

16 lines
452 B
TypeScript
Raw Normal View History

2024-07-25 06:04:32 +03:00
import { property as propertyToolkit } from 'es-toolkit/compat';
import { property as propertyLodash } from 'lodash';
import { bench, describe } from 'vitest';
describe('property', () => {
bench('es-toolkit/property', () => {
const getValue = propertyToolkit('a.b');
getValue({ 'a.b': 1, a: { b: 1 } });
2024-08-11 04:54:13 +03:00
});
2024-07-25 06:04:32 +03:00
bench('lodash/property', () => {
const getValue = propertyLodash('a.b');
getValue({ 'a.b': 1, a: { b: 1 } });
2024-08-11 04:54:13 +03:00
});
});