mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-28 20:26:33 +03:00
13c7c7f611
* feat(mapKeys): add mapKeys * feat(map*): not clone object * chore. fix names on bench * feat. pass cloned object to iteratee * Fix interface * fix. fix test codes * fix. fix type error on test * Add docs * test: Check test * bench * rewrite * mapKeys * test: Do not mutate the original function --------- Co-authored-by: raon0211 <raon0211@toss.im>
14 lines
412 B
TypeScript
14 lines
412 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { mapValues as mapValuesToolkit } from 'es-toolkit';
|
|
import { mapValues as mapValuesLodash } from 'lodash';
|
|
|
|
describe('mapValues', () => {
|
|
bench('es-toolkit/mapValues', () => {
|
|
mapValuesToolkit({ a: 1, b: 2, c: 3 }, value => `${value}a`);
|
|
});
|
|
|
|
bench('lodash/mapValues', () => {
|
|
mapValuesLodash({ a: 1, b: 2, c: 3 }, value => `${value}a`);
|
|
});
|
|
});
|