es-toolkit/benchmarks/performance/isBoolean.bench.ts

22 lines
562 B
TypeScript
Raw Normal View History

import { bench, describe } from 'vitest';
import { isBoolean as isBooleanToolkit } from 'es-toolkit';
import { isBoolean as isBooleanLodash } from 'lodash';
describe('isBoolean', () => {
bench('es-toolkit/isBoolean', () => {
isBooleanToolkit(true);
isBooleanToolkit(false);
isBooleanToolkit(undefined);
isBooleanToolkit('');
isBooleanToolkit(123);
});
bench('lodash/isBoolean', () => {
isBooleanLodash(true);
isBooleanLodash(false);
isBooleanLodash(undefined);
isBooleanLodash('');
isBooleanLodash(123);
});
});