• Returns whether the given object is a regex

    Parameters

    • object: any

      the object to check

    Returns boolean

    whether the given object is a regex

    isRegular(/[0-9a-zA-Z]+/g);    // true
    isRegular('/[0-9a-zA-Z]+/g'); // false