node_modules/bson/lib/regexp.js
/**
     * @param pattern - The regular expression pattern to match
     * @param options - The regular expression options
     */
@param pattern - The regular expression pattern to match
@param options - The regular expression options
@param pattern - The regular expression pattern to match @param options - The regular expression options
function BSONRegExp(pattern, options) {
        if (!(this instanceof BSONRegExp))
            return new BSONRegExp(pattern, options);
        this.pattern = pattern;
        this.options = alphabetize(options !== null && options !== void 0 ? options : '');
        if (this.pattern.indexOf('\x00') !== -1) {
            throw new error_1.BSONError("BSON Regex patterns cannot contain null bytes, found: " + JSON.stringify(this.pattern));
        }
        if (this.options.indexOf('\x00') !== -1) {
            throw new error_1.BSONError("BSON Regex options cannot contain null bytes, found: " + JSON.stringify(this.options));
        }
        for (var i = 0; i < this.options.length; i++) {
            if (!(this.options[i] === 'i' ||
                this.options[i] === 'm' ||
                this.options[i] === 'x' ||
                this.options[i] === 'l' ||
                this.options[i] === 's' ||
                this.options[i] === 'u')) {
                throw new error_1.BSONError("The regular expression option [" + this.options[i] + "] is not supported");
            }
        }
    }
function BSONRegExp ( pattern , options ) { if ( ! ( this instanceof BSONRegExp ) ) return new BSONRegExp ( pattern , options ) ; this . pattern = pattern ; this . options = alphabetize ( options !== null && options !== void 0 ? options : '' ) ; if ( this . pattern . indexOf ( '\x00' ) !== - 1 ) { throw new error_1 . BSONError ( "BSON Regex patterns cannot contain null bytes, found: " + JSON . stringify ( this . pattern ) ) ; } if ( this . options . indexOf ( '\x00' ) !== - 1 ) { throw new error_1 . BSONError ( "BSON Regex options cannot contain null bytes, found: " + JSON . stringify ( this . options ) ) ; } for ( var i = 0 ; i < this . options . length ; i ++ ) { if ( ! ( this . options [ i ] === 'i' || this . options [ i ] === 'm' || this . options [ i ] === 'x' || this . options [ i ] === 'l' || this . options [ i ] === 's' || this . options [ i ] === 'u' ) ) { throw new error_1 . BSONError ( "The regular expression option [" + this . options [ i ] + "] is not supported" ) ; } } }
@param pattern - The regular expression pattern to match
 @param options - The regular expression options
@param pattern - The regular expression pattern to match @param options - The regular expression options
// Validate options