function multiExportsCode(schemas, getValidateFunc) {
var _a;
const usedValues = {};
- let code = code_1._ `"use strict";`;
+ let code = (0, code_1._) `"use strict";`;
for (const name in schemas) {
const v = getValidateFunc(schemas[name]);
if (v) {
const vCode = validateCode(usedValues, v.source);
- code = code_1._ `${code}${_n}exports${code_1.getProperty(name)} = ${(_a = v.source) === null || _a === void 0 ? void 0 : _a.validateName};${_n}${vCode}`;
+ code = (0, code_1._) `${code}${_n}exports${(0, code_1.getProperty)(name)} = ${(_a = v.source) === null || _a === void 0 ? void 0 : _a.validateName};${_n}${vCode}`;
}
}
return `${code}`;
setUsedState(s.validateName, scope_1.UsedValueState.Started);
const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode);
const code = new code_1._Code(`${scopeCode}${_n}${s.validateCode}`);
- return s.evaluated ? code_1._ `${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code;
+ return s.evaluated ? (0, code_1._) `${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code;
function refValidateCode(n) {
var _a;
const vRef = (_a = n.value) === null || _a === void 0 ? void 0 : _a.ref;
if (!validateName)
throw new Error("ajv internal error");
const def = ajv.opts.code.es5 ? scope_1.varKinds.var : scope_1.varKinds.const;
- const wrapper = code_1._ `${def} ${n} = {validate: ${validateName}};`;
+ const wrapper = (0, code_1._) `${def} ${n} = {validate: ${validateName}};`;
if (usedState(validateName) === scope_1.UsedValueState.Started)
return wrapper;
const vCode = validateCode(usedValues, validate === null || validate === void 0 ? void 0 : validate.source);
- return code_1._ `${wrapper}${_n}${vCode}`;
+ return (0, code_1._) `${wrapper}${_n}${vCode}`;
}
return undefined;
}
}
}
}
+module.exports = exports = standaloneCode;
+Object.defineProperty(exports, "__esModule", { value: true });
exports.default = standaloneCode;
//# sourceMappingURL=index.js.map
\ No newline at end of file