Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!generated.has(newline)) {
generated.add(newline)
result.push(newline)
tries = 0
}
} while (tries > 0)
}
} while (!increment(state))
}
}
}
return result.join(os.EOL)
}
export let SubstitutionsEvaluator = new expr.ExpressionEvaluator('substitutions',
expr.FunctionUtils.apply(
args => {
let path = args[0]
let bindings = args[1]
let replications = args.length > 2 ? args[2] : undefined
let seed = args.length > 3 ? args[3] : undefined
return substitutions(path, bindings, replications, seed)
},
(val, expr, pos) => {
let error
switch (pos) {
case 0:
if (typeof val !== 'string') error = `${expr} does not have a path.`
break
case 1:
if (typeof val !== 'object') error = `${expr} does not have bindings.`
break;
e => expr.FunctionUtils.validateOrder(e,
[expr.ReturnType.Number, expr.ReturnType.String],
expr.ReturnType.String,
expr.ReturnType.Object))