mirror of
https://github.com/toss/es-toolkit.git
synced 2025-01-07 16:59:26 +03:00
1537ea9f4d
* Add isBoolean * Add isRegExp * Add isString * Add isSymbol * Add isNumber * Add isBoolean case * Remove unused imports * Update types and integrate variable name
34 lines
996 B
TypeScript
34 lines
996 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { isSymbol as isSymbolToolkit } from 'es-toolkit/predicate';
|
|
import { isSymbol as isSymbolToolkitCompat } from 'es-toolkit/compat';
|
|
import { isSymbol as isSymbolLodash } from 'lodash';
|
|
|
|
describe('isSymbol', () => {
|
|
bench('es-toolkit/isSymbol', () => {
|
|
isSymbolToolkit(Symbol('a'));
|
|
isSymbolToolkit(Symbol.for('a'));
|
|
isSymbolToolkit(Symbol.iterator);
|
|
isSymbolToolkit('');
|
|
isSymbolToolkit({});
|
|
isSymbolToolkit(123);
|
|
});
|
|
|
|
bench('es-toolkit/compat/isSymbol', () => {
|
|
isSymbolToolkitCompat(Symbol('a'));
|
|
isSymbolToolkitCompat(Symbol.for('a'));
|
|
isSymbolToolkitCompat(Symbol.iterator);
|
|
isSymbolToolkitCompat('');
|
|
isSymbolToolkitCompat({});
|
|
isSymbolToolkitCompat(123);
|
|
});
|
|
|
|
bench('lodash/isSymbol', () => {
|
|
isSymbolLodash(Symbol('a'));
|
|
isSymbolLodash(Symbol.for('a'));
|
|
isSymbolLodash(Symbol.iterator);
|
|
isSymbolLodash('');
|
|
isSymbolLodash({});
|
|
isSymbolLodash(123);
|
|
});
|
|
});
|