Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
*
* @param nameOrOptionMap
* @returns {any}
*/
function optionAPI(nameOrOptionMap) {
if (typeof nameOrOptionMap === 'string') {
return registry$1.get(nameOrOptionMap);
}
else {
return registry$1.registerMany(nameOrOptionMap);
}
}
var RandExp = require('randexp');
// set maximum default, see #193
RandExp.prototype.max = 10;
// same implementation as the original except using our random
RandExp.prototype.randInt = function (a, b) {
return a + Math.floor(optionAPI('random')() * (1 + b - a));
};
function _randexp(value) {
var re = new RandExp(value);
// apply given setting
re.max = optionAPI('defaultRandExpMax');
return re.gen();
}
function getSubAttribute(obj, dotSeparatedKey) {
var keyElements = dotSeparatedKey.split('.');
while (keyElements.length) {
var prop = keyElements.shift();
if (!obj[prop]) {
break;
* @returns {any}
*/
function optionAPI(nameOrOptionMap) {
if (typeof nameOrOptionMap === 'string') {
return registry$1.get(nameOrOptionMap);
}
else {
return registry$1.registerMany(nameOrOptionMap);
}
}
var RandExp = require('randexp');
// set maximum default, see #193
RandExp.prototype.max = 10;
// same implementation as the original except using our random
RandExp.prototype.randInt = function (a, b) {
return a + Math.floor(optionAPI('random')() * (1 + b - a));
};
function _randexp(value) {
var re = new RandExp(value);
// apply given setting
re.max = optionAPI('defaultRandExpMax');
return re.gen();
}
function getSubAttribute(obj, dotSeparatedKey) {
var keyElements = dotSeparatedKey.split('.');
while (keyElements.length) {
var prop = keyElements.shift();
if (!obj[prop]) {
break;
}
obj = obj[prop];
"use strict";
var RandExp = require("randexp");
var option = require("../api/option");
// set maximum default, see #193
RandExp.prototype.max = 10;
/**
* Container is used to wrap external libraries (faker, chance, casual, randexp) that are used among the whole codebase. These
* libraries might be configured, customized, etc. and each internal JSF module needs to access those instances instead
* of pure npm module instances. This class supports consistent access to these instances.
*/
var Container = (function () {
function Container() {
// static requires - handle both initial dependency load (deps will be available
// among other modules) as well as they will be included by browserify AST
this.registry = {
faker: null,
chance: null,
casual: null,
// randexp is required for "pattern" values
randexp: RandExp
};
'use strict';
var RandExp = require('randexp');
RandExp.prototype.randInt = (a, b) => {
return a;
}
exports.doesMatch = function (a, b) {
var a_IsRegex = a.indexOf("(") > 0;
var b_IsRegex = b.indexOf("(") > 0;
if (a_IsRegex && b_IsRegex) {
//genetate random string for both regex and pass to the other regex
var aRegex = new RegExp(a);
var bRegex = new RegExp(b);
var aRand = new RandExp(aRegex).gen();
var bRand = new RandExp(bRegex).gen();