import { bench, describe } from 'vitest';
import { isRegExp as isRegExpToolkit } from 'es-toolkit';
import { isRegExp as isRegExpToolkitCompat } from 'es-toolkit/compat';
import lodash from 'lodash';

const { isRegExp: isRegExpLodash } = lodash;

describe('isRegExp', () => {
  bench('es-toolkit/isRegExp', () => {
    isRegExpToolkit(new RegExp(''));
    isRegExpToolkit(/abc/);
    isRegExpToolkit('/abc/');
  });

  bench('es-toolkit/compat/isRegExp', () => {
    isRegExpToolkitCompat(new RegExp(''));
    isRegExpToolkitCompat(/abc/);
    isRegExpToolkitCompat('/abc/');
  });

  bench('lodash/isRegExp', () => {
    isRegExpLodash(new RegExp(''));
    isRegExpLodash(/abc/);
    isRegExpLodash('/abc/');
  });
});
