mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-28 20:26:33 +03:00
16 lines
359 B
TypeScript
16 lines
359 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { clamp as clampToolkit } from 'es-toolkit';
|
|
import { clamp as clampLodash } from 'lodash';
|
|
|
|
describe('clamp', () => {
|
|
bench('es-toolkit/clamp', () => {
|
|
clampToolkit(10, 5, 15);
|
|
clampToolkit(10, 5);
|
|
});
|
|
|
|
bench('lodash/clamp', () => {
|
|
clampLodash(10, 5, 15);
|
|
clampLodash(10, 5);
|
|
});
|
|
});
|