mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-28 12:05:41 +03:00
27 lines
567 B
TypeScript
27 lines
567 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { merge as mergeToolkit } from 'es-toolkit';
|
|
import { merge as mergeCompatToolkit } from 'es-toolkit/compat';
|
|
import { merge as mergeLodash } from 'lodash';
|
|
|
|
const object = {
|
|
a: [{ b: 2 }, { d: 4 }],
|
|
};
|
|
|
|
const other = {
|
|
a: [{ c: 3 }, { e: 5 }],
|
|
};
|
|
|
|
describe('merge', () => {
|
|
bench('lodash/merge', () => {
|
|
mergeLodash(object, other);
|
|
});
|
|
|
|
bench('es-toolkit/merge', () => {
|
|
mergeToolkit(object, other);
|
|
});
|
|
|
|
bench('es-toolkit/compat/merge', () => {
|
|
mergeCompatToolkit(object, other);
|
|
});
|
|
});
|