mirror of
https://github.com/toss/es-toolkit.git
synced 2024-12-01 10:45:08 +03:00
16 lines
449 B
TypeScript
16 lines
449 B
TypeScript
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 } });
|
|
})
|
|
|
|
bench('lodash/property', () => {
|
|
const getValue = propertyLodash('a.b');
|
|
getValue({ 'a.b': 1, a: { b: 1 } });
|
|
})
|
|
})
|