2024-04-25 14:56:13 +03:00
|
|
|
import { bench, describe } from 'vitest';
|
|
|
|
import { isNil as isNilToolkit } from 'es-toolkit';
|
|
|
|
import { isNil as isNilLodash } from 'lodash';
|
|
|
|
|
|
|
|
describe('isNil', () => {
|
2024-06-18 04:40:07 +03:00
|
|
|
bench('es-toolkit/isNil', () => {
|
2024-04-25 14:56:13 +03:00
|
|
|
isNilToolkit(null);
|
|
|
|
isNilToolkit(undefined);
|
|
|
|
isNilToolkit(123);
|
|
|
|
isNilToolkit([1, 2, 3]);
|
2024-06-04 11:19:26 +03:00
|
|
|
});
|
2024-04-25 14:56:13 +03:00
|
|
|
|
2024-06-18 04:40:07 +03:00
|
|
|
bench('lodash/isNil', () => {
|
2024-04-25 14:56:13 +03:00
|
|
|
isNilLodash(null);
|
|
|
|
isNilLodash(undefined);
|
|
|
|
isNilLodash(123);
|
|
|
|
isNilLodash([1, 2, 3]);
|
2024-06-04 11:19:26 +03:00
|
|
|
});
|
|
|
|
});
|