Lines 1814-1854javascript
1817 this.refs = {}, this.dynamicAnchors = {}, typeof e2.schema == "object" && (n2 = e2.schema), this.schema = e2.schema, this.schemaId = e2.schemaId, this.root = e2.root || this, this.baseId = (t2 = e2.baseId) !== null && t2 !== undefined ? t2 : (0, Ze.normalizeId)(n2 == null ? undefined : n2[e2.schemaId || "$id"]), this.schemaPath = e2.schemaPath, this.localRefs = e2.localRefs, this.meta = e2.meta, this.$async = n2 == null ? undefined : n2.$async, this.refs = {};
1821 const t2 = nt.call(this, e2);
1824 const n2 = (0, Ze.getFullPath)(this.opts.uriResolver, e2.root.baseId), { es5: r2, lines: o2 } = this.opts.code, { ownProperties: i2 } = this.opts, a2 =
1826 e2.$async && (s2 = a2.scopeValue("Error", { ref: Ke.default, code: He._`require("ajv/dist/runtime/validation_error").default` }));
1827 const l2 = a2.scopeName("validate");
1828 e2.validateName = l2;
1829 const c2 = { gen: a2, allErrors: this.opts.allErrors, data: Je.default.data, parentData: Je.default.parentData, parentDataProperty: Je.default.parentDataProperty, dataNames: [Je.default.data], dataPathArr: [He.nil], dataLevel: 0, dataTypes: [], definedProperties: new Set, topSchemaRef: a2.scopeValue("schema", this.opts.code.source === true ? { ref: e2.schema, code: (0, He.stringify)(e2.schema) } : { ref: e2.schema }), validateName: l2, ValidationError: s2, schema: e2.schema, schemaEnv: e2, rootId: n2, baseId: e2.baseId ||
1832 this._compilations.add(e2), (0, Qe.validateFunctionCode)(c2), a2.optimize(this.opts.code.optimize);
1833 const t3 = a2.toString();
1834 u2 = `${a2.scopeRefs(Je.default.scope)}return ${t3}`, this.opts.code.process && (u2 = this.opts.code.process(u2, e2));
1835 const n3 = new Function(`${Je.default.self}`, `${Je.default.scope}`, u2)(this, this.scope.get());
1836 if (this.scope.value(l2, { ref: n3 }), n3.errors = null, n3.schema = e2.schema, n3.schemaEnv = e2, e2.$async && (n3.$async = true), this.opts.code.source === true && (n3.source = { validateName: l2, validateCode: t3, scopeValues: a2._values }), this.opts.unevaluated) {
LowEval
Package source references a known benign dynamic code generation pattern.
dist/index.umd.min-drpc57vn.js 1837 const { props: e3, items: t4 } = c2;
1838 n3.evaluated = { props: e3 instanceof He.Name ? undefined : e3, items: t4 instanceof He.Name ? undefined : t4, dynamicProps: e3 instanceof He.Name, dynamicItems: t4 instanceof
1840 return e2.validate = n3, e2;
1842 throw delete e2.validate, delete e2.validateName, u2 && this.logger.error("Error compiling schema, function code:", u2), t3;
1844 this._compilations.delete(e2);
1848 return (0, Ze.inlineRef)(e2.schema, this.opts.inlineRefs) ? e2.schema : e2.validate ? e2 : et.call(this, e2);
1851 for (const r2 of this._compilations)
1852 if (n2 = e2, (t2 = r2).schema === n2.schema && t2.root === n2.root && t2.baseId === n2.baseId)
Long lines were clipped for display.