mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-28 20:26:33 +03:00
e436125344
* feat: isRegExp at src/predicate * feat: isRegExp at compat * test: bench * docs: append isRegExp * chore: format --------- Co-authored-by: Sojin Park <raon0211@toss.im>
18 lines
461 B
TypeScript
18 lines
461 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { isRegExp as isRegExpToolkit } from 'es-toolkit';
|
|
import { isRegExp as isRegExpLodash } from 'lodash';
|
|
|
|
describe('isRegExp', () => {
|
|
bench('es-toolkit/isRegExp', () => {
|
|
isRegExpToolkit(new RegExp(''));
|
|
isRegExpToolkit(/abc/);
|
|
isRegExpToolkit('/abc/');
|
|
});
|
|
|
|
bench('lodash/isRegExp', () => {
|
|
isRegExpLodash(new RegExp(''));
|
|
isRegExpLodash(/abc/);
|
|
isRegExpLodash('/abc/');
|
|
});
|
|
});
|