mirror of
https://github.com/toss/es-toolkit.git
synced 2024-12-01 10:45:08 +03:00
24 lines
550 B
TypeScript
24 lines
550 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { has as hasToolkit } from 'es-toolkit/compat';
|
|
import { has as hasLodash } from 'lodash';
|
|
|
|
describe('has with string', () => {
|
|
bench('es-toolkit/has', () => {
|
|
hasToolkit({ a: { b: 3 } }, 'a.b');
|
|
});
|
|
|
|
bench('lodash/has', () => {
|
|
hasLodash({ a: { b: 3 } }, 'a.b');
|
|
});
|
|
});
|
|
|
|
describe('has with string array', () => {
|
|
bench('es-toolkit/has', () => {
|
|
hasToolkit({ a: { b: 3 } }, ['a', 'b']);
|
|
});
|
|
|
|
bench('lodash/has', () => {
|
|
hasLodash({ a: { b: 3 } }, ['a', 'b']);
|
|
});
|
|
});
|