mirror of
https://github.com/toss/es-toolkit.git
synced 2024-12-01 02:33:54 +03:00
16 lines
431 B
TypeScript
16 lines
431 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { meanBy as meanByToolkit } from 'es-toolkit';
|
|
import { meanBy as meanByLodash } from 'lodash';
|
|
|
|
describe('meanBy', () => {
|
|
bench('es-toolkit/meanBy', () => {
|
|
const items = [{ a: 1 }, { a: 2 }, { a: 3 }];
|
|
meanByToolkit(items, x => x.a);
|
|
});
|
|
|
|
bench('lodash/meanBy', () => {
|
|
const items = [{ a: 1 }, { a: 2 }, { a: 3 }];
|
|
meanByLodash(items, x => x.a);
|
|
});
|
|
});
|