All files / tcb-admin-node/src/db/regexp index.js

90.91% Statements 10/11
50% Branches 1/2
100% Functions 4/4
90.91% Lines 10/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27  14x 14x     8x     8x 8x     4x           20x     14x   8x   14x  
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const symbol_1 = require("../helper/symbol");
class RegExp {
    constructor({ regexp, options }) {
        Iif (!regexp) {
            throw new TypeError("regexp must be a string");
        }
        this.$regex = regexp;
        this.$options = options;
    }
    parse(key) {
        return {
            $regex: this.$regex,
            $options: this.$options
        };
    }
    get _internalType() {
        return symbol_1.SYMBOL_REGEXP;
    }
}
exports.RegExp = RegExp;
function RegExpConstructor(param) {
    return new RegExp(param);
}
exports.RegExpConstructor = RegExpConstructor;