mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-28 20:26:33 +03:00
24 lines
550 B
TypeScript
24 lines
550 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { get as getToolkit } from 'es-toolkit/compat';
|
|
import { get as getLodash } from 'lodash';
|
|
|
|
describe('get with string', () => {
|
|
bench('es-toolkit/get', () => {
|
|
getToolkit({ a: { b: 3 } }, 'a.b');
|
|
});
|
|
|
|
bench('lodash/get', () => {
|
|
getLodash({ a: { b: 3 } }, 'a.b');
|
|
});
|
|
});
|
|
|
|
describe('get with string array', () => {
|
|
bench('es-toolkit/get', () => {
|
|
getToolkit({ a: { b: 3 } }, ['a', 'b']);
|
|
});
|
|
|
|
bench('lodash/get', () => {
|
|
getLodash({ a: { b: 3 } }, ['a', 'b']);
|
|
});
|
|
});
|