mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-28 20:26:33 +03:00
16 lines
452 B
TypeScript
16 lines
452 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 } });
|
|
});
|
|
});
|