X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;ds=sidebyside;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Ftable%2Fnode_modules%2Fajv%2Fdist%2Fcompile%2Fresolve.js;h=f5b8a881305a4b648b4b5817f8aefd0ba3466d2f;hb=3be0a9efc698a9570a44456009afc6014812625a;hp=37eb9a8654c43da6c843165ba1911f3ab84e473b;hpb=d2f432cc757f42f0318fdddcab8c00b240d47088;p=dotfiles%2F.git diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/table/node_modules/ajv/dist/compile/resolve.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/table/node_modules/ajv/dist/compile/resolve.js index 37eb9a86..f5b8a881 100644 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/table/node_modules/ajv/dist/compile/resolve.js +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/table/node_modules/ajv/dist/compile/resolve.js @@ -62,7 +62,7 @@ function countKeys(schema) { if (SIMPLE_INLINED.has(key)) continue; if (typeof schema[key] == "object") { - util_1.eachItem(schema[key], (sch) => (count += countKeys(sch))); + (0, util_1.eachItem)(schema[key], (sch) => (count += countKeys(sch))); } if (count === Infinity) return Infinity; @@ -91,12 +91,13 @@ function resolveUrl(baseId, id) { } exports.resolveUrl = resolveUrl; const ANCHOR = /^[a-z_][-a-z0-9._]*$/i; -function getSchemaRefs(schema) { +function getSchemaRefs(schema, baseId) { if (typeof schema == "boolean") return {}; - const schemaId = normalizeId(schema.$id); - const baseIds = { "": schemaId }; - const pathPrefix = getFullPath(schemaId, false); + const { schemaId } = this.opts; + const schId = normalizeId(schema[schemaId] || baseId); + const baseIds = { "": schId }; + const pathPrefix = getFullPath(schId, false); const localRefs = {}; const schemaRefs = new Set(); traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => { @@ -104,8 +105,8 @@ function getSchemaRefs(schema) { return; const fullPath = pathPrefix + jsonPtr; let baseId = baseIds[parentJsonPtr]; - if (typeof sch.$id == "string") - baseId = addRef.call(this, sch.$id); + if (typeof sch[schemaId] == "string") + baseId = addRef.call(this, sch[schemaId]); addAnchor.call(this, sch.$anchor); addAnchor.call(this, sch.$dynamicAnchor); baseIds[jsonPtr] = baseId;