Lines 2784-2824javascript
2785 ValidationError: _ValidationError,
2789 baseId: sch.baseId || rootId,
2790 schemaPath: codegen_1.nil,
2791 errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"),
2792 errorPath: (0, codegen_1._)`""`,
2798 this._compilations.add(sch);
2799 (0, validate_1.validateFunctionCode)(schemaCxt);
2800 gen.optimize(this.opts.code.optimize);
2801 const validateCode = gen.toString();
2802 sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;
2803 if (this.opts.code.process)
2804 sourceCode = this.opts.code.process(sourceCode, sch);
2805 const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);
2806 const validate = makeValidate(this, this.scope.get());
LowEval
Package source references a known benign dynamic code generation pattern.
dist/chunk-RMMKMUYK.jsView on unpkg · L2804 2807 this.scope.value(validateName, { ref: validate });
2808 validate.errors = null;
2809 validate.schema = sch.schema;
2810 validate.schemaEnv = sch;
2812 validate.$async = true;
2813 if (this.opts.code.source === true) {
2814 validate.source = { validateName, validateCode, scopeValues: gen._values };
2816 if (this.opts.unevaluated) {
2817 const { props, items } = schemaCxt;
2818 validate.evaluated = {
2819 props: props instanceof codegen_1.Name ? void 0 : props,
2820 items: items instanceof codegen_1.Name ? void 0 : items,
2821 dynamicProps: props instanceof codegen_1.Name,
2822 dynamicItems: items instanceof codegen_1.Name
2824 if (validate.source)