mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-28 20:26:33 +03:00
a186e5d4bd
* feat: get * chore: add benchmark of get * test: get * feat: get * docs: get * Update src/object/get.ts --------- Co-authored-by: Sojin Park <raon0211@toss.im> Co-authored-by: Sojin Park <raon0211@gmail.com>
23 lines
532 B
TypeScript
23 lines
532 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { get as getToolkit } from 'es-toolkit';
|
|
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'])
|
|
})
|
|
}) |