Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const bignumber = (ajv: Ajv) => {
const instanceOf = ajvKeywords.get("instanceof").definition;
instanceOf.CONSTRUCTORS.BigNumber = BigNumber;
ajv.addKeyword("bignumber", {
compile(schema) {
return (data, dataPath, parentObject: any, property) => {
const minimum = typeof schema.minimum !== "undefined" ? schema.minimum : 0;
const maximum = typeof schema.maximum !== "undefined" ? schema.maximum : "9223372036854775807"; // 8 byte maximum
const bignum = BigNumber.make(data);
if (!bignum.isInteger()) {
return false;
}
let bypassGenesis: boolean = false;
if (schema.bypassGenesis) {
constructor(...args) {
super(...args);
ajvKeywords(this, ['instanceof', 'typeof', 'regexp']);
const definition = require('ajv-keywords').get('instanceof').definition;
definition.CONSTRUCTORS.File = require('./entities/file');
definition.CONSTRUCTORS.Variant = require('./entities/variant');
definition.CONSTRUCTORS.Component = require('./entities/component');
definition.CONSTRUCTORS.Entity = require('./entities/entity');
}
constructor(...args) {
super(...args);
ajvKeywords(this, ['instanceof', 'typeof', 'regexp']);
const definition = require('ajv-keywords').get('instanceof').definition;
definition.CONSTRUCTORS.File = require('./entities/file');
definition.CONSTRUCTORS.Entity = require('./entities/entity');
definition.CONSTRUCTORS.Variant = require('./entities/variant');
definition.CONSTRUCTORS.Template = require('./entities/template');
definition.CONSTRUCTORS.Scenario = require('./entities/scenario');
definition.CONSTRUCTORS.Component = require('./entities/component');
definition.CONSTRUCTORS.Collection = require('./collections/collection');
definition.CONSTRUCTORS.FileCollection = require('./collections/file-collection');
definition.CONSTRUCTORS.TemplateCollection = require('./collections/template-collection');
definition.CONSTRUCTORS.EntityCollection = require('./collections/entity-collection');
definition.CONSTRUCTORS.VariantCollection = require('./collections/variant-collection');
definition.CONSTRUCTORS.ComponentCollection = require('./collections/component-collection');
}