How to use the reregexp.parserRule function in reregexp

To help you get started, we’ve selected a few reregexp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github suchjs / such / lib / parser / regexp.js View on Github external
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var reregexp_1 = require("reregexp");
var parser = {
    config: {
        startTag: ['/'],
        endTag: [],
        rule: reregexp_1.parserRule,
    },
    parse: function () {
        var params = this.info().params;
        if (params.length !== 1) {
            return this.halt("invalid regexp rule:" + params.join(''));
        }
        return {
            rule: params[0],
        };
    },
};
exports.default = parser;
//# sourceMappingURL=regexp.js.map

reregexp

Generate a random string match a given regular expression, suitable for mocking strings.

MIT
Latest version published 1 year ago

Package Health Score

48 / 100
Full package analysis