Updated the files.

This commit is contained in:
Batuhan Berk Başoğlu 2024-02-08 19:38:41 -05:00
parent 1553e6b971
commit 753967d4f5
23418 changed files with 3784666 additions and 0 deletions

View file

@ -0,0 +1,5 @@
import type { CodeKeywordDefinition } from "../../types";
import type { KeywordCxt } from "../../compile/validate";
declare const def: CodeKeywordDefinition;
export declare function dynamicAnchor(cxt: KeywordCxt, anchor: string): void;
export default def;

View file

@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.dynamicAnchor = void 0;
const codegen_1 = require("../../compile/codegen");
const names_1 = require("../../compile/names");
const compile_1 = require("../../compile");
const ref_1 = require("../core/ref");
const def = {
keyword: "$dynamicAnchor",
schemaType: "string",
code: (cxt) => dynamicAnchor(cxt, cxt.schema),
};
function dynamicAnchor(cxt, anchor) {
const { gen, it } = cxt;
it.schemaEnv.root.dynamicAnchors[anchor] = true;
const v = (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`;
const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt);
gen.if((0, codegen_1._) `!${v}`, () => gen.assign(v, validate));
}
exports.dynamicAnchor = dynamicAnchor;
function _getValidate(cxt) {
const { schemaEnv, schema, self } = cxt.it;
const { root, baseId, localRefs, meta } = schemaEnv.root;
const { schemaId } = self.opts;
const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta });
compile_1.compileSchema.call(self, sch);
return (0, ref_1.getValidate)(cxt, sch);
}
exports.default = def;
//# sourceMappingURL=dynamicAnchor.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"dynamicAnchor.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/dynamicAnchor.ts"],"names":[],"mappings":";;;AAEA,mDAA0D;AAC1D,+CAAmC;AACnC,2CAAsD;AACtD,qCAAuC;AAEvC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,gBAAgB;IACzB,UAAU,EAAE,QAAQ;IACpB,IAAI,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GAAG,CAAC,CAAA;AAC9B,CAAC;AAED,kBAAe,GAAG,CAAA"}

View file

@ -0,0 +1,5 @@
import type { CodeKeywordDefinition } from "../../types";
import type { KeywordCxt } from "../../compile/validate";
declare const def: CodeKeywordDefinition;
export declare function dynamicRef(cxt: KeywordCxt, ref: string): void;
export default def;

View file

@ -0,0 +1,51 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.dynamicRef = void 0;
const codegen_1 = require("../../compile/codegen");
const names_1 = require("../../compile/names");
const ref_1 = require("../core/ref");
const def = {
keyword: "$dynamicRef",
schemaType: "string",
code: (cxt) => dynamicRef(cxt, cxt.schema),
};
function dynamicRef(cxt, ref) {
const { gen, keyword, it } = cxt;
if (ref[0] !== "#")
throw new Error(`"${keyword}" only supports hash fragment reference`);
const anchor = ref.slice(1);
if (it.allErrors) {
_dynamicRef();
}
else {
const valid = gen.let("valid", false);
_dynamicRef(valid);
cxt.ok(valid);
}
function _dynamicRef(valid) {
// TODO the assumption here is that `recursiveRef: #` always points to the root
// of the schema object, which is not correct, because there may be $id that
// makes # point to it, and the target schema may not contain dynamic/recursiveAnchor.
// Because of that 2 tests in recursiveRef.json fail.
// This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`).
// (This problem is not tested in JSON-Schema-Test-Suite)
if (it.schemaEnv.root.dynamicAnchors[anchor]) {
const v = gen.let("_v", (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`);
gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));
}
else {
_callRef(it.validateName, valid)();
}
}
function _callRef(validate, valid) {
return valid
? () => gen.block(() => {
(0, ref_1.callRef)(cxt, validate);
gen.let(valid, true);
})
: () => (0, ref_1.callRef)(cxt, validate);
}
}
exports.dynamicRef = dynamicRef;
exports.default = def;
//# sourceMappingURL=dynamicRef.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"dynamicRef.js","sourceRoot":"","sources":["../../../lib/vocabularies/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AE,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAAA;SAChE;aAAM;YACL,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAA;SACnC;IACH,CAAC;IAED,SAAS,QAAQ,CAAC,QAAc,EAAE,KAAY;QAC5C,OAAO,KAAK;YACV,CAAC,CAAC,GAAG,EAAE,CACH,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE;gBACb,IAAA,aAAO,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;gBACtB,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YACtB,CAAC,CAAC;YACN,CAAC,CAAC,GAAG,EAAE,CAAC,IAAA,aAAO,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IAClC,CAAC;AACH,CAAC;AApCD,gCAoCC;AAED,kBAAe,GAAG,CAAA"}

View file

@ -0,0 +1,3 @@
import type { Vocabulary } from "../../types";
declare const dynamic: Vocabulary;
export default dynamic;

9
my-app/node_modules/ajv/dist/vocabularies/dynamic/index.js generated vendored Executable file
View file

@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const dynamicAnchor_1 = require("./dynamicAnchor");
const dynamicRef_1 = require("./dynamicRef");
const recursiveAnchor_1 = require("./recursiveAnchor");
const recursiveRef_1 = require("./recursiveRef");
const dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default];
exports.default = dynamic;
//# sourceMappingURL=index.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/index.ts"],"names":[],"mappings":";;AACA,mDAA2C;AAC3C,6CAAqC;AACrC,uDAA+C;AAC/C,iDAAyC;AAEzC,MAAM,OAAO,GAAe,CAAC,uBAAa,EAAE,oBAAU,EAAE,yBAAe,EAAE,sBAAY,CAAC,CAAA;AAEtF,kBAAe,OAAO,CAAA"}

View file

@ -0,0 +1,3 @@
import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;

View file

@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const dynamicAnchor_1 = require("./dynamicAnchor");
const util_1 = require("../../compile/util");
const def = {
keyword: "$recursiveAnchor",
schemaType: "boolean",
code(cxt) {
if (cxt.schema)
(0, dynamicAnchor_1.dynamicAnchor)(cxt, "");
else
(0, util_1.checkStrictMode)(cxt.it, "$recursiveAnchor: false is ignored");
},
};
exports.default = def;
//# sourceMappingURL=recursiveAnchor.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"recursiveAnchor.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/recursiveAnchor.ts"],"names":[],"mappings":";;AACA,mDAA6C;AAC7C,6CAAkD;AAElD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,kBAAkB;IAC3B,UAAU,EAAE,SAAS;IACrB,IAAI,CAAC,GAAG;QACN,IAAI,GAAG,CAAC,MAAM;YAAE,IAAA,6BAAa,EAAC,GAAG,EAAE,EAAE,CAAC,CAAA;;YACjC,IAAA,sBAAe,EAAC,GAAG,CAAC,EAAE,EAAE,oCAAoC,CAAC,CAAA;IACpE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}

View file

@ -0,0 +1,3 @@
import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;

View file

@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const dynamicRef_1 = require("./dynamicRef");
const def = {
keyword: "$recursiveRef",
schemaType: "string",
code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema),
};
exports.default = def;
//# sourceMappingURL=recursiveRef.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"recursiveRef.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/recursiveRef.ts"],"names":[],"mappings":";;AACA,6CAAuC;AAEvC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,uBAAU,EAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;CAC3C,CAAA;AAED,kBAAe,GAAG,CAAA"}