mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-28 20:26:33 +03:00
a02b4158eb
* Add isObjectLike * Add isArguments * remove duplicate function noop * Remove un duplicated function * add bench * update compatibility * Add docs --------- Co-authored-by: Sojin Park <raon0211@toss.im>
26 lines
755 B
TypeScript
26 lines
755 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { isObjectLike as isObjectLikeToolkit } from 'es-toolkit';
|
|
import { isObjectLike as isObjectLikeLodash } from 'lodash';
|
|
|
|
describe('isObjectLike', () => {
|
|
bench('es-toolkit/isObjectLike', () => {
|
|
isObjectLikeToolkit([1, 2, 3]);
|
|
isObjectLikeToolkit(true);
|
|
isObjectLikeToolkit(new Date());
|
|
isObjectLikeToolkit(new Error());
|
|
isObjectLikeToolkit(1);
|
|
isObjectLikeToolkit(/x/);
|
|
isObjectLikeToolkit('a');
|
|
});
|
|
|
|
bench('lodash/isObjectLike', () => {
|
|
isObjectLikeLodash([1, 2, 3]);
|
|
isObjectLikeLodash(true);
|
|
isObjectLikeLodash(new Date());
|
|
isObjectLikeLodash(new Error());
|
|
isObjectLikeLodash(1);
|
|
isObjectLikeLodash(/x/);
|
|
isObjectLikeLodash('a');
|
|
});
|
|
});
|