@hyperjump/json-schema-core
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -251,3 +251,3 @@ define(['exports'], function (exports) { 'use strict'; | ||
resultArray.pop(); // remove previous | ||
} else if (current !== '') { | ||
} else if (current !== '' || index === pathSplit.length - 1) { | ||
resultArray.push(current); | ||
@@ -717,3 +717,3 @@ } | ||
const compile$1 = (schema) => undefined; | ||
const compile$1 = () => undefined; | ||
const interpret = () => true; | ||
@@ -720,0 +720,0 @@ |
@@ -1,2 +0,2 @@ | ||
define(["exports"],(function(e){"use strict";var t=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.apply(this,n.concat([].slice.call(arguments)))}}};const r=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(u)},n=(e,t,r,i)=>{if(0===e.length)return r;if(e.length>1){const s=e.shift();return{...t,[s]:n(e,l(t,s,i),r,a(s,i))}}if(Array.isArray(t)){const n={...t};return n[e[0]]=r,n}return"object"==typeof t&&null!==t?{...t,[e[0]]:r}:l(t,e[0],i)},i=(e,t,r,n)=>{if(0!==e.length)if(1!==e.length||h(t)){const s=e.shift();i(e,l(t,s,n),r,a(s,n))}else{t[e[0]]=r}},s=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),i=l(t,n,r);return{...t,[n]:s(e,i,a(n,r))}}if(Array.isArray(t))return t.filter((t,r)=>r!=e[0]);if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return l(t,e[0],r)}},o=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),i=l(t,n,r);o(e,i,a(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:l(t,e[0],r)},a=t((e,t)=>t+"/"+c(e)),c=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),u=e=>e.toString().replace(/~0/g,"~").replace(/~1/g,"/"),l=(e,t,r="")=>{if(h(e))throw Error(`Value at '${r}' is a scalar and can't be indexed`);if(!(t in e))throw Error(`Value at '${r}' does not have index '${t}'`);return e[t]},h=e=>null===e||"object"!=typeof e;var f={nil:"",append:a,get:(e,t)=>{const n=r(e),i=e=>n.reduce(([e,t],r)=>[l(e,r,t),a(r,t)],[e,""])[0];return void 0===t?i:i(t)},set:(e,i,s)=>{const o=r(e),a=t((e,t)=>n(o,e,t,""));return void 0===i?a:a(i,s)},assign:(e,n,s)=>{const o=r(e),a=t((e,t)=>i(o,e,t,""));return void 0===n?a:a(n,s)},unset:(e,t)=>{const n=r(e),i=e=>s(n,e,"");return void 0===t?i:i(t)},delete:(e,t)=>{const n=r(e),i=e=>o(n,e,"");return void 0===t?i:i(t)}};var d={isObject:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,splitUrl:e=>{const[t,r=""]=e.split("#",2);return[decodeURI(t),decodeURI(r)]}};const{splitUrl:p}=d,y=Object.freeze({pointer:"",json:void 0}),m=(e,t=y)=>Object.freeze({...t,pointer:p(e)[1]}),b=e=>f.get(e.pointer,e.json),v=(e,t)=>{const r=f.append(e,t.pointer);return m(`#${encodeURI(r)}`,t)},w=t((e,t)=>b(t).map((r,n)=>e(v(n,t),n))),g=t((e,t,r)=>b(r).reduce((t,n,i)=>e(t,v(i,r),i),t)),$=t((e,t)=>Object.keys(b(t)).every((r,n)=>e(v(r,t),n))),j=t((e,t)=>Object.keys(b(t)).some((r,n)=>e(v(r,t),n)));var O={cons:e=>Object.freeze({...y,json:e}),get:m,uri:e=>`#${encodeURI(e.pointer)}`,value:b,step:v,entries:e=>Object.keys(b(e)).map(t=>[t,v(t,e)]),map:w,reduce:g,every:$,some:j};const A={};var E={publish:(e,t)=>{e in A&&A[e](e,t)},subscribe:(e,t)=>{A[e]=t}},V=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;if(""===e)return I(t)?S(t):t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");if(-1===n)throw new Error("Error, protocol is not specified");t.protocol=r.substring(0,n),n+=2;const i=e.indexOf("/",n),s=e.indexOf("?"),o=e.indexOf("#");-1!==o&&(r=r.substring(0,o));if(-1!==s){const e=r.substring(s);t.query=e,r=r.substring(0,s)}if(-1!==i){const e=r.substring(0,i);t.host=e,r=r.substring(i),t.path=r}else t.host=r;return t}(e);if(""===t){const{host:e,path:t,query:n}=r;return t||n?e+t+n:S(e)}const n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(x.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:t.relativePath=!0;let r=e;const n=e.indexOf("?"),i=e.indexOf("#");if(-1!==i){const e=r.substring(i);t.hash=e,r=r.substring(0,i)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),I(n.href)?S(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:i}=n;return r.host+P(e)+t+i}if(n.relativePath){const{path:e,query:t,hash:i}=n;let s,o=r.path,a=r.host;return 0===e.length?s=o:(o=o.substring(0,o.lastIndexOf("/")),s=P(o+"/"+e)),a+=""!==s||t||i?s+t+i:"/",a}};function S(e){return e+("/"===e[e.length-1]?"":"/")}function P(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach((e,t)=>{"."!==e&&(".."===e?r.pop():""!==e&&r.push(e))}),"/"+r.join("/")}const x=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");function I(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),i=!e.includes("#",t);return r&&n&&i}var K=fetch;const{isObject:L,splitUrl:R}=d,U={},k=(e,t="",r="")=>{const n=R(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const i=R(t||e.$id||"")[0];if(!i)throw Error("Couldn't determine an identifier for the schema");const s={};U[i]={schemaVersion:n,schema:q(e,i,n,f.nil,s),anchors:s,recursiveAnchor:!!e.$recursiveAnchor}},q=(e,t,r,n,i)=>{if(L(e)){if("string"==typeof e.$id){const n=e.$id,i=z(t,n),[s,o]=R(i);if(delete e.$id,o&&(e.$anchor=o),s!==t)return k(e,z(t,s),r),{$__jref:n}}return"string"==typeof e.$anchor&&(i[e.$anchor]=n,delete e.$anchor),Object.entries(e).reduce((e,[s,o])=>(e[s]=q(o,t,r,f.append(s,n),i),e),{})}return Array.isArray(e)?e.map((e,s)=>q(e,t,r,f.append(s,n),i)):e},W=Object.freeze({id:"http://",schemaVersion:void 0,pointer:"",schema:void 0,recursiveAnchor:!1}),_=async(e,t=W,r=!1)=>{const n=r&&t.recursiveAnchor?t.recursiveAnchor:C(t),i=z(n,e),[s,o]=R(i);if(!(s in U)){const e=await K(s);k(await e.json(),s)}const a=o&&"/"!==o[0]?U[s].anchors[o]:o,c=Object.freeze({id:s,schemaVersion:U[s].schemaVersion,pointer:a,schema:U[s].schema,recursiveAnchor:t.recursiveAnchor||!!U[s].recursiveAnchor&&s}),u=D(c);return L(u)&&"$__jref"in u?_(u.$__jref,c,r):"string"==typeof u&&c.pointer.endsWith("/$ref")?_(u,c,r):"string"==typeof u&&c.pointer.endsWith("/$recursiveRef")?_(u,c,!0):c},z=(e,t)=>{const r=V(e,t);if("file"===J(r)&&"file"!==J(e))throw Error("Can't access file resource from network context");return r},J=e=>{const t=e.match(/(.+):\/\//)[1];return t?t[1]:""},C=e=>`${e.id}#${encodeURI(e.pointer)}`,D=e=>f.get(e.pointer,e.schema),B=(e,t)=>{const r=f.append(e,t.pointer);return _(`#${encodeURI(r)}`,t)},F=t((e,t)=>D(t).map(async(r,n)=>e(await B(n,t),n)));var M={add:k,get:_,uri:C,value:D,step:B,sibling:(e,t)=>{const r=t.pointer.split("/");r.pop();const n=f.append(e,r.join("/"));return _(`#${encodeURI(n)}`,t)},entries:e=>Object.keys(D(e)).map(t=>[t,B(t,e)]),map:F};const T="FLAG",G="BASIC",N="DETAILED",H="VERBOSE";let Q=N;const X=async(e,t,r)=>{const n={},i=await ce(e,n),s=(e,t=T)=>{let r=[];if(![T,G,N,H].includes(t))throw Error(`The '${t}' error format is not supported`);return E.subscribe("result",Y(t,r)),le(i,O.cons(e),n),r[0]};return void 0===t?s:s(t,r)},Y=(e,t)=>{const r=[];return(n,i)=>{for(i.errors=[];r.length>0&&Z(r[r.length-1],i);){const t=r.pop();let n=[];if(e===G&&(n=t.errors,delete t.errors),i.errors.unshift(t,...n),ee(i))break}(e===H||e!==T&&!i.valid)&&r.push(i),t[0]=i}},Z=(e,t)=>e.instanceLocation.startsWith(t.instanceLocation)&&(e.absoluteKeywordLocation.startsWith(t.absoluteKeywordLocation)||ee(e)),ee=e=>e.keyword.endsWith("#$ref")||e.keyword.endsWith("#$recursiveRef"),te={},re=e=>te[e],ne=e=>e in te,ie=(e,t)=>{te[e]=t},se={},oe={},ae={},ce=async(e,t)=>{if(!ae[e.id]){if(!ne(`${e.schemaVersion}#validate`))throw Error(`Unsupported schema version: ${e.schemaVersion}`);if(!await ue(e)){if(!(e.schemaVersion in oe)){const t=await M.get(e.schemaVersion),r=await ue(t);Object.entries(r||{}).forEach(([t,r])=>{if(t in se)Object.entries(se[t]).forEach(([t,r])=>{ie(`${e.schemaVersion}#${t}`,r)});else if(r)throw Error(`Missing required vocabulary: ${t}`)}),oe[e.schemaVersion]=await X(t)}const t=M.value(e),r=oe[e.schemaVersion](t,Q);if(!r.valid)throw r}ae[e.id]=!0}return await re(`${e.schemaVersion}#validate`).compile(e,t),M.uri(e)},ue=async e=>{try{const t=await M.get("#/$vocabulary",e);return M.value(t)}catch(e){}},le=(e,t,r)=>{const[n]=r[e];return re(n).interpret(e,t,r)};var he={validate:X,setMetaOutputFormat:e=>{Q=e},FLAG:T,BASIC:G,DETAILED:N,VERBOSE:H,addKeyword:ie,getKeyword:re,hasKeyword:ne,addVocabulary:(e,t)=>{se[e]=t},compileSchema:ce,interpretSchema:le};var fe={compile:e=>{},interpret:()=>!0},de=async e=>Object.entries(await e),pe=t(async(e,t)=>(await t).map(e)),ye=t(async(e,t,r)=>(await r).reduce(async(t,r)=>e(await t,r),t)),me=t(async(e,t,r={})=>ye(async(t,r)=>await e(r)?t.concat([r]):t,[],t,r)),be=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).some(e=>e)}),ve=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).every(e=>e)}),we=t((e,t)=>e.reduce(async(e,t)=>t(await e),t)),ge={entries:de,map:pe,filter:me,reduce:ye,some:be,every:ve,pipeline:we,all:e=>Promise.all(e),allValues:e=>we([de,ye(async(e,[t,r])=>(e[t]=await r,e),{})],e)};var $e={compile:async(e,t)=>{const r=M.uri(e);if(!(r in t)){t[r]=!1;const n=M.value(e);t[r]=[`${e.schemaVersion}#validate`,M.uri(e),"boolean"==typeof n?n:await ge.pipeline([M.entries,ge.map(([t,r])=>[`${e.schemaVersion}#${t}`,r]),ge.filter(([e])=>he.hasKeyword(e)),ge.map(async([e,r])=>{const n=await r,i=await he.getKeyword(e).compile(n,t);return[e,M.uri(n),i]}),ge.all],e)]}},interpret:(e,t,r)=>{const[n,i,s]=r[e],o="boolean"==typeof s?s:s.every(([e,n,i])=>{const s=he.getKeyword(e).interpret(i,t,r);return E.publish("result",{keyword:e,absoluteKeywordLocation:n,instanceLocation:O.uri(t),valid:s}),s});return E.publish("result",{keyword:n,absoluteKeywordLocation:i,instanceLocation:O.uri(t),valid:o}),o}},je={JsonSchema:he,Schema:M,Json:O,PubSub:E,Keywords:{metaData:fe,validate:$e}},Oe=je.JsonSchema,Ae=je.Schema,Ee=je.Json,Ve=je.PubSub,Se=je.Keywords;e.Json=Ee,e.JsonSchema=Oe,e.Keywords=Se,e.PubSub=Ve,e.Schema=Ae,e.default=je,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
define(["exports"],(function(e){"use strict";var t=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.apply(this,n.concat([].slice.call(arguments)))}}};const r=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(u)},n=(e,t,r,i)=>{if(0===e.length)return r;if(e.length>1){const s=e.shift();return{...t,[s]:n(e,l(t,s,i),r,a(s,i))}}if(Array.isArray(t)){const n={...t};return n[e[0]]=r,n}return"object"==typeof t&&null!==t?{...t,[e[0]]:r}:l(t,e[0],i)},i=(e,t,r,n)=>{if(0!==e.length)if(1!==e.length||h(t)){const s=e.shift();i(e,l(t,s,n),r,a(s,n))}else{t[e[0]]=r}},s=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),i=l(t,n,r);return{...t,[n]:s(e,i,a(n,r))}}if(Array.isArray(t))return t.filter((t,r)=>r!=e[0]);if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return l(t,e[0],r)}},o=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),i=l(t,n,r);o(e,i,a(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:l(t,e[0],r)},a=t((e,t)=>t+"/"+c(e)),c=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),u=e=>e.toString().replace(/~0/g,"~").replace(/~1/g,"/"),l=(e,t,r="")=>{if(h(e))throw Error(`Value at '${r}' is a scalar and can't be indexed`);if(!(t in e))throw Error(`Value at '${r}' does not have index '${t}'`);return e[t]},h=e=>null===e||"object"!=typeof e;var f={nil:"",append:a,get:(e,t)=>{const n=r(e),i=e=>n.reduce(([e,t],r)=>[l(e,r,t),a(r,t)],[e,""])[0];return void 0===t?i:i(t)},set:(e,i,s)=>{const o=r(e),a=t((e,t)=>n(o,e,t,""));return void 0===i?a:a(i,s)},assign:(e,n,s)=>{const o=r(e),a=t((e,t)=>i(o,e,t,""));return void 0===n?a:a(n,s)},unset:(e,t)=>{const n=r(e),i=e=>s(n,e,"");return void 0===t?i:i(t)},delete:(e,t)=>{const n=r(e),i=e=>o(n,e,"");return void 0===t?i:i(t)}};var d={isObject:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,splitUrl:e=>{const[t,r=""]=e.split("#",2);return[decodeURI(t),decodeURI(r)]}};const{splitUrl:p}=d,y=Object.freeze({pointer:"",json:void 0}),m=(e,t=y)=>Object.freeze({...t,pointer:p(e)[1]}),b=e=>f.get(e.pointer,e.json),v=(e,t)=>{const r=f.append(e,t.pointer);return m(`#${encodeURI(r)}`,t)},w=t((e,t)=>b(t).map((r,n)=>e(v(n,t),n))),g=t((e,t,r)=>b(r).reduce((t,n,i)=>e(t,v(i,r),i),t)),$=t((e,t)=>Object.keys(b(t)).every((r,n)=>e(v(r,t),n))),j=t((e,t)=>Object.keys(b(t)).some((r,n)=>e(v(r,t),n)));var O={cons:e=>Object.freeze({...y,json:e}),get:m,uri:e=>`#${encodeURI(e.pointer)}`,value:b,step:v,entries:e=>Object.keys(b(e)).map(t=>[t,v(t,e)]),map:w,reduce:g,every:$,some:j};const A={};var E={publish:(e,t)=>{e in A&&A[e](e,t)},subscribe:(e,t)=>{A[e]=t}},V=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;if(""===e)return I(t)?S(t):t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");if(-1===n)throw new Error("Error, protocol is not specified");t.protocol=r.substring(0,n),n+=2;const i=e.indexOf("/",n),s=e.indexOf("?"),o=e.indexOf("#");-1!==o&&(r=r.substring(0,o));if(-1!==s){const e=r.substring(s);t.query=e,r=r.substring(0,s)}if(-1!==i){const e=r.substring(0,i);t.host=e,r=r.substring(i),t.path=r}else t.host=r;return t}(e);if(""===t){const{host:e,path:t,query:n}=r;return t||n?e+t+n:S(e)}const n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(x.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:t.relativePath=!0;let r=e;const n=e.indexOf("?"),i=e.indexOf("#");if(-1!==i){const e=r.substring(i);t.hash=e,r=r.substring(0,i)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),I(n.href)?S(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:i}=n;return r.host+P(e)+t+i}if(n.relativePath){const{path:e,query:t,hash:i}=n;let s,o=r.path,a=r.host;return 0===e.length?s=o:(o=o.substring(0,o.lastIndexOf("/")),s=P(o+"/"+e)),a+=""!==s||t||i?s+t+i:"/",a}};function S(e){return e+("/"===e[e.length-1]?"":"/")}function P(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach((e,n)=>{"."!==e&&(".."===e?r.pop():""===e&&n!==t.length-1||r.push(e))}),"/"+r.join("/")}const x=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");function I(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),i=!e.includes("#",t);return r&&n&&i}var K=fetch;const{isObject:L,splitUrl:R}=d,U={},k=(e,t="",r="")=>{const n=R(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const i=R(t||e.$id||"")[0];if(!i)throw Error("Couldn't determine an identifier for the schema");const s={};U[i]={schemaVersion:n,schema:q(e,i,n,f.nil,s),anchors:s,recursiveAnchor:!!e.$recursiveAnchor}},q=(e,t,r,n,i)=>{if(L(e)){if("string"==typeof e.$id){const n=e.$id,i=z(t,n),[s,o]=R(i);if(delete e.$id,o&&(e.$anchor=o),s!==t)return k(e,z(t,s),r),{$__jref:n}}return"string"==typeof e.$anchor&&(i[e.$anchor]=n,delete e.$anchor),Object.entries(e).reduce((e,[s,o])=>(e[s]=q(o,t,r,f.append(s,n),i),e),{})}return Array.isArray(e)?e.map((e,s)=>q(e,t,r,f.append(s,n),i)):e},W=Object.freeze({id:"http://",schemaVersion:void 0,pointer:"",schema:void 0,recursiveAnchor:!1}),_=async(e,t=W,r=!1)=>{const n=r&&t.recursiveAnchor?t.recursiveAnchor:C(t),i=z(n,e),[s,o]=R(i);if(!(s in U)){const e=await K(s);k(await e.json(),s)}const a=o&&"/"!==o[0]?U[s].anchors[o]:o,c=Object.freeze({id:s,schemaVersion:U[s].schemaVersion,pointer:a,schema:U[s].schema,recursiveAnchor:t.recursiveAnchor||!!U[s].recursiveAnchor&&s}),u=D(c);return L(u)&&"$__jref"in u?_(u.$__jref,c,r):"string"==typeof u&&c.pointer.endsWith("/$ref")?_(u,c,r):"string"==typeof u&&c.pointer.endsWith("/$recursiveRef")?_(u,c,!0):c},z=(e,t)=>{const r=V(e,t);if("file"===J(r)&&"file"!==J(e))throw Error("Can't access file resource from network context");return r},J=e=>{const t=e.match(/(.+):\/\//)[1];return t?t[1]:""},C=e=>`${e.id}#${encodeURI(e.pointer)}`,D=e=>f.get(e.pointer,e.schema),B=(e,t)=>{const r=f.append(e,t.pointer);return _(`#${encodeURI(r)}`,t)},F=t((e,t)=>D(t).map(async(r,n)=>e(await B(n,t),n)));var M={add:k,get:_,uri:C,value:D,step:B,sibling:(e,t)=>{const r=t.pointer.split("/");r.pop();const n=f.append(e,r.join("/"));return _(`#${encodeURI(n)}`,t)},entries:e=>Object.keys(D(e)).map(t=>[t,B(t,e)]),map:F};const T="FLAG",G="BASIC",N="DETAILED",H="VERBOSE";let Q=N;const X=async(e,t,r)=>{const n={},i=await ce(e,n),s=(e,t=T)=>{let r=[];if(![T,G,N,H].includes(t))throw Error(`The '${t}' error format is not supported`);return E.subscribe("result",Y(t,r)),le(i,O.cons(e),n),r[0]};return void 0===t?s:s(t,r)},Y=(e,t)=>{const r=[];return(n,i)=>{for(i.errors=[];r.length>0&&Z(r[r.length-1],i);){const t=r.pop();let n=[];if(e===G&&(n=t.errors,delete t.errors),i.errors.unshift(t,...n),ee(i))break}(e===H||e!==T&&!i.valid)&&r.push(i),t[0]=i}},Z=(e,t)=>e.instanceLocation.startsWith(t.instanceLocation)&&(e.absoluteKeywordLocation.startsWith(t.absoluteKeywordLocation)||ee(e)),ee=e=>e.keyword.endsWith("#$ref")||e.keyword.endsWith("#$recursiveRef"),te={},re=e=>te[e],ne=e=>e in te,ie=(e,t)=>{te[e]=t},se={},oe={},ae={},ce=async(e,t)=>{if(!ae[e.id]){if(!ne(`${e.schemaVersion}#validate`))throw Error(`Unsupported schema version: ${e.schemaVersion}`);if(!await ue(e)){if(!(e.schemaVersion in oe)){const t=await M.get(e.schemaVersion),r=await ue(t);Object.entries(r||{}).forEach(([t,r])=>{if(t in se)Object.entries(se[t]).forEach(([t,r])=>{ie(`${e.schemaVersion}#${t}`,r)});else if(r)throw Error(`Missing required vocabulary: ${t}`)}),oe[e.schemaVersion]=await X(t)}const t=M.value(e),r=oe[e.schemaVersion](t,Q);if(!r.valid)throw r}ae[e.id]=!0}return await re(`${e.schemaVersion}#validate`).compile(e,t),M.uri(e)},ue=async e=>{try{const t=await M.get("#/$vocabulary",e);return M.value(t)}catch(e){}},le=(e,t,r)=>{const[n]=r[e];return re(n).interpret(e,t,r)};var he={validate:X,setMetaOutputFormat:e=>{Q=e},FLAG:T,BASIC:G,DETAILED:N,VERBOSE:H,addKeyword:ie,getKeyword:re,hasKeyword:ne,addVocabulary:(e,t)=>{se[e]=t},compileSchema:ce,interpretSchema:le};var fe={compile:()=>{},interpret:()=>!0},de=async e=>Object.entries(await e),pe=t(async(e,t)=>(await t).map(e)),ye=t(async(e,t,r)=>(await r).reduce(async(t,r)=>e(await t,r),t)),me=t(async(e,t,r={})=>ye(async(t,r)=>await e(r)?t.concat([r]):t,[],t,r)),be=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).some(e=>e)}),ve=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).every(e=>e)}),we=t((e,t)=>e.reduce(async(e,t)=>t(await e),t)),ge={entries:de,map:pe,filter:me,reduce:ye,some:be,every:ve,pipeline:we,all:e=>Promise.all(e),allValues:e=>we([de,ye(async(e,[t,r])=>(e[t]=await r,e),{})],e)};var $e={compile:async(e,t)=>{const r=M.uri(e);if(!(r in t)){t[r]=!1;const n=M.value(e);t[r]=[`${e.schemaVersion}#validate`,M.uri(e),"boolean"==typeof n?n:await ge.pipeline([M.entries,ge.map(([t,r])=>[`${e.schemaVersion}#${t}`,r]),ge.filter(([e])=>he.hasKeyword(e)),ge.map(async([e,r])=>{const n=await r,i=await he.getKeyword(e).compile(n,t);return[e,M.uri(n),i]}),ge.all],e)]}},interpret:(e,t,r)=>{const[n,i,s]=r[e],o="boolean"==typeof s?s:s.every(([e,n,i])=>{const s=he.getKeyword(e).interpret(i,t,r);return E.publish("result",{keyword:e,absoluteKeywordLocation:n,instanceLocation:O.uri(t),valid:s}),s});return E.publish("result",{keyword:n,absoluteKeywordLocation:i,instanceLocation:O.uri(t),valid:o}),o}},je={JsonSchema:he,Schema:M,Json:O,PubSub:E,Keywords:{metaData:fe,validate:$e}},Oe=je.JsonSchema,Ae=je.Schema,Ee=je.Json,Ve=je.PubSub,Se=je.Keywords;e.Json=Ee,e.JsonSchema=Oe,e.Keywords=Se,e.PubSub=Ve,e.Schema=Ae,e.default=je,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=json-schema-core-amd.min.js.map |
@@ -253,3 +253,3 @@ 'use strict'; | ||
resultArray.pop(); // remove previous | ||
} else if (current !== '') { | ||
} else if (current !== '' || index === pathSplit.length - 1) { | ||
resultArray.push(current); | ||
@@ -719,3 +719,3 @@ } | ||
const compile$1 = (schema) => undefined; | ||
const compile$1 = () => undefined; | ||
const interpret = () => true; | ||
@@ -722,0 +722,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.apply(this,n.concat([].slice.call(arguments)))}}};const t=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(c)},r=(e,t,n,s)=>{if(0===e.length)return n;if(e.length>1){const i=e.shift();return{...t,[i]:r(e,u(t,i,s),n,o(i,s))}}if(Array.isArray(t)){const r={...t};return r[e[0]]=n,r}return"object"==typeof t&&null!==t?{...t,[e[0]]:n}:u(t,e[0],s)},n=(e,t,r,s)=>{if(0!==e.length)if(1!==e.length||l(t)){const i=e.shift();n(e,u(t,i,s),r,o(i,s))}else{t[e[0]]=r}},s=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),i=u(t,n,r);return{...t,[n]:s(e,i,o(n,r))}}if(Array.isArray(t))return t.filter((t,r)=>r!=e[0]);if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return u(t,e[0],r)}},i=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),s=u(t,n,r);i(e,s,o(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:u(t,e[0],r)},o=e((e,t)=>t+"/"+a(e)),a=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),c=e=>e.toString().replace(/~0/g,"~").replace(/~1/g,"/"),u=(e,t,r="")=>{if(l(e))throw Error(`Value at '${r}' is a scalar and can't be indexed`);if(!(t in e))throw Error(`Value at '${r}' does not have index '${t}'`);return e[t]},l=e=>null===e||"object"!=typeof e;var h={nil:"",append:o,get:(e,r)=>{const n=t(e),s=e=>n.reduce(([e,t],r)=>[u(e,r,t),o(r,t)],[e,""])[0];return void 0===r?s:s(r)},set:(n,s,i)=>{const o=t(n),a=e((e,t)=>r(o,e,t,""));return void 0===s?a:a(s,i)},assign:(r,s,i)=>{const o=t(r),a=e((e,t)=>n(o,e,t,""));return void 0===s?a:a(s,i)},unset:(e,r)=>{const n=t(e),i=e=>s(n,e,"");return void 0===r?i:i(r)},delete:(e,r)=>{const n=t(e),s=e=>i(n,e,"");return void 0===r?s:s(r)}};var p={isObject:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,splitUrl:e=>{const[t,r=""]=e.split("#",2);return[decodeURI(t),decodeURI(r)]}};const{splitUrl:f}=p,d=Object.freeze({pointer:"",json:void 0}),y=(e,t=d)=>Object.freeze({...t,pointer:f(e)[1]}),m=e=>h.get(e.pointer,e.json),b=(e,t)=>{const r=h.append(e,t.pointer);return y(`#${encodeURI(r)}`,t)},v=e((e,t)=>m(t).map((r,n)=>e(b(n,t),n))),w=e((e,t,r)=>m(r).reduce((t,n,s)=>e(t,b(s,r),s),t)),g=e((e,t)=>Object.keys(m(t)).every((r,n)=>e(b(r,t),n))),$=e((e,t)=>Object.keys(m(t)).some((r,n)=>e(b(r,t),n)));var j={cons:e=>Object.freeze({...d,json:e}),get:y,uri:e=>`#${encodeURI(e.pointer)}`,value:m,step:b,entries:e=>Object.keys(m(e)).map(t=>[t,b(t,e)]),map:v,reduce:w,every:g,some:$};const O={};var A={publish:(e,t)=>{e in O&&O[e](e,t)},subscribe:(e,t)=>{O[e]=t}},E=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;if(""===e)return P(t)?V(t):t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");if(-1===n)throw new Error("Error, protocol is not specified");t.protocol=r.substring(0,n),n+=2;const s=e.indexOf("/",n),i=e.indexOf("?"),o=e.indexOf("#");-1!==o&&(r=r.substring(0,o));if(-1!==i){const e=r.substring(i);t.query=e,r=r.substring(0,i)}if(-1!==s){const e=r.substring(0,s);t.host=e,r=r.substring(s),t.path=r}else t.host=r;return t}(e);if(""===t){const{host:e,path:t,query:n}=r;return t||n?e+t+n:V(e)}const n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(S.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:t.relativePath=!0;let r=e;const n=e.indexOf("?"),s=e.indexOf("#");if(-1!==s){const e=r.substring(s);t.hash=e,r=r.substring(0,s)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),P(n.href)?V(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:s}=n;return r.host+x(e)+t+s}if(n.relativePath){const{path:e,query:t,hash:s}=n;let i,o=r.path,a=r.host;return 0===e.length?i=o:(o=o.substring(0,o.lastIndexOf("/")),i=x(o+"/"+e)),a+=""!==i||t||s?i+t+s:"/",a}};function V(e){return e+("/"===e[e.length-1]?"":"/")}function x(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach((e,t)=>{"."!==e&&(".."===e?r.pop():""!==e&&r.push(e))}),"/"+r.join("/")}const S=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");function P(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),s=!e.includes("#",t);return r&&n&&s}var I=fetch;const{isObject:K,splitUrl:L}=p,R={},U=(e,t="",r="")=>{const n=L(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const s=L(t||e.$id||"")[0];if(!s)throw Error("Couldn't determine an identifier for the schema");const i={};R[s]={schemaVersion:n,schema:k(e,s,n,h.nil,i),anchors:i,recursiveAnchor:!!e.$recursiveAnchor}},k=(e,t,r,n,s)=>{if(K(e)){if("string"==typeof e.$id){const n=e.$id,s=_(t,n),[i,o]=L(s);if(delete e.$id,o&&(e.$anchor=o),i!==t)return U(e,_(t,i),r),{$__jref:n}}return"string"==typeof e.$anchor&&(s[e.$anchor]=n,delete e.$anchor),Object.entries(e).reduce((e,[i,o])=>(e[i]=k(o,t,r,h.append(i,n),s),e),{})}return Array.isArray(e)?e.map((e,i)=>k(e,t,r,h.append(i,n),s)):e},q=Object.freeze({id:"http://",schemaVersion:void 0,pointer:"",schema:void 0,recursiveAnchor:!1}),W=async(e,t=q,r=!1)=>{const n=r&&t.recursiveAnchor?t.recursiveAnchor:J(t),s=_(n,e),[i,o]=L(s);if(!(i in R)){const e=await I(i);U(await e.json(),i)}const a=o&&"/"!==o[0]?R[i].anchors[o]:o,c=Object.freeze({id:i,schemaVersion:R[i].schemaVersion,pointer:a,schema:R[i].schema,recursiveAnchor:t.recursiveAnchor||!!R[i].recursiveAnchor&&i}),u=C(c);return K(u)&&"$__jref"in u?W(u.$__jref,c,r):"string"==typeof u&&c.pointer.endsWith("/$ref")?W(u,c,r):"string"==typeof u&&c.pointer.endsWith("/$recursiveRef")?W(u,c,!0):c},_=(e,t)=>{const r=E(e,t);if("file"===z(r)&&"file"!==z(e))throw Error("Can't access file resource from network context");return r},z=e=>{const t=e.match(/(.+):\/\//)[1];return t?t[1]:""},J=e=>`${e.id}#${encodeURI(e.pointer)}`,C=e=>h.get(e.pointer,e.schema),D=(e,t)=>{const r=h.append(e,t.pointer);return W(`#${encodeURI(r)}`,t)},B=e((e,t)=>C(t).map(async(r,n)=>e(await D(n,t),n)));var F={add:U,get:W,uri:J,value:C,step:D,sibling:(e,t)=>{const r=t.pointer.split("/");r.pop();const n=h.append(e,r.join("/"));return W(`#${encodeURI(n)}`,t)},entries:e=>Object.keys(C(e)).map(t=>[t,D(t,e)]),map:B};const M="FLAG",T="BASIC",G="DETAILED",N="VERBOSE";let H=G;const Q=async(e,t,r)=>{const n={},s=await ae(e,n),i=(e,t=M)=>{let r=[];if(![M,T,G,N].includes(t))throw Error(`The '${t}' error format is not supported`);return A.subscribe("result",X(t,r)),ue(s,j.cons(e),n),r[0]};return void 0===t?i:i(t,r)},X=(e,t)=>{const r=[];return(n,s)=>{for(s.errors=[];r.length>0&&Y(r[r.length-1],s);){const t=r.pop();let n=[];if(e===T&&(n=t.errors,delete t.errors),s.errors.unshift(t,...n),Z(s))break}(e===N||e!==M&&!s.valid)&&r.push(s),t[0]=s}},Y=(e,t)=>e.instanceLocation.startsWith(t.instanceLocation)&&(e.absoluteKeywordLocation.startsWith(t.absoluteKeywordLocation)||Z(e)),Z=e=>e.keyword.endsWith("#$ref")||e.keyword.endsWith("#$recursiveRef"),ee={},te=e=>ee[e],re=e=>e in ee,ne=(e,t)=>{ee[e]=t},se={},ie={},oe={},ae=async(e,t)=>{if(!oe[e.id]){if(!re(`${e.schemaVersion}#validate`))throw Error(`Unsupported schema version: ${e.schemaVersion}`);if(!await ce(e)){if(!(e.schemaVersion in ie)){const t=await F.get(e.schemaVersion),r=await ce(t);Object.entries(r||{}).forEach(([t,r])=>{if(t in se)Object.entries(se[t]).forEach(([t,r])=>{ne(`${e.schemaVersion}#${t}`,r)});else if(r)throw Error(`Missing required vocabulary: ${t}`)}),ie[e.schemaVersion]=await Q(t)}const t=F.value(e),r=ie[e.schemaVersion](t,H);if(!r.valid)throw r}oe[e.id]=!0}return await te(`${e.schemaVersion}#validate`).compile(e,t),F.uri(e)},ce=async e=>{try{const t=await F.get("#/$vocabulary",e);return F.value(t)}catch(e){}},ue=(e,t,r)=>{const[n]=r[e];return te(n).interpret(e,t,r)};var le={validate:Q,setMetaOutputFormat:e=>{H=e},FLAG:M,BASIC:T,DETAILED:G,VERBOSE:N,addKeyword:ne,getKeyword:te,hasKeyword:re,addVocabulary:(e,t)=>{se[e]=t},compileSchema:ae,interpretSchema:ue};var he={compile:e=>{},interpret:()=>!0},pe=async e=>Object.entries(await e),fe=e(async(e,t)=>(await t).map(e)),de=e(async(e,t,r)=>(await r).reduce(async(t,r)=>e(await t,r),t)),ye=e(async(e,t,r={})=>de(async(t,r)=>await e(r)?t.concat([r]):t,[],t,r)),me=e(async(e,t)=>{const r=await fe(e,t);return(await Promise.all(r)).some(e=>e)}),be=e(async(e,t)=>{const r=await fe(e,t);return(await Promise.all(r)).every(e=>e)}),ve=e((e,t)=>e.reduce(async(e,t)=>t(await e),t)),we={entries:pe,map:fe,filter:ye,reduce:de,some:me,every:be,pipeline:ve,all:e=>Promise.all(e),allValues:e=>ve([pe,de(async(e,[t,r])=>(e[t]=await r,e),{})],e)};var ge={compile:async(e,t)=>{const r=F.uri(e);if(!(r in t)){t[r]=!1;const n=F.value(e);t[r]=[`${e.schemaVersion}#validate`,F.uri(e),"boolean"==typeof n?n:await we.pipeline([F.entries,we.map(([t,r])=>[`${e.schemaVersion}#${t}`,r]),we.filter(([e])=>le.hasKeyword(e)),we.map(async([e,r])=>{const n=await r,s=await le.getKeyword(e).compile(n,t);return[e,F.uri(n),s]}),we.all],e)]}},interpret:(e,t,r)=>{const[n,s,i]=r[e],o="boolean"==typeof i?i:i.every(([e,n,s])=>{const i=le.getKeyword(e).interpret(s,t,r);return A.publish("result",{keyword:e,absoluteKeywordLocation:n,instanceLocation:j.uri(t),valid:i}),i});return A.publish("result",{keyword:n,absoluteKeywordLocation:s,instanceLocation:j.uri(t),valid:o}),o}},$e={JsonSchema:le,Schema:F,Json:j,PubSub:A,Keywords:{metaData:he,validate:ge}},je=$e.JsonSchema,Oe=$e.Schema,Ae=$e.Json,Ee=$e.PubSub,Ve=$e.Keywords;exports.Json=Ae,exports.JsonSchema=je,exports.Keywords=Ve,exports.PubSub=Ee,exports.Schema=Oe,exports.default=$e; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.apply(this,n.concat([].slice.call(arguments)))}}};const t=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(c)},r=(e,t,n,s)=>{if(0===e.length)return n;if(e.length>1){const i=e.shift();return{...t,[i]:r(e,u(t,i,s),n,o(i,s))}}if(Array.isArray(t)){const r={...t};return r[e[0]]=n,r}return"object"==typeof t&&null!==t?{...t,[e[0]]:n}:u(t,e[0],s)},n=(e,t,r,s)=>{if(0!==e.length)if(1!==e.length||l(t)){const i=e.shift();n(e,u(t,i,s),r,o(i,s))}else{t[e[0]]=r}},s=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),i=u(t,n,r);return{...t,[n]:s(e,i,o(n,r))}}if(Array.isArray(t))return t.filter((t,r)=>r!=e[0]);if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return u(t,e[0],r)}},i=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),s=u(t,n,r);i(e,s,o(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:u(t,e[0],r)},o=e((e,t)=>t+"/"+a(e)),a=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),c=e=>e.toString().replace(/~0/g,"~").replace(/~1/g,"/"),u=(e,t,r="")=>{if(l(e))throw Error(`Value at '${r}' is a scalar and can't be indexed`);if(!(t in e))throw Error(`Value at '${r}' does not have index '${t}'`);return e[t]},l=e=>null===e||"object"!=typeof e;var h={nil:"",append:o,get:(e,r)=>{const n=t(e),s=e=>n.reduce(([e,t],r)=>[u(e,r,t),o(r,t)],[e,""])[0];return void 0===r?s:s(r)},set:(n,s,i)=>{const o=t(n),a=e((e,t)=>r(o,e,t,""));return void 0===s?a:a(s,i)},assign:(r,s,i)=>{const o=t(r),a=e((e,t)=>n(o,e,t,""));return void 0===s?a:a(s,i)},unset:(e,r)=>{const n=t(e),i=e=>s(n,e,"");return void 0===r?i:i(r)},delete:(e,r)=>{const n=t(e),s=e=>i(n,e,"");return void 0===r?s:s(r)}};var p={isObject:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,splitUrl:e=>{const[t,r=""]=e.split("#",2);return[decodeURI(t),decodeURI(r)]}};const{splitUrl:f}=p,d=Object.freeze({pointer:"",json:void 0}),y=(e,t=d)=>Object.freeze({...t,pointer:f(e)[1]}),m=e=>h.get(e.pointer,e.json),b=(e,t)=>{const r=h.append(e,t.pointer);return y(`#${encodeURI(r)}`,t)},v=e((e,t)=>m(t).map((r,n)=>e(b(n,t),n))),w=e((e,t,r)=>m(r).reduce((t,n,s)=>e(t,b(s,r),s),t)),g=e((e,t)=>Object.keys(m(t)).every((r,n)=>e(b(r,t),n))),$=e((e,t)=>Object.keys(m(t)).some((r,n)=>e(b(r,t),n)));var j={cons:e=>Object.freeze({...d,json:e}),get:y,uri:e=>`#${encodeURI(e.pointer)}`,value:m,step:b,entries:e=>Object.keys(m(e)).map(t=>[t,b(t,e)]),map:v,reduce:w,every:g,some:$};const O={};var A={publish:(e,t)=>{e in O&&O[e](e,t)},subscribe:(e,t)=>{O[e]=t}},E=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;if(""===e)return P(t)?V(t):t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");if(-1===n)throw new Error("Error, protocol is not specified");t.protocol=r.substring(0,n),n+=2;const s=e.indexOf("/",n),i=e.indexOf("?"),o=e.indexOf("#");-1!==o&&(r=r.substring(0,o));if(-1!==i){const e=r.substring(i);t.query=e,r=r.substring(0,i)}if(-1!==s){const e=r.substring(0,s);t.host=e,r=r.substring(s),t.path=r}else t.host=r;return t}(e);if(""===t){const{host:e,path:t,query:n}=r;return t||n?e+t+n:V(e)}const n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(S.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:t.relativePath=!0;let r=e;const n=e.indexOf("?"),s=e.indexOf("#");if(-1!==s){const e=r.substring(s);t.hash=e,r=r.substring(0,s)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),P(n.href)?V(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:s}=n;return r.host+x(e)+t+s}if(n.relativePath){const{path:e,query:t,hash:s}=n;let i,o=r.path,a=r.host;return 0===e.length?i=o:(o=o.substring(0,o.lastIndexOf("/")),i=x(o+"/"+e)),a+=""!==i||t||s?i+t+s:"/",a}};function V(e){return e+("/"===e[e.length-1]?"":"/")}function x(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach((e,n)=>{"."!==e&&(".."===e?r.pop():""===e&&n!==t.length-1||r.push(e))}),"/"+r.join("/")}const S=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");function P(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),s=!e.includes("#",t);return r&&n&&s}var I=fetch;const{isObject:K,splitUrl:L}=p,R={},U=(e,t="",r="")=>{const n=L(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const s=L(t||e.$id||"")[0];if(!s)throw Error("Couldn't determine an identifier for the schema");const i={};R[s]={schemaVersion:n,schema:k(e,s,n,h.nil,i),anchors:i,recursiveAnchor:!!e.$recursiveAnchor}},k=(e,t,r,n,s)=>{if(K(e)){if("string"==typeof e.$id){const n=e.$id,s=_(t,n),[i,o]=L(s);if(delete e.$id,o&&(e.$anchor=o),i!==t)return U(e,_(t,i),r),{$__jref:n}}return"string"==typeof e.$anchor&&(s[e.$anchor]=n,delete e.$anchor),Object.entries(e).reduce((e,[i,o])=>(e[i]=k(o,t,r,h.append(i,n),s),e),{})}return Array.isArray(e)?e.map((e,i)=>k(e,t,r,h.append(i,n),s)):e},q=Object.freeze({id:"http://",schemaVersion:void 0,pointer:"",schema:void 0,recursiveAnchor:!1}),W=async(e,t=q,r=!1)=>{const n=r&&t.recursiveAnchor?t.recursiveAnchor:J(t),s=_(n,e),[i,o]=L(s);if(!(i in R)){const e=await I(i);U(await e.json(),i)}const a=o&&"/"!==o[0]?R[i].anchors[o]:o,c=Object.freeze({id:i,schemaVersion:R[i].schemaVersion,pointer:a,schema:R[i].schema,recursiveAnchor:t.recursiveAnchor||!!R[i].recursiveAnchor&&i}),u=C(c);return K(u)&&"$__jref"in u?W(u.$__jref,c,r):"string"==typeof u&&c.pointer.endsWith("/$ref")?W(u,c,r):"string"==typeof u&&c.pointer.endsWith("/$recursiveRef")?W(u,c,!0):c},_=(e,t)=>{const r=E(e,t);if("file"===z(r)&&"file"!==z(e))throw Error("Can't access file resource from network context");return r},z=e=>{const t=e.match(/(.+):\/\//)[1];return t?t[1]:""},J=e=>`${e.id}#${encodeURI(e.pointer)}`,C=e=>h.get(e.pointer,e.schema),D=(e,t)=>{const r=h.append(e,t.pointer);return W(`#${encodeURI(r)}`,t)},B=e((e,t)=>C(t).map(async(r,n)=>e(await D(n,t),n)));var F={add:U,get:W,uri:J,value:C,step:D,sibling:(e,t)=>{const r=t.pointer.split("/");r.pop();const n=h.append(e,r.join("/"));return W(`#${encodeURI(n)}`,t)},entries:e=>Object.keys(C(e)).map(t=>[t,D(t,e)]),map:B};const M="FLAG",T="BASIC",G="DETAILED",N="VERBOSE";let H=G;const Q=async(e,t,r)=>{const n={},s=await ae(e,n),i=(e,t=M)=>{let r=[];if(![M,T,G,N].includes(t))throw Error(`The '${t}' error format is not supported`);return A.subscribe("result",X(t,r)),ue(s,j.cons(e),n),r[0]};return void 0===t?i:i(t,r)},X=(e,t)=>{const r=[];return(n,s)=>{for(s.errors=[];r.length>0&&Y(r[r.length-1],s);){const t=r.pop();let n=[];if(e===T&&(n=t.errors,delete t.errors),s.errors.unshift(t,...n),Z(s))break}(e===N||e!==M&&!s.valid)&&r.push(s),t[0]=s}},Y=(e,t)=>e.instanceLocation.startsWith(t.instanceLocation)&&(e.absoluteKeywordLocation.startsWith(t.absoluteKeywordLocation)||Z(e)),Z=e=>e.keyword.endsWith("#$ref")||e.keyword.endsWith("#$recursiveRef"),ee={},te=e=>ee[e],re=e=>e in ee,ne=(e,t)=>{ee[e]=t},se={},ie={},oe={},ae=async(e,t)=>{if(!oe[e.id]){if(!re(`${e.schemaVersion}#validate`))throw Error(`Unsupported schema version: ${e.schemaVersion}`);if(!await ce(e)){if(!(e.schemaVersion in ie)){const t=await F.get(e.schemaVersion),r=await ce(t);Object.entries(r||{}).forEach(([t,r])=>{if(t in se)Object.entries(se[t]).forEach(([t,r])=>{ne(`${e.schemaVersion}#${t}`,r)});else if(r)throw Error(`Missing required vocabulary: ${t}`)}),ie[e.schemaVersion]=await Q(t)}const t=F.value(e),r=ie[e.schemaVersion](t,H);if(!r.valid)throw r}oe[e.id]=!0}return await te(`${e.schemaVersion}#validate`).compile(e,t),F.uri(e)},ce=async e=>{try{const t=await F.get("#/$vocabulary",e);return F.value(t)}catch(e){}},ue=(e,t,r)=>{const[n]=r[e];return te(n).interpret(e,t,r)};var le={validate:Q,setMetaOutputFormat:e=>{H=e},FLAG:M,BASIC:T,DETAILED:G,VERBOSE:N,addKeyword:ne,getKeyword:te,hasKeyword:re,addVocabulary:(e,t)=>{se[e]=t},compileSchema:ae,interpretSchema:ue};var he={compile:()=>{},interpret:()=>!0},pe=async e=>Object.entries(await e),fe=e(async(e,t)=>(await t).map(e)),de=e(async(e,t,r)=>(await r).reduce(async(t,r)=>e(await t,r),t)),ye=e(async(e,t,r={})=>de(async(t,r)=>await e(r)?t.concat([r]):t,[],t,r)),me=e(async(e,t)=>{const r=await fe(e,t);return(await Promise.all(r)).some(e=>e)}),be=e(async(e,t)=>{const r=await fe(e,t);return(await Promise.all(r)).every(e=>e)}),ve=e((e,t)=>e.reduce(async(e,t)=>t(await e),t)),we={entries:pe,map:fe,filter:ye,reduce:de,some:me,every:be,pipeline:ve,all:e=>Promise.all(e),allValues:e=>ve([pe,de(async(e,[t,r])=>(e[t]=await r,e),{})],e)};var ge={compile:async(e,t)=>{const r=F.uri(e);if(!(r in t)){t[r]=!1;const n=F.value(e);t[r]=[`${e.schemaVersion}#validate`,F.uri(e),"boolean"==typeof n?n:await we.pipeline([F.entries,we.map(([t,r])=>[`${e.schemaVersion}#${t}`,r]),we.filter(([e])=>le.hasKeyword(e)),we.map(async([e,r])=>{const n=await r,s=await le.getKeyword(e).compile(n,t);return[e,F.uri(n),s]}),we.all],e)]}},interpret:(e,t,r)=>{const[n,s,i]=r[e],o="boolean"==typeof i?i:i.every(([e,n,s])=>{const i=le.getKeyword(e).interpret(s,t,r);return A.publish("result",{keyword:e,absoluteKeywordLocation:n,instanceLocation:j.uri(t),valid:i}),i});return A.publish("result",{keyword:n,absoluteKeywordLocation:s,instanceLocation:j.uri(t),valid:o}),o}},$e={JsonSchema:le,Schema:F,Json:j,PubSub:A,Keywords:{metaData:he,validate:ge}},je=$e.JsonSchema,Oe=$e.Schema,Ae=$e.Json,Ee=$e.PubSub,Ve=$e.Keywords;exports.Json=Ae,exports.JsonSchema=je,exports.Keywords=Ve,exports.PubSub=Ee,exports.Schema=Oe,exports.default=$e; | ||
//# sourceMappingURL=json-schema-core-cjs.min.js.map |
@@ -249,3 +249,3 @@ var justCurryIt = curry; | ||
resultArray.pop(); // remove previous | ||
} else if (current !== '') { | ||
} else if (current !== '' || index === pathSplit.length - 1) { | ||
resultArray.push(current); | ||
@@ -715,3 +715,3 @@ } | ||
const compile$1 = (schema) => undefined; | ||
const compile$1 = () => undefined; | ||
const interpret = () => true; | ||
@@ -718,0 +718,0 @@ |
@@ -1,2 +0,2 @@ | ||
var e=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.apply(this,n.concat([].slice.call(arguments)))}}};const t=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(c)},r=(e,t,n,s)=>{if(0===e.length)return n;if(e.length>1){const i=e.shift();return{...t,[i]:r(e,u(t,i,s),n,o(i,s))}}if(Array.isArray(t)){const r={...t};return r[e[0]]=n,r}return"object"==typeof t&&null!==t?{...t,[e[0]]:n}:u(t,e[0],s)},n=(e,t,r,s)=>{if(0!==e.length)if(1!==e.length||l(t)){const i=e.shift();n(e,u(t,i,s),r,o(i,s))}else{t[e[0]]=r}},s=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),i=u(t,n,r);return{...t,[n]:s(e,i,o(n,r))}}if(Array.isArray(t))return t.filter((t,r)=>r!=e[0]);if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return u(t,e[0],r)}},i=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),s=u(t,n,r);i(e,s,o(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:u(t,e[0],r)},o=e((e,t)=>t+"/"+a(e)),a=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),c=e=>e.toString().replace(/~0/g,"~").replace(/~1/g,"/"),u=(e,t,r="")=>{if(l(e))throw Error(`Value at '${r}' is a scalar and can't be indexed`);if(!(t in e))throw Error(`Value at '${r}' does not have index '${t}'`);return e[t]},l=e=>null===e||"object"!=typeof e;var h={nil:"",append:o,get:(e,r)=>{const n=t(e),s=e=>n.reduce(([e,t],r)=>[u(e,r,t),o(r,t)],[e,""])[0];return void 0===r?s:s(r)},set:(n,s,i)=>{const o=t(n),a=e((e,t)=>r(o,e,t,""));return void 0===s?a:a(s,i)},assign:(r,s,i)=>{const o=t(r),a=e((e,t)=>n(o,e,t,""));return void 0===s?a:a(s,i)},unset:(e,r)=>{const n=t(e),i=e=>s(n,e,"");return void 0===r?i:i(r)},delete:(e,r)=>{const n=t(e),s=e=>i(n,e,"");return void 0===r?s:s(r)}};var f={isObject:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,splitUrl:e=>{const[t,r=""]=e.split("#",2);return[decodeURI(t),decodeURI(r)]}};const{splitUrl:p}=f,d=Object.freeze({pointer:"",json:void 0}),y=(e,t=d)=>Object.freeze({...t,pointer:p(e)[1]}),m=e=>h.get(e.pointer,e.json),b=(e,t)=>{const r=h.append(e,t.pointer);return y(`#${encodeURI(r)}`,t)},v=e((e,t)=>m(t).map((r,n)=>e(b(n,t),n))),w=e((e,t,r)=>m(r).reduce((t,n,s)=>e(t,b(s,r),s),t)),g=e((e,t)=>Object.keys(m(t)).every((r,n)=>e(b(r,t),n))),$=e((e,t)=>Object.keys(m(t)).some((r,n)=>e(b(r,t),n)));var j={cons:e=>Object.freeze({...d,json:e}),get:y,uri:e=>`#${encodeURI(e.pointer)}`,value:m,step:b,entries:e=>Object.keys(m(e)).map(t=>[t,b(t,e)]),map:v,reduce:w,every:g,some:$};const O={};var A={publish:(e,t)=>{e in O&&O[e](e,t)},subscribe:(e,t)=>{O[e]=t}},E=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;if(""===e)return x(t)?V(t):t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");if(-1===n)throw new Error("Error, protocol is not specified");t.protocol=r.substring(0,n),n+=2;const s=e.indexOf("/",n),i=e.indexOf("?"),o=e.indexOf("#");-1!==o&&(r=r.substring(0,o));if(-1!==i){const e=r.substring(i);t.query=e,r=r.substring(0,i)}if(-1!==s){const e=r.substring(0,s);t.host=e,r=r.substring(s),t.path=r}else t.host=r;return t}(e);if(""===t){const{host:e,path:t,query:n}=r;return t||n?e+t+n:V(e)}const n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(P.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:t.relativePath=!0;let r=e;const n=e.indexOf("?"),s=e.indexOf("#");if(-1!==s){const e=r.substring(s);t.hash=e,r=r.substring(0,s)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),x(n.href)?V(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:s}=n;return r.host+S(e)+t+s}if(n.relativePath){const{path:e,query:t,hash:s}=n;let i,o=r.path,a=r.host;return 0===e.length?i=o:(o=o.substring(0,o.lastIndexOf("/")),i=S(o+"/"+e)),a+=""!==i||t||s?i+t+s:"/",a}};function V(e){return e+("/"===e[e.length-1]?"":"/")}function S(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach((e,t)=>{"."!==e&&(".."===e?r.pop():""!==e&&r.push(e))}),"/"+r.join("/")}const P=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");function x(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),s=!e.includes("#",t);return r&&n&&s}var I=fetch;const{isObject:K,splitUrl:L}=f,R={},U=(e,t="",r="")=>{const n=L(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const s=L(t||e.$id||"")[0];if(!s)throw Error("Couldn't determine an identifier for the schema");const i={};R[s]={schemaVersion:n,schema:k(e,s,n,h.nil,i),anchors:i,recursiveAnchor:!!e.$recursiveAnchor}},k=(e,t,r,n,s)=>{if(K(e)){if("string"==typeof e.$id){const n=e.$id,s=z(t,n),[i,o]=L(s);if(delete e.$id,o&&(e.$anchor=o),i!==t)return U(e,z(t,i),r),{$__jref:n}}return"string"==typeof e.$anchor&&(s[e.$anchor]=n,delete e.$anchor),Object.entries(e).reduce((e,[i,o])=>(e[i]=k(o,t,r,h.append(i,n),s),e),{})}return Array.isArray(e)?e.map((e,i)=>k(e,t,r,h.append(i,n),s)):e},q=Object.freeze({id:"http://",schemaVersion:void 0,pointer:"",schema:void 0,recursiveAnchor:!1}),W=async(e,t=q,r=!1)=>{const n=r&&t.recursiveAnchor?t.recursiveAnchor:_(t),s=z(n,e),[i,o]=L(s);if(!(i in R)){const e=await I(i);U(await e.json(),i)}const a=o&&"/"!==o[0]?R[i].anchors[o]:o,c=Object.freeze({id:i,schemaVersion:R[i].schemaVersion,pointer:a,schema:R[i].schema,recursiveAnchor:t.recursiveAnchor||!!R[i].recursiveAnchor&&i}),u=C(c);return K(u)&&"$__jref"in u?W(u.$__jref,c,r):"string"==typeof u&&c.pointer.endsWith("/$ref")?W(u,c,r):"string"==typeof u&&c.pointer.endsWith("/$recursiveRef")?W(u,c,!0):c},z=(e,t)=>{const r=E(e,t);if("file"===J(r)&&"file"!==J(e))throw Error("Can't access file resource from network context");return r},J=e=>{const t=e.match(/(.+):\/\//)[1];return t?t[1]:""},_=e=>`${e.id}#${encodeURI(e.pointer)}`,C=e=>h.get(e.pointer,e.schema),D=(e,t)=>{const r=h.append(e,t.pointer);return W(`#${encodeURI(r)}`,t)},B=e((e,t)=>C(t).map(async(r,n)=>e(await D(n,t),n)));var F={add:U,get:W,uri:_,value:C,step:D,sibling:(e,t)=>{const r=t.pointer.split("/");r.pop();const n=h.append(e,r.join("/"));return W(`#${encodeURI(n)}`,t)},entries:e=>Object.keys(C(e)).map(t=>[t,D(t,e)]),map:B};const T="FLAG",G="BASIC",M="DETAILED",N="VERBOSE";let H=M;const Q=async(e,t,r)=>{const n={},s=await ae(e,n),i=(e,t=T)=>{let r=[];if(![T,G,M,N].includes(t))throw Error(`The '${t}' error format is not supported`);return A.subscribe("result",X(t,r)),ue(s,j.cons(e),n),r[0]};return void 0===t?i:i(t,r)},X=(e,t)=>{const r=[];return(n,s)=>{for(s.errors=[];r.length>0&&Y(r[r.length-1],s);){const t=r.pop();let n=[];if(e===G&&(n=t.errors,delete t.errors),s.errors.unshift(t,...n),Z(s))break}(e===N||e!==T&&!s.valid)&&r.push(s),t[0]=s}},Y=(e,t)=>e.instanceLocation.startsWith(t.instanceLocation)&&(e.absoluteKeywordLocation.startsWith(t.absoluteKeywordLocation)||Z(e)),Z=e=>e.keyword.endsWith("#$ref")||e.keyword.endsWith("#$recursiveRef"),ee={},te=e=>ee[e],re=e=>e in ee,ne=(e,t)=>{ee[e]=t},se={},ie={},oe={},ae=async(e,t)=>{if(!oe[e.id]){if(!re(`${e.schemaVersion}#validate`))throw Error(`Unsupported schema version: ${e.schemaVersion}`);if(!await ce(e)){if(!(e.schemaVersion in ie)){const t=await F.get(e.schemaVersion),r=await ce(t);Object.entries(r||{}).forEach(([t,r])=>{if(t in se)Object.entries(se[t]).forEach(([t,r])=>{ne(`${e.schemaVersion}#${t}`,r)});else if(r)throw Error(`Missing required vocabulary: ${t}`)}),ie[e.schemaVersion]=await Q(t)}const t=F.value(e),r=ie[e.schemaVersion](t,H);if(!r.valid)throw r}oe[e.id]=!0}return await te(`${e.schemaVersion}#validate`).compile(e,t),F.uri(e)},ce=async e=>{try{const t=await F.get("#/$vocabulary",e);return F.value(t)}catch(e){}},ue=(e,t,r)=>{const[n]=r[e];return te(n).interpret(e,t,r)};var le={validate:Q,setMetaOutputFormat:e=>{H=e},FLAG:T,BASIC:G,DETAILED:M,VERBOSE:N,addKeyword:ne,getKeyword:te,hasKeyword:re,addVocabulary:(e,t)=>{se[e]=t},compileSchema:ae,interpretSchema:ue};var he={compile:e=>{},interpret:()=>!0},fe=async e=>Object.entries(await e),pe=e(async(e,t)=>(await t).map(e)),de=e(async(e,t,r)=>(await r).reduce(async(t,r)=>e(await t,r),t)),ye=e(async(e,t,r={})=>de(async(t,r)=>await e(r)?t.concat([r]):t,[],t,r)),me=e(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).some(e=>e)}),be=e(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).every(e=>e)}),ve=e((e,t)=>e.reduce(async(e,t)=>t(await e),t)),we={entries:fe,map:pe,filter:ye,reduce:de,some:me,every:be,pipeline:ve,all:e=>Promise.all(e),allValues:e=>ve([fe,de(async(e,[t,r])=>(e[t]=await r,e),{})],e)};var ge={compile:async(e,t)=>{const r=F.uri(e);if(!(r in t)){t[r]=!1;const n=F.value(e);t[r]=[`${e.schemaVersion}#validate`,F.uri(e),"boolean"==typeof n?n:await we.pipeline([F.entries,we.map(([t,r])=>[`${e.schemaVersion}#${t}`,r]),we.filter(([e])=>le.hasKeyword(e)),we.map(async([e,r])=>{const n=await r,s=await le.getKeyword(e).compile(n,t);return[e,F.uri(n),s]}),we.all],e)]}},interpret:(e,t,r)=>{const[n,s,i]=r[e],o="boolean"==typeof i?i:i.every(([e,n,s])=>{const i=le.getKeyword(e).interpret(s,t,r);return A.publish("result",{keyword:e,absoluteKeywordLocation:n,instanceLocation:j.uri(t),valid:i}),i});return A.publish("result",{keyword:n,absoluteKeywordLocation:s,instanceLocation:j.uri(t),valid:o}),o}},$e={JsonSchema:le,Schema:F,Json:j,PubSub:A,Keywords:{metaData:he,validate:ge}},je=$e.JsonSchema,Oe=$e.Schema,Ae=$e.Json,Ee=$e.PubSub,Ve=$e.Keywords;export default $e;export{Ae as Json,je as JsonSchema,Ve as Keywords,Ee as PubSub,Oe as Schema}; | ||
var e=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.apply(this,n.concat([].slice.call(arguments)))}}};const t=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(c)},r=(e,t,n,s)=>{if(0===e.length)return n;if(e.length>1){const i=e.shift();return{...t,[i]:r(e,u(t,i,s),n,o(i,s))}}if(Array.isArray(t)){const r={...t};return r[e[0]]=n,r}return"object"==typeof t&&null!==t?{...t,[e[0]]:n}:u(t,e[0],s)},n=(e,t,r,s)=>{if(0!==e.length)if(1!==e.length||l(t)){const i=e.shift();n(e,u(t,i,s),r,o(i,s))}else{t[e[0]]=r}},s=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),i=u(t,n,r);return{...t,[n]:s(e,i,o(n,r))}}if(Array.isArray(t))return t.filter((t,r)=>r!=e[0]);if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return u(t,e[0],r)}},i=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),s=u(t,n,r);i(e,s,o(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:u(t,e[0],r)},o=e((e,t)=>t+"/"+a(e)),a=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),c=e=>e.toString().replace(/~0/g,"~").replace(/~1/g,"/"),u=(e,t,r="")=>{if(l(e))throw Error(`Value at '${r}' is a scalar and can't be indexed`);if(!(t in e))throw Error(`Value at '${r}' does not have index '${t}'`);return e[t]},l=e=>null===e||"object"!=typeof e;var h={nil:"",append:o,get:(e,r)=>{const n=t(e),s=e=>n.reduce(([e,t],r)=>[u(e,r,t),o(r,t)],[e,""])[0];return void 0===r?s:s(r)},set:(n,s,i)=>{const o=t(n),a=e((e,t)=>r(o,e,t,""));return void 0===s?a:a(s,i)},assign:(r,s,i)=>{const o=t(r),a=e((e,t)=>n(o,e,t,""));return void 0===s?a:a(s,i)},unset:(e,r)=>{const n=t(e),i=e=>s(n,e,"");return void 0===r?i:i(r)},delete:(e,r)=>{const n=t(e),s=e=>i(n,e,"");return void 0===r?s:s(r)}};var f={isObject:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,splitUrl:e=>{const[t,r=""]=e.split("#",2);return[decodeURI(t),decodeURI(r)]}};const{splitUrl:p}=f,d=Object.freeze({pointer:"",json:void 0}),y=(e,t=d)=>Object.freeze({...t,pointer:p(e)[1]}),m=e=>h.get(e.pointer,e.json),b=(e,t)=>{const r=h.append(e,t.pointer);return y(`#${encodeURI(r)}`,t)},v=e((e,t)=>m(t).map((r,n)=>e(b(n,t),n))),w=e((e,t,r)=>m(r).reduce((t,n,s)=>e(t,b(s,r),s),t)),g=e((e,t)=>Object.keys(m(t)).every((r,n)=>e(b(r,t),n))),$=e((e,t)=>Object.keys(m(t)).some((r,n)=>e(b(r,t),n)));var j={cons:e=>Object.freeze({...d,json:e}),get:y,uri:e=>`#${encodeURI(e.pointer)}`,value:m,step:b,entries:e=>Object.keys(m(e)).map(t=>[t,b(t,e)]),map:v,reduce:w,every:g,some:$};const O={};var A={publish:(e,t)=>{e in O&&O[e](e,t)},subscribe:(e,t)=>{O[e]=t}},E=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;if(""===e)return x(t)?V(t):t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");if(-1===n)throw new Error("Error, protocol is not specified");t.protocol=r.substring(0,n),n+=2;const s=e.indexOf("/",n),i=e.indexOf("?"),o=e.indexOf("#");-1!==o&&(r=r.substring(0,o));if(-1!==i){const e=r.substring(i);t.query=e,r=r.substring(0,i)}if(-1!==s){const e=r.substring(0,s);t.host=e,r=r.substring(s),t.path=r}else t.host=r;return t}(e);if(""===t){const{host:e,path:t,query:n}=r;return t||n?e+t+n:V(e)}const n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(P.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:t.relativePath=!0;let r=e;const n=e.indexOf("?"),s=e.indexOf("#");if(-1!==s){const e=r.substring(s);t.hash=e,r=r.substring(0,s)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),x(n.href)?V(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:s}=n;return r.host+S(e)+t+s}if(n.relativePath){const{path:e,query:t,hash:s}=n;let i,o=r.path,a=r.host;return 0===e.length?i=o:(o=o.substring(0,o.lastIndexOf("/")),i=S(o+"/"+e)),a+=""!==i||t||s?i+t+s:"/",a}};function V(e){return e+("/"===e[e.length-1]?"":"/")}function S(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach((e,n)=>{"."!==e&&(".."===e?r.pop():""===e&&n!==t.length-1||r.push(e))}),"/"+r.join("/")}const P=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");function x(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),s=!e.includes("#",t);return r&&n&&s}var I=fetch;const{isObject:K,splitUrl:L}=f,R={},U=(e,t="",r="")=>{const n=L(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const s=L(t||e.$id||"")[0];if(!s)throw Error("Couldn't determine an identifier for the schema");const i={};R[s]={schemaVersion:n,schema:k(e,s,n,h.nil,i),anchors:i,recursiveAnchor:!!e.$recursiveAnchor}},k=(e,t,r,n,s)=>{if(K(e)){if("string"==typeof e.$id){const n=e.$id,s=z(t,n),[i,o]=L(s);if(delete e.$id,o&&(e.$anchor=o),i!==t)return U(e,z(t,i),r),{$__jref:n}}return"string"==typeof e.$anchor&&(s[e.$anchor]=n,delete e.$anchor),Object.entries(e).reduce((e,[i,o])=>(e[i]=k(o,t,r,h.append(i,n),s),e),{})}return Array.isArray(e)?e.map((e,i)=>k(e,t,r,h.append(i,n),s)):e},q=Object.freeze({id:"http://",schemaVersion:void 0,pointer:"",schema:void 0,recursiveAnchor:!1}),W=async(e,t=q,r=!1)=>{const n=r&&t.recursiveAnchor?t.recursiveAnchor:_(t),s=z(n,e),[i,o]=L(s);if(!(i in R)){const e=await I(i);U(await e.json(),i)}const a=o&&"/"!==o[0]?R[i].anchors[o]:o,c=Object.freeze({id:i,schemaVersion:R[i].schemaVersion,pointer:a,schema:R[i].schema,recursiveAnchor:t.recursiveAnchor||!!R[i].recursiveAnchor&&i}),u=C(c);return K(u)&&"$__jref"in u?W(u.$__jref,c,r):"string"==typeof u&&c.pointer.endsWith("/$ref")?W(u,c,r):"string"==typeof u&&c.pointer.endsWith("/$recursiveRef")?W(u,c,!0):c},z=(e,t)=>{const r=E(e,t);if("file"===J(r)&&"file"!==J(e))throw Error("Can't access file resource from network context");return r},J=e=>{const t=e.match(/(.+):\/\//)[1];return t?t[1]:""},_=e=>`${e.id}#${encodeURI(e.pointer)}`,C=e=>h.get(e.pointer,e.schema),D=(e,t)=>{const r=h.append(e,t.pointer);return W(`#${encodeURI(r)}`,t)},B=e((e,t)=>C(t).map(async(r,n)=>e(await D(n,t),n)));var F={add:U,get:W,uri:_,value:C,step:D,sibling:(e,t)=>{const r=t.pointer.split("/");r.pop();const n=h.append(e,r.join("/"));return W(`#${encodeURI(n)}`,t)},entries:e=>Object.keys(C(e)).map(t=>[t,D(t,e)]),map:B};const T="FLAG",G="BASIC",M="DETAILED",N="VERBOSE";let H=M;const Q=async(e,t,r)=>{const n={},s=await ae(e,n),i=(e,t=T)=>{let r=[];if(![T,G,M,N].includes(t))throw Error(`The '${t}' error format is not supported`);return A.subscribe("result",X(t,r)),ue(s,j.cons(e),n),r[0]};return void 0===t?i:i(t,r)},X=(e,t)=>{const r=[];return(n,s)=>{for(s.errors=[];r.length>0&&Y(r[r.length-1],s);){const t=r.pop();let n=[];if(e===G&&(n=t.errors,delete t.errors),s.errors.unshift(t,...n),Z(s))break}(e===N||e!==T&&!s.valid)&&r.push(s),t[0]=s}},Y=(e,t)=>e.instanceLocation.startsWith(t.instanceLocation)&&(e.absoluteKeywordLocation.startsWith(t.absoluteKeywordLocation)||Z(e)),Z=e=>e.keyword.endsWith("#$ref")||e.keyword.endsWith("#$recursiveRef"),ee={},te=e=>ee[e],re=e=>e in ee,ne=(e,t)=>{ee[e]=t},se={},ie={},oe={},ae=async(e,t)=>{if(!oe[e.id]){if(!re(`${e.schemaVersion}#validate`))throw Error(`Unsupported schema version: ${e.schemaVersion}`);if(!await ce(e)){if(!(e.schemaVersion in ie)){const t=await F.get(e.schemaVersion),r=await ce(t);Object.entries(r||{}).forEach(([t,r])=>{if(t in se)Object.entries(se[t]).forEach(([t,r])=>{ne(`${e.schemaVersion}#${t}`,r)});else if(r)throw Error(`Missing required vocabulary: ${t}`)}),ie[e.schemaVersion]=await Q(t)}const t=F.value(e),r=ie[e.schemaVersion](t,H);if(!r.valid)throw r}oe[e.id]=!0}return await te(`${e.schemaVersion}#validate`).compile(e,t),F.uri(e)},ce=async e=>{try{const t=await F.get("#/$vocabulary",e);return F.value(t)}catch(e){}},ue=(e,t,r)=>{const[n]=r[e];return te(n).interpret(e,t,r)};var le={validate:Q,setMetaOutputFormat:e=>{H=e},FLAG:T,BASIC:G,DETAILED:M,VERBOSE:N,addKeyword:ne,getKeyword:te,hasKeyword:re,addVocabulary:(e,t)=>{se[e]=t},compileSchema:ae,interpretSchema:ue};var he={compile:()=>{},interpret:()=>!0},fe=async e=>Object.entries(await e),pe=e(async(e,t)=>(await t).map(e)),de=e(async(e,t,r)=>(await r).reduce(async(t,r)=>e(await t,r),t)),ye=e(async(e,t,r={})=>de(async(t,r)=>await e(r)?t.concat([r]):t,[],t,r)),me=e(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).some(e=>e)}),be=e(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).every(e=>e)}),ve=e((e,t)=>e.reduce(async(e,t)=>t(await e),t)),we={entries:fe,map:pe,filter:ye,reduce:de,some:me,every:be,pipeline:ve,all:e=>Promise.all(e),allValues:e=>ve([fe,de(async(e,[t,r])=>(e[t]=await r,e),{})],e)};var ge={compile:async(e,t)=>{const r=F.uri(e);if(!(r in t)){t[r]=!1;const n=F.value(e);t[r]=[`${e.schemaVersion}#validate`,F.uri(e),"boolean"==typeof n?n:await we.pipeline([F.entries,we.map(([t,r])=>[`${e.schemaVersion}#${t}`,r]),we.filter(([e])=>le.hasKeyword(e)),we.map(async([e,r])=>{const n=await r,s=await le.getKeyword(e).compile(n,t);return[e,F.uri(n),s]}),we.all],e)]}},interpret:(e,t,r)=>{const[n,s,i]=r[e],o="boolean"==typeof i?i:i.every(([e,n,s])=>{const i=le.getKeyword(e).interpret(s,t,r);return A.publish("result",{keyword:e,absoluteKeywordLocation:n,instanceLocation:j.uri(t),valid:i}),i});return A.publish("result",{keyword:n,absoluteKeywordLocation:s,instanceLocation:j.uri(t),valid:o}),o}},$e={JsonSchema:le,Schema:F,Json:j,PubSub:A,Keywords:{metaData:he,validate:ge}},je=$e.JsonSchema,Oe=$e.Schema,Ae=$e.Json,Ee=$e.PubSub,Ve=$e.Keywords;export default $e;export{Ae as Json,je as JsonSchema,Ve as Keywords,Ee as PubSub,Oe as Schema}; | ||
//# sourceMappingURL=json-schema-core-esm.min.js.map |
@@ -252,3 +252,3 @@ var JsonSchema = (function (exports) { | ||
resultArray.pop(); // remove previous | ||
} else if (current !== '') { | ||
} else if (current !== '' || index === pathSplit.length - 1) { | ||
resultArray.push(current); | ||
@@ -718,3 +718,3 @@ } | ||
const compile$1 = (schema) => undefined; | ||
const compile$1 = () => undefined; | ||
const interpret = () => true; | ||
@@ -721,0 +721,0 @@ |
@@ -1,2 +0,2 @@ | ||
var JsonSchema=function(e){"use strict";var t=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.apply(this,n.concat([].slice.call(arguments)))}}};const r=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(u)},n=(e,t,r,s)=>{if(0===e.length)return r;if(e.length>1){const i=e.shift();return{...t,[i]:n(e,l(t,i,s),r,a(i,s))}}if(Array.isArray(t)){const n={...t};return n[e[0]]=r,n}return"object"==typeof t&&null!==t?{...t,[e[0]]:r}:l(t,e[0],s)},s=(e,t,r,n)=>{if(0!==e.length)if(1!==e.length||h(t)){const i=e.shift();s(e,l(t,i,n),r,a(i,n))}else{t[e[0]]=r}},i=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),s=l(t,n,r);return{...t,[n]:i(e,s,a(n,r))}}if(Array.isArray(t))return t.filter((t,r)=>r!=e[0]);if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return l(t,e[0],r)}},o=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),s=l(t,n,r);o(e,s,a(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:l(t,e[0],r)},a=t((e,t)=>t+"/"+c(e)),c=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),u=e=>e.toString().replace(/~0/g,"~").replace(/~1/g,"/"),l=(e,t,r="")=>{if(h(e))throw Error(`Value at '${r}' is a scalar and can't be indexed`);if(!(t in e))throw Error(`Value at '${r}' does not have index '${t}'`);return e[t]},h=e=>null===e||"object"!=typeof e;var f={nil:"",append:a,get:(e,t)=>{const n=r(e),s=e=>n.reduce(([e,t],r)=>[l(e,r,t),a(r,t)],[e,""])[0];return void 0===t?s:s(t)},set:(e,s,i)=>{const o=r(e),a=t((e,t)=>n(o,e,t,""));return void 0===s?a:a(s,i)},assign:(e,n,i)=>{const o=r(e),a=t((e,t)=>s(o,e,t,""));return void 0===n?a:a(n,i)},unset:(e,t)=>{const n=r(e),s=e=>i(n,e,"");return void 0===t?s:s(t)},delete:(e,t)=>{const n=r(e),s=e=>o(n,e,"");return void 0===t?s:s(t)}};var d={isObject:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,splitUrl:e=>{const[t,r=""]=e.split("#",2);return[decodeURI(t),decodeURI(r)]}};const{splitUrl:p}=d,y=Object.freeze({pointer:"",json:void 0}),m=(e,t=y)=>Object.freeze({...t,pointer:p(e)[1]}),b=e=>f.get(e.pointer,e.json),v=(e,t)=>{const r=f.append(e,t.pointer);return m(`#${encodeURI(r)}`,t)},w=t((e,t)=>b(t).map((r,n)=>e(v(n,t),n))),g=t((e,t,r)=>b(r).reduce((t,n,s)=>e(t,v(s,r),s),t)),$=t((e,t)=>Object.keys(b(t)).every((r,n)=>e(v(r,t),n))),j=t((e,t)=>Object.keys(b(t)).some((r,n)=>e(v(r,t),n)));var O={cons:e=>Object.freeze({...y,json:e}),get:m,uri:e=>`#${encodeURI(e.pointer)}`,value:b,step:v,entries:e=>Object.keys(b(e)).map(t=>[t,v(t,e)]),map:w,reduce:g,every:$,some:j};const A={};var E={publish:(e,t)=>{e in A&&A[e](e,t)},subscribe:(e,t)=>{A[e]=t}},V=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;if(""===e)return K(t)?S(t):t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");if(-1===n)throw new Error("Error, protocol is not specified");t.protocol=r.substring(0,n),n+=2;const s=e.indexOf("/",n),i=e.indexOf("?"),o=e.indexOf("#");-1!==o&&(r=r.substring(0,o));if(-1!==i){const e=r.substring(i);t.query=e,r=r.substring(0,i)}if(-1!==s){const e=r.substring(0,s);t.host=e,r=r.substring(s),t.path=r}else t.host=r;return t}(e);if(""===t){const{host:e,path:t,query:n}=r;return t||n?e+t+n:S(e)}const n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(I.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:t.relativePath=!0;let r=e;const n=e.indexOf("?"),s=e.indexOf("#");if(-1!==s){const e=r.substring(s);t.hash=e,r=r.substring(0,s)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),K(n.href)?S(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:s}=n;return r.host+P(e)+t+s}if(n.relativePath){const{path:e,query:t,hash:s}=n;let i,o=r.path,a=r.host;return 0===e.length?i=o:(o=o.substring(0,o.lastIndexOf("/")),i=P(o+"/"+e)),a+=""!==i||t||s?i+t+s:"/",a}};function S(e){return e+("/"===e[e.length-1]?"":"/")}function P(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach((e,t)=>{"."!==e&&(".."===e?r.pop():""!==e&&r.push(e))}),"/"+r.join("/")}const I=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");function K(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),s=!e.includes("#",t);return r&&n&&s}var x=fetch;const{isObject:L,splitUrl:R}=d,U={},k=(e,t="",r="")=>{const n=R(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const s=R(t||e.$id||"")[0];if(!s)throw Error("Couldn't determine an identifier for the schema");const i={};U[s]={schemaVersion:n,schema:q(e,s,n,f.nil,i),anchors:i,recursiveAnchor:!!e.$recursiveAnchor}},q=(e,t,r,n,s)=>{if(L(e)){if("string"==typeof e.$id){const n=e.$id,s=z(t,n),[i,o]=R(s);if(delete e.$id,o&&(e.$anchor=o),i!==t)return k(e,z(t,i),r),{$__jref:n}}return"string"==typeof e.$anchor&&(s[e.$anchor]=n,delete e.$anchor),Object.entries(e).reduce((e,[i,o])=>(e[i]=q(o,t,r,f.append(i,n),s),e),{})}return Array.isArray(e)?e.map((e,i)=>q(e,t,r,f.append(i,n),s)):e},J=Object.freeze({id:"http://",schemaVersion:void 0,pointer:"",schema:void 0,recursiveAnchor:!1}),W=async(e,t=J,r=!1)=>{const n=r&&t.recursiveAnchor?t.recursiveAnchor:C(t),s=z(n,e),[i,o]=R(s);if(!(i in U)){const e=await x(i);k(await e.json(),i)}const a=o&&"/"!==o[0]?U[i].anchors[o]:o,c=Object.freeze({id:i,schemaVersion:U[i].schemaVersion,pointer:a,schema:U[i].schema,recursiveAnchor:t.recursiveAnchor||!!U[i].recursiveAnchor&&i}),u=D(c);return L(u)&&"$__jref"in u?W(u.$__jref,c,r):"string"==typeof u&&c.pointer.endsWith("/$ref")?W(u,c,r):"string"==typeof u&&c.pointer.endsWith("/$recursiveRef")?W(u,c,!0):c},z=(e,t)=>{const r=V(e,t);if("file"===_(r)&&"file"!==_(e))throw Error("Can't access file resource from network context");return r},_=e=>{const t=e.match(/(.+):\/\//)[1];return t?t[1]:""},C=e=>`${e.id}#${encodeURI(e.pointer)}`,D=e=>f.get(e.pointer,e.schema),B=(e,t)=>{const r=f.append(e,t.pointer);return W(`#${encodeURI(r)}`,t)},F=t((e,t)=>D(t).map(async(r,n)=>e(await B(n,t),n)));var T={add:k,get:W,uri:C,value:D,step:B,sibling:(e,t)=>{const r=t.pointer.split("/");r.pop();const n=f.append(e,r.join("/"));return W(`#${encodeURI(n)}`,t)},entries:e=>Object.keys(D(e)).map(t=>[t,B(t,e)]),map:F};const G="FLAG",M="BASIC",N="DETAILED",H="VERBOSE";let Q=N;const X=async(e,t,r)=>{const n={},s=await ce(e,n),i=(e,t=G)=>{let r=[];if(![G,M,N,H].includes(t))throw Error(`The '${t}' error format is not supported`);return E.subscribe("result",Y(t,r)),le(s,O.cons(e),n),r[0]};return void 0===t?i:i(t,r)},Y=(e,t)=>{const r=[];return(n,s)=>{for(s.errors=[];r.length>0&&Z(r[r.length-1],s);){const t=r.pop();let n=[];if(e===M&&(n=t.errors,delete t.errors),s.errors.unshift(t,...n),ee(s))break}(e===H||e!==G&&!s.valid)&&r.push(s),t[0]=s}},Z=(e,t)=>e.instanceLocation.startsWith(t.instanceLocation)&&(e.absoluteKeywordLocation.startsWith(t.absoluteKeywordLocation)||ee(e)),ee=e=>e.keyword.endsWith("#$ref")||e.keyword.endsWith("#$recursiveRef"),te={},re=e=>te[e],ne=e=>e in te,se=(e,t)=>{te[e]=t},ie={},oe={},ae={},ce=async(e,t)=>{if(!ae[e.id]){if(!ne(`${e.schemaVersion}#validate`))throw Error(`Unsupported schema version: ${e.schemaVersion}`);if(!await ue(e)){if(!(e.schemaVersion in oe)){const t=await T.get(e.schemaVersion),r=await ue(t);Object.entries(r||{}).forEach(([t,r])=>{if(t in ie)Object.entries(ie[t]).forEach(([t,r])=>{se(`${e.schemaVersion}#${t}`,r)});else if(r)throw Error(`Missing required vocabulary: ${t}`)}),oe[e.schemaVersion]=await X(t)}const t=T.value(e),r=oe[e.schemaVersion](t,Q);if(!r.valid)throw r}ae[e.id]=!0}return await re(`${e.schemaVersion}#validate`).compile(e,t),T.uri(e)},ue=async e=>{try{const t=await T.get("#/$vocabulary",e);return T.value(t)}catch(e){}},le=(e,t,r)=>{const[n]=r[e];return re(n).interpret(e,t,r)};var he={validate:X,setMetaOutputFormat:e=>{Q=e},FLAG:G,BASIC:M,DETAILED:N,VERBOSE:H,addKeyword:se,getKeyword:re,hasKeyword:ne,addVocabulary:(e,t)=>{ie[e]=t},compileSchema:ce,interpretSchema:le};var fe={compile:e=>{},interpret:()=>!0},de=async e=>Object.entries(await e),pe=t(async(e,t)=>(await t).map(e)),ye=t(async(e,t,r)=>(await r).reduce(async(t,r)=>e(await t,r),t)),me=t(async(e,t,r={})=>ye(async(t,r)=>await e(r)?t.concat([r]):t,[],t,r)),be=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).some(e=>e)}),ve=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).every(e=>e)}),we=t((e,t)=>e.reduce(async(e,t)=>t(await e),t)),ge={entries:de,map:pe,filter:me,reduce:ye,some:be,every:ve,pipeline:we,all:e=>Promise.all(e),allValues:e=>we([de,ye(async(e,[t,r])=>(e[t]=await r,e),{})],e)};var $e={compile:async(e,t)=>{const r=T.uri(e);if(!(r in t)){t[r]=!1;const n=T.value(e);t[r]=[`${e.schemaVersion}#validate`,T.uri(e),"boolean"==typeof n?n:await ge.pipeline([T.entries,ge.map(([t,r])=>[`${e.schemaVersion}#${t}`,r]),ge.filter(([e])=>he.hasKeyword(e)),ge.map(async([e,r])=>{const n=await r,s=await he.getKeyword(e).compile(n,t);return[e,T.uri(n),s]}),ge.all],e)]}},interpret:(e,t,r)=>{const[n,s,i]=r[e],o="boolean"==typeof i?i:i.every(([e,n,s])=>{const i=he.getKeyword(e).interpret(s,t,r);return E.publish("result",{keyword:e,absoluteKeywordLocation:n,instanceLocation:O.uri(t),valid:i}),i});return E.publish("result",{keyword:n,absoluteKeywordLocation:s,instanceLocation:O.uri(t),valid:o}),o}},je={JsonSchema:he,Schema:T,Json:O,PubSub:E,Keywords:{metaData:fe,validate:$e}},Oe=je.JsonSchema,Ae=je.Schema,Ee=je.Json,Ve=je.PubSub,Se=je.Keywords;return e.Json=Ee,e.JsonSchema=Oe,e.Keywords=Se,e.PubSub=Ve,e.Schema=Ae,e.default=je,e}({}); | ||
var JsonSchema=function(e){"use strict";var t=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.apply(this,n.concat([].slice.call(arguments)))}}};const r=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(u)},n=(e,t,r,s)=>{if(0===e.length)return r;if(e.length>1){const i=e.shift();return{...t,[i]:n(e,l(t,i,s),r,a(i,s))}}if(Array.isArray(t)){const n={...t};return n[e[0]]=r,n}return"object"==typeof t&&null!==t?{...t,[e[0]]:r}:l(t,e[0],s)},s=(e,t,r,n)=>{if(0!==e.length)if(1!==e.length||h(t)){const i=e.shift();s(e,l(t,i,n),r,a(i,n))}else{t[e[0]]=r}},i=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),s=l(t,n,r);return{...t,[n]:i(e,s,a(n,r))}}if(Array.isArray(t))return t.filter((t,r)=>r!=e[0]);if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return l(t,e[0],r)}},o=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),s=l(t,n,r);o(e,s,a(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:l(t,e[0],r)},a=t((e,t)=>t+"/"+c(e)),c=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),u=e=>e.toString().replace(/~0/g,"~").replace(/~1/g,"/"),l=(e,t,r="")=>{if(h(e))throw Error(`Value at '${r}' is a scalar and can't be indexed`);if(!(t in e))throw Error(`Value at '${r}' does not have index '${t}'`);return e[t]},h=e=>null===e||"object"!=typeof e;var f={nil:"",append:a,get:(e,t)=>{const n=r(e),s=e=>n.reduce(([e,t],r)=>[l(e,r,t),a(r,t)],[e,""])[0];return void 0===t?s:s(t)},set:(e,s,i)=>{const o=r(e),a=t((e,t)=>n(o,e,t,""));return void 0===s?a:a(s,i)},assign:(e,n,i)=>{const o=r(e),a=t((e,t)=>s(o,e,t,""));return void 0===n?a:a(n,i)},unset:(e,t)=>{const n=r(e),s=e=>i(n,e,"");return void 0===t?s:s(t)},delete:(e,t)=>{const n=r(e),s=e=>o(n,e,"");return void 0===t?s:s(t)}};var d={isObject:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,splitUrl:e=>{const[t,r=""]=e.split("#",2);return[decodeURI(t),decodeURI(r)]}};const{splitUrl:p}=d,y=Object.freeze({pointer:"",json:void 0}),m=(e,t=y)=>Object.freeze({...t,pointer:p(e)[1]}),b=e=>f.get(e.pointer,e.json),v=(e,t)=>{const r=f.append(e,t.pointer);return m(`#${encodeURI(r)}`,t)},w=t((e,t)=>b(t).map((r,n)=>e(v(n,t),n))),g=t((e,t,r)=>b(r).reduce((t,n,s)=>e(t,v(s,r),s),t)),$=t((e,t)=>Object.keys(b(t)).every((r,n)=>e(v(r,t),n))),j=t((e,t)=>Object.keys(b(t)).some((r,n)=>e(v(r,t),n)));var O={cons:e=>Object.freeze({...y,json:e}),get:m,uri:e=>`#${encodeURI(e.pointer)}`,value:b,step:v,entries:e=>Object.keys(b(e)).map(t=>[t,v(t,e)]),map:w,reduce:g,every:$,some:j};const A={};var E={publish:(e,t)=>{e in A&&A[e](e,t)},subscribe:(e,t)=>{A[e]=t}},V=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;if(""===e)return K(t)?S(t):t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");if(-1===n)throw new Error("Error, protocol is not specified");t.protocol=r.substring(0,n),n+=2;const s=e.indexOf("/",n),i=e.indexOf("?"),o=e.indexOf("#");-1!==o&&(r=r.substring(0,o));if(-1!==i){const e=r.substring(i);t.query=e,r=r.substring(0,i)}if(-1!==s){const e=r.substring(0,s);t.host=e,r=r.substring(s),t.path=r}else t.host=r;return t}(e);if(""===t){const{host:e,path:t,query:n}=r;return t||n?e+t+n:S(e)}const n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(I.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:t.relativePath=!0;let r=e;const n=e.indexOf("?"),s=e.indexOf("#");if(-1!==s){const e=r.substring(s);t.hash=e,r=r.substring(0,s)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),K(n.href)?S(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:s}=n;return r.host+P(e)+t+s}if(n.relativePath){const{path:e,query:t,hash:s}=n;let i,o=r.path,a=r.host;return 0===e.length?i=o:(o=o.substring(0,o.lastIndexOf("/")),i=P(o+"/"+e)),a+=""!==i||t||s?i+t+s:"/",a}};function S(e){return e+("/"===e[e.length-1]?"":"/")}function P(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach((e,n)=>{"."!==e&&(".."===e?r.pop():""===e&&n!==t.length-1||r.push(e))}),"/"+r.join("/")}const I=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");function K(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),s=!e.includes("#",t);return r&&n&&s}var x=fetch;const{isObject:L,splitUrl:R}=d,U={},k=(e,t="",r="")=>{const n=R(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const s=R(t||e.$id||"")[0];if(!s)throw Error("Couldn't determine an identifier for the schema");const i={};U[s]={schemaVersion:n,schema:q(e,s,n,f.nil,i),anchors:i,recursiveAnchor:!!e.$recursiveAnchor}},q=(e,t,r,n,s)=>{if(L(e)){if("string"==typeof e.$id){const n=e.$id,s=z(t,n),[i,o]=R(s);if(delete e.$id,o&&(e.$anchor=o),i!==t)return k(e,z(t,i),r),{$__jref:n}}return"string"==typeof e.$anchor&&(s[e.$anchor]=n,delete e.$anchor),Object.entries(e).reduce((e,[i,o])=>(e[i]=q(o,t,r,f.append(i,n),s),e),{})}return Array.isArray(e)?e.map((e,i)=>q(e,t,r,f.append(i,n),s)):e},J=Object.freeze({id:"http://",schemaVersion:void 0,pointer:"",schema:void 0,recursiveAnchor:!1}),W=async(e,t=J,r=!1)=>{const n=r&&t.recursiveAnchor?t.recursiveAnchor:C(t),s=z(n,e),[i,o]=R(s);if(!(i in U)){const e=await x(i);k(await e.json(),i)}const a=o&&"/"!==o[0]?U[i].anchors[o]:o,c=Object.freeze({id:i,schemaVersion:U[i].schemaVersion,pointer:a,schema:U[i].schema,recursiveAnchor:t.recursiveAnchor||!!U[i].recursiveAnchor&&i}),u=D(c);return L(u)&&"$__jref"in u?W(u.$__jref,c,r):"string"==typeof u&&c.pointer.endsWith("/$ref")?W(u,c,r):"string"==typeof u&&c.pointer.endsWith("/$recursiveRef")?W(u,c,!0):c},z=(e,t)=>{const r=V(e,t);if("file"===_(r)&&"file"!==_(e))throw Error("Can't access file resource from network context");return r},_=e=>{const t=e.match(/(.+):\/\//)[1];return t?t[1]:""},C=e=>`${e.id}#${encodeURI(e.pointer)}`,D=e=>f.get(e.pointer,e.schema),B=(e,t)=>{const r=f.append(e,t.pointer);return W(`#${encodeURI(r)}`,t)},F=t((e,t)=>D(t).map(async(r,n)=>e(await B(n,t),n)));var T={add:k,get:W,uri:C,value:D,step:B,sibling:(e,t)=>{const r=t.pointer.split("/");r.pop();const n=f.append(e,r.join("/"));return W(`#${encodeURI(n)}`,t)},entries:e=>Object.keys(D(e)).map(t=>[t,B(t,e)]),map:F};const G="FLAG",M="BASIC",N="DETAILED",H="VERBOSE";let Q=N;const X=async(e,t,r)=>{const n={},s=await ce(e,n),i=(e,t=G)=>{let r=[];if(![G,M,N,H].includes(t))throw Error(`The '${t}' error format is not supported`);return E.subscribe("result",Y(t,r)),le(s,O.cons(e),n),r[0]};return void 0===t?i:i(t,r)},Y=(e,t)=>{const r=[];return(n,s)=>{for(s.errors=[];r.length>0&&Z(r[r.length-1],s);){const t=r.pop();let n=[];if(e===M&&(n=t.errors,delete t.errors),s.errors.unshift(t,...n),ee(s))break}(e===H||e!==G&&!s.valid)&&r.push(s),t[0]=s}},Z=(e,t)=>e.instanceLocation.startsWith(t.instanceLocation)&&(e.absoluteKeywordLocation.startsWith(t.absoluteKeywordLocation)||ee(e)),ee=e=>e.keyword.endsWith("#$ref")||e.keyword.endsWith("#$recursiveRef"),te={},re=e=>te[e],ne=e=>e in te,se=(e,t)=>{te[e]=t},ie={},oe={},ae={},ce=async(e,t)=>{if(!ae[e.id]){if(!ne(`${e.schemaVersion}#validate`))throw Error(`Unsupported schema version: ${e.schemaVersion}`);if(!await ue(e)){if(!(e.schemaVersion in oe)){const t=await T.get(e.schemaVersion),r=await ue(t);Object.entries(r||{}).forEach(([t,r])=>{if(t in ie)Object.entries(ie[t]).forEach(([t,r])=>{se(`${e.schemaVersion}#${t}`,r)});else if(r)throw Error(`Missing required vocabulary: ${t}`)}),oe[e.schemaVersion]=await X(t)}const t=T.value(e),r=oe[e.schemaVersion](t,Q);if(!r.valid)throw r}ae[e.id]=!0}return await re(`${e.schemaVersion}#validate`).compile(e,t),T.uri(e)},ue=async e=>{try{const t=await T.get("#/$vocabulary",e);return T.value(t)}catch(e){}},le=(e,t,r)=>{const[n]=r[e];return re(n).interpret(e,t,r)};var he={validate:X,setMetaOutputFormat:e=>{Q=e},FLAG:G,BASIC:M,DETAILED:N,VERBOSE:H,addKeyword:se,getKeyword:re,hasKeyword:ne,addVocabulary:(e,t)=>{ie[e]=t},compileSchema:ce,interpretSchema:le};var fe={compile:()=>{},interpret:()=>!0},de=async e=>Object.entries(await e),pe=t(async(e,t)=>(await t).map(e)),ye=t(async(e,t,r)=>(await r).reduce(async(t,r)=>e(await t,r),t)),me=t(async(e,t,r={})=>ye(async(t,r)=>await e(r)?t.concat([r]):t,[],t,r)),be=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).some(e=>e)}),ve=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).every(e=>e)}),we=t((e,t)=>e.reduce(async(e,t)=>t(await e),t)),ge={entries:de,map:pe,filter:me,reduce:ye,some:be,every:ve,pipeline:we,all:e=>Promise.all(e),allValues:e=>we([de,ye(async(e,[t,r])=>(e[t]=await r,e),{})],e)};var $e={compile:async(e,t)=>{const r=T.uri(e);if(!(r in t)){t[r]=!1;const n=T.value(e);t[r]=[`${e.schemaVersion}#validate`,T.uri(e),"boolean"==typeof n?n:await ge.pipeline([T.entries,ge.map(([t,r])=>[`${e.schemaVersion}#${t}`,r]),ge.filter(([e])=>he.hasKeyword(e)),ge.map(async([e,r])=>{const n=await r,s=await he.getKeyword(e).compile(n,t);return[e,T.uri(n),s]}),ge.all],e)]}},interpret:(e,t,r)=>{const[n,s,i]=r[e],o="boolean"==typeof i?i:i.every(([e,n,s])=>{const i=he.getKeyword(e).interpret(s,t,r);return E.publish("result",{keyword:e,absoluteKeywordLocation:n,instanceLocation:O.uri(t),valid:i}),i});return E.publish("result",{keyword:n,absoluteKeywordLocation:s,instanceLocation:O.uri(t),valid:o}),o}},je={JsonSchema:he,Schema:T,Json:O,PubSub:E,Keywords:{metaData:fe,validate:$e}},Oe=je.JsonSchema,Ae=je.Schema,Ee=je.Json,Ve=je.PubSub,Se=je.Keywords;return e.Json=Ee,e.JsonSchema=Oe,e.Keywords=Se,e.PubSub=Ve,e.Schema=Ae,e.default=je,e}({}); | ||
//# sourceMappingURL=json-schema-core-iife.min.js.map |
@@ -254,3 +254,3 @@ System.register('JsonSchema', [], function (exports) { | ||
resultArray.pop(); // remove previous | ||
} else if (current !== '') { | ||
} else if (current !== '' || index === pathSplit.length - 1) { | ||
resultArray.push(current); | ||
@@ -720,3 +720,3 @@ } | ||
const compile$1 = (schema) => undefined; | ||
const compile$1 = () => undefined; | ||
const interpret = () => true; | ||
@@ -723,0 +723,0 @@ |
@@ -1,2 +0,2 @@ | ||
System.register("JsonSchema",[],(function(e){"use strict";return{execute:function(){var t=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.apply(this,n.concat([].slice.call(arguments)))}}};const r=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(u)},n=(e,t,r,s)=>{if(0===e.length)return r;if(e.length>1){const i=e.shift();return{...t,[i]:n(e,l(t,i,s),r,a(i,s))}}if(Array.isArray(t)){const n={...t};return n[e[0]]=r,n}return"object"==typeof t&&null!==t?{...t,[e[0]]:r}:l(t,e[0],s)},s=(e,t,r,n)=>{if(0!==e.length)if(1!==e.length||h(t)){const i=e.shift();s(e,l(t,i,n),r,a(i,n))}else{t[e[0]]=r}},i=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),s=l(t,n,r);return{...t,[n]:i(e,s,a(n,r))}}if(Array.isArray(t))return t.filter((t,r)=>r!=e[0]);if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return l(t,e[0],r)}},o=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),s=l(t,n,r);o(e,s,a(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:l(t,e[0],r)},a=t((e,t)=>t+"/"+c(e)),c=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),u=e=>e.toString().replace(/~0/g,"~").replace(/~1/g,"/"),l=(e,t,r="")=>{if(h(e))throw Error(`Value at '${r}' is a scalar and can't be indexed`);if(!(t in e))throw Error(`Value at '${r}' does not have index '${t}'`);return e[t]},h=e=>null===e||"object"!=typeof e;var f={nil:"",append:a,get:(e,t)=>{const n=r(e),s=e=>n.reduce(([e,t],r)=>[l(e,r,t),a(r,t)],[e,""])[0];return void 0===t?s:s(t)},set:(e,s,i)=>{const o=r(e),a=t((e,t)=>n(o,e,t,""));return void 0===s?a:a(s,i)},assign:(e,n,i)=>{const o=r(e),a=t((e,t)=>s(o,e,t,""));return void 0===n?a:a(n,i)},unset:(e,t)=>{const n=r(e),s=e=>i(n,e,"");return void 0===t?s:s(t)},delete:(e,t)=>{const n=r(e),s=e=>o(n,e,"");return void 0===t?s:s(t)}};var d={isObject:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,splitUrl:e=>{const[t,r=""]=e.split("#",2);return[decodeURI(t),decodeURI(r)]}};const{splitUrl:p}=d,y=Object.freeze({pointer:"",json:void 0}),m=(e,t=y)=>Object.freeze({...t,pointer:p(e)[1]}),b=e=>f.get(e.pointer,e.json),v=(e,t)=>{const r=f.append(e,t.pointer);return m(`#${encodeURI(r)}`,t)},w=t((e,t)=>b(t).map((r,n)=>e(v(n,t),n))),g=t((e,t,r)=>b(r).reduce((t,n,s)=>e(t,v(s,r),s),t)),$=t((e,t)=>Object.keys(b(t)).every((r,n)=>e(v(r,t),n))),j=t((e,t)=>Object.keys(b(t)).some((r,n)=>e(v(r,t),n)));var O={cons:e=>Object.freeze({...y,json:e}),get:m,uri:e=>`#${encodeURI(e.pointer)}`,value:b,step:v,entries:e=>Object.keys(b(e)).map(t=>[t,v(t,e)]),map:w,reduce:g,every:$,some:j};const A={};var E={publish:(e,t)=>{e in A&&A[e](e,t)},subscribe:(e,t)=>{A[e]=t}},S=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;if(""===e)return I(t)?V(t):t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");if(-1===n)throw new Error("Error, protocol is not specified");t.protocol=r.substring(0,n),n+=2;const s=e.indexOf("/",n),i=e.indexOf("?"),o=e.indexOf("#");-1!==o&&(r=r.substring(0,o));if(-1!==i){const e=r.substring(i);t.query=e,r=r.substring(0,i)}if(-1!==s){const e=r.substring(0,s);t.host=e,r=r.substring(s),t.path=r}else t.host=r;return t}(e);if(""===t){const{host:e,path:t,query:n}=r;return t||n?e+t+n:V(e)}const n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(x.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:t.relativePath=!0;let r=e;const n=e.indexOf("?"),s=e.indexOf("#");if(-1!==s){const e=r.substring(s);t.hash=e,r=r.substring(0,s)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),I(n.href)?V(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:s}=n;return r.host+P(e)+t+s}if(n.relativePath){const{path:e,query:t,hash:s}=n;let i,o=r.path,a=r.host;return 0===e.length?i=o:(o=o.substring(0,o.lastIndexOf("/")),i=P(o+"/"+e)),a+=""!==i||t||s?i+t+s:"/",a}};function V(e){return e+("/"===e[e.length-1]?"":"/")}function P(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach((e,t)=>{"."!==e&&(".."===e?r.pop():""!==e&&r.push(e))}),"/"+r.join("/")}const x=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");function I(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),s=!e.includes("#",t);return r&&n&&s}var K=fetch;const{isObject:L,splitUrl:R}=d,U={},k=(e,t="",r="")=>{const n=R(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const s=R(t||e.$id||"")[0];if(!s)throw Error("Couldn't determine an identifier for the schema");const i={};U[s]={schemaVersion:n,schema:q(e,s,n,f.nil,i),anchors:i,recursiveAnchor:!!e.$recursiveAnchor}},q=(e,t,r,n,s)=>{if(L(e)){if("string"==typeof e.$id){const n=e.$id,s=z(t,n),[i,o]=R(s);if(delete e.$id,o&&(e.$anchor=o),i!==t)return k(e,z(t,i),r),{$__jref:n}}return"string"==typeof e.$anchor&&(s[e.$anchor]=n,delete e.$anchor),Object.entries(e).reduce((e,[i,o])=>(e[i]=q(o,t,r,f.append(i,n),s),e),{})}return Array.isArray(e)?e.map((e,i)=>q(e,t,r,f.append(i,n),s)):e},J=Object.freeze({id:"http://",schemaVersion:void 0,pointer:"",schema:void 0,recursiveAnchor:!1}),W=async(e,t=J,r=!1)=>{const n=r&&t.recursiveAnchor?t.recursiveAnchor:C(t),s=z(n,e),[i,o]=R(s);if(!(i in U)){const e=await K(i);k(await e.json(),i)}const a=o&&"/"!==o[0]?U[i].anchors[o]:o,c=Object.freeze({id:i,schemaVersion:U[i].schemaVersion,pointer:a,schema:U[i].schema,recursiveAnchor:t.recursiveAnchor||!!U[i].recursiveAnchor&&i}),u=D(c);return L(u)&&"$__jref"in u?W(u.$__jref,c,r):"string"==typeof u&&c.pointer.endsWith("/$ref")?W(u,c,r):"string"==typeof u&&c.pointer.endsWith("/$recursiveRef")?W(u,c,!0):c},z=(e,t)=>{const r=S(e,t);if("file"===_(r)&&"file"!==_(e))throw Error("Can't access file resource from network context");return r},_=e=>{const t=e.match(/(.+):\/\//)[1];return t?t[1]:""},C=e=>`${e.id}#${encodeURI(e.pointer)}`,D=e=>f.get(e.pointer,e.schema),B=(e,t)=>{const r=f.append(e,t.pointer);return W(`#${encodeURI(r)}`,t)},F=t((e,t)=>D(t).map(async(r,n)=>e(await B(n,t),n)));var T={add:k,get:W,uri:C,value:D,step:B,sibling:(e,t)=>{const r=t.pointer.split("/");r.pop();const n=f.append(e,r.join("/"));return W(`#${encodeURI(n)}`,t)},entries:e=>Object.keys(D(e)).map(t=>[t,B(t,e)]),map:F};const G="FLAG",M="BASIC",N="DETAILED",H="VERBOSE";let Q=N;const X=async(e,t,r)=>{const n={},s=await ce(e,n),i=(e,t=G)=>{let r=[];if(![G,M,N,H].includes(t))throw Error(`The '${t}' error format is not supported`);return E.subscribe("result",Y(t,r)),le(s,O.cons(e),n),r[0]};return void 0===t?i:i(t,r)},Y=(e,t)=>{const r=[];return(n,s)=>{for(s.errors=[];r.length>0&&Z(r[r.length-1],s);){const t=r.pop();let n=[];if(e===M&&(n=t.errors,delete t.errors),s.errors.unshift(t,...n),ee(s))break}(e===H||e!==G&&!s.valid)&&r.push(s),t[0]=s}},Z=(e,t)=>e.instanceLocation.startsWith(t.instanceLocation)&&(e.absoluteKeywordLocation.startsWith(t.absoluteKeywordLocation)||ee(e)),ee=e=>e.keyword.endsWith("#$ref")||e.keyword.endsWith("#$recursiveRef"),te={},re=e=>te[e],ne=e=>e in te,se=(e,t)=>{te[e]=t},ie={},oe={},ae={},ce=async(e,t)=>{if(!ae[e.id]){if(!ne(`${e.schemaVersion}#validate`))throw Error(`Unsupported schema version: ${e.schemaVersion}`);if(!await ue(e)){if(!(e.schemaVersion in oe)){const t=await T.get(e.schemaVersion),r=await ue(t);Object.entries(r||{}).forEach(([t,r])=>{if(t in ie)Object.entries(ie[t]).forEach(([t,r])=>{se(`${e.schemaVersion}#${t}`,r)});else if(r)throw Error(`Missing required vocabulary: ${t}`)}),oe[e.schemaVersion]=await X(t)}const t=T.value(e),r=oe[e.schemaVersion](t,Q);if(!r.valid)throw r}ae[e.id]=!0}return await re(`${e.schemaVersion}#validate`).compile(e,t),T.uri(e)},ue=async e=>{try{const t=await T.get("#/$vocabulary",e);return T.value(t)}catch(e){}},le=(e,t,r)=>{const[n]=r[e];return re(n).interpret(e,t,r)};var he={validate:X,setMetaOutputFormat:e=>{Q=e},FLAG:G,BASIC:M,DETAILED:N,VERBOSE:H,addKeyword:se,getKeyword:re,hasKeyword:ne,addVocabulary:(e,t)=>{ie[e]=t},compileSchema:ce,interpretSchema:le};var fe={compile:e=>{},interpret:()=>!0},de=async e=>Object.entries(await e),pe=t(async(e,t)=>(await t).map(e)),ye=t(async(e,t,r)=>(await r).reduce(async(t,r)=>e(await t,r),t)),me=t(async(e,t,r={})=>ye(async(t,r)=>await e(r)?t.concat([r]):t,[],t,r)),be=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).some(e=>e)}),ve=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).every(e=>e)}),we=t((e,t)=>e.reduce(async(e,t)=>t(await e),t)),ge={entries:de,map:pe,filter:me,reduce:ye,some:be,every:ve,pipeline:we,all:e=>Promise.all(e),allValues:e=>we([de,ye(async(e,[t,r])=>(e[t]=await r,e),{})],e)};var $e={compile:async(e,t)=>{const r=T.uri(e);if(!(r in t)){t[r]=!1;const n=T.value(e);t[r]=[`${e.schemaVersion}#validate`,T.uri(e),"boolean"==typeof n?n:await ge.pipeline([T.entries,ge.map(([t,r])=>[`${e.schemaVersion}#${t}`,r]),ge.filter(([e])=>he.hasKeyword(e)),ge.map(async([e,r])=>{const n=await r,s=await he.getKeyword(e).compile(n,t);return[e,T.uri(n),s]}),ge.all],e)]}},interpret:(e,t,r)=>{const[n,s,i]=r[e],o="boolean"==typeof i?i:i.every(([e,n,s])=>{const i=he.getKeyword(e).interpret(s,t,r);return E.publish("result",{keyword:e,absoluteKeywordLocation:n,instanceLocation:O.uri(t),valid:i}),i});return E.publish("result",{keyword:n,absoluteKeywordLocation:s,instanceLocation:O.uri(t),valid:o}),o}},je={JsonSchema:he,Schema:T,Json:O,PubSub:E,Keywords:{metaData:fe,validate:$e}};e("default",je);e("JsonSchema",je.JsonSchema),e("Schema",je.Schema),e("Json",je.Json),e("PubSub",je.PubSub),e("Keywords",je.Keywords)}}})); | ||
System.register("JsonSchema",[],(function(e){"use strict";return{execute:function(){var t=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.apply(this,n.concat([].slice.call(arguments)))}}};const r=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(u)},n=(e,t,r,s)=>{if(0===e.length)return r;if(e.length>1){const i=e.shift();return{...t,[i]:n(e,l(t,i,s),r,a(i,s))}}if(Array.isArray(t)){const n={...t};return n[e[0]]=r,n}return"object"==typeof t&&null!==t?{...t,[e[0]]:r}:l(t,e[0],s)},s=(e,t,r,n)=>{if(0!==e.length)if(1!==e.length||h(t)){const i=e.shift();s(e,l(t,i,n),r,a(i,n))}else{t[e[0]]=r}},i=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),s=l(t,n,r);return{...t,[n]:i(e,s,a(n,r))}}if(Array.isArray(t))return t.filter((t,r)=>r!=e[0]);if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return l(t,e[0],r)}},o=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),s=l(t,n,r);o(e,s,a(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:l(t,e[0],r)},a=t((e,t)=>t+"/"+c(e)),c=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),u=e=>e.toString().replace(/~0/g,"~").replace(/~1/g,"/"),l=(e,t,r="")=>{if(h(e))throw Error(`Value at '${r}' is a scalar and can't be indexed`);if(!(t in e))throw Error(`Value at '${r}' does not have index '${t}'`);return e[t]},h=e=>null===e||"object"!=typeof e;var f={nil:"",append:a,get:(e,t)=>{const n=r(e),s=e=>n.reduce(([e,t],r)=>[l(e,r,t),a(r,t)],[e,""])[0];return void 0===t?s:s(t)},set:(e,s,i)=>{const o=r(e),a=t((e,t)=>n(o,e,t,""));return void 0===s?a:a(s,i)},assign:(e,n,i)=>{const o=r(e),a=t((e,t)=>s(o,e,t,""));return void 0===n?a:a(n,i)},unset:(e,t)=>{const n=r(e),s=e=>i(n,e,"");return void 0===t?s:s(t)},delete:(e,t)=>{const n=r(e),s=e=>o(n,e,"");return void 0===t?s:s(t)}};var d={isObject:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,splitUrl:e=>{const[t,r=""]=e.split("#",2);return[decodeURI(t),decodeURI(r)]}};const{splitUrl:p}=d,y=Object.freeze({pointer:"",json:void 0}),m=(e,t=y)=>Object.freeze({...t,pointer:p(e)[1]}),b=e=>f.get(e.pointer,e.json),v=(e,t)=>{const r=f.append(e,t.pointer);return m(`#${encodeURI(r)}`,t)},w=t((e,t)=>b(t).map((r,n)=>e(v(n,t),n))),g=t((e,t,r)=>b(r).reduce((t,n,s)=>e(t,v(s,r),s),t)),$=t((e,t)=>Object.keys(b(t)).every((r,n)=>e(v(r,t),n))),j=t((e,t)=>Object.keys(b(t)).some((r,n)=>e(v(r,t),n)));var O={cons:e=>Object.freeze({...y,json:e}),get:m,uri:e=>`#${encodeURI(e.pointer)}`,value:b,step:v,entries:e=>Object.keys(b(e)).map(t=>[t,v(t,e)]),map:w,reduce:g,every:$,some:j};const A={};var E={publish:(e,t)=>{e in A&&A[e](e,t)},subscribe:(e,t)=>{A[e]=t}},S=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;if(""===e)return I(t)?V(t):t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");if(-1===n)throw new Error("Error, protocol is not specified");t.protocol=r.substring(0,n),n+=2;const s=e.indexOf("/",n),i=e.indexOf("?"),o=e.indexOf("#");-1!==o&&(r=r.substring(0,o));if(-1!==i){const e=r.substring(i);t.query=e,r=r.substring(0,i)}if(-1!==s){const e=r.substring(0,s);t.host=e,r=r.substring(s),t.path=r}else t.host=r;return t}(e);if(""===t){const{host:e,path:t,query:n}=r;return t||n?e+t+n:V(e)}const n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(x.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:t.relativePath=!0;let r=e;const n=e.indexOf("?"),s=e.indexOf("#");if(-1!==s){const e=r.substring(s);t.hash=e,r=r.substring(0,s)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),I(n.href)?V(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:s}=n;return r.host+P(e)+t+s}if(n.relativePath){const{path:e,query:t,hash:s}=n;let i,o=r.path,a=r.host;return 0===e.length?i=o:(o=o.substring(0,o.lastIndexOf("/")),i=P(o+"/"+e)),a+=""!==i||t||s?i+t+s:"/",a}};function V(e){return e+("/"===e[e.length-1]?"":"/")}function P(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach((e,n)=>{"."!==e&&(".."===e?r.pop():""===e&&n!==t.length-1||r.push(e))}),"/"+r.join("/")}const x=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");function I(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),s=!e.includes("#",t);return r&&n&&s}var K=fetch;const{isObject:L,splitUrl:R}=d,U={},k=(e,t="",r="")=>{const n=R(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const s=R(t||e.$id||"")[0];if(!s)throw Error("Couldn't determine an identifier for the schema");const i={};U[s]={schemaVersion:n,schema:q(e,s,n,f.nil,i),anchors:i,recursiveAnchor:!!e.$recursiveAnchor}},q=(e,t,r,n,s)=>{if(L(e)){if("string"==typeof e.$id){const n=e.$id,s=z(t,n),[i,o]=R(s);if(delete e.$id,o&&(e.$anchor=o),i!==t)return k(e,z(t,i),r),{$__jref:n}}return"string"==typeof e.$anchor&&(s[e.$anchor]=n,delete e.$anchor),Object.entries(e).reduce((e,[i,o])=>(e[i]=q(o,t,r,f.append(i,n),s),e),{})}return Array.isArray(e)?e.map((e,i)=>q(e,t,r,f.append(i,n),s)):e},J=Object.freeze({id:"http://",schemaVersion:void 0,pointer:"",schema:void 0,recursiveAnchor:!1}),W=async(e,t=J,r=!1)=>{const n=r&&t.recursiveAnchor?t.recursiveAnchor:C(t),s=z(n,e),[i,o]=R(s);if(!(i in U)){const e=await K(i);k(await e.json(),i)}const a=o&&"/"!==o[0]?U[i].anchors[o]:o,c=Object.freeze({id:i,schemaVersion:U[i].schemaVersion,pointer:a,schema:U[i].schema,recursiveAnchor:t.recursiveAnchor||!!U[i].recursiveAnchor&&i}),u=D(c);return L(u)&&"$__jref"in u?W(u.$__jref,c,r):"string"==typeof u&&c.pointer.endsWith("/$ref")?W(u,c,r):"string"==typeof u&&c.pointer.endsWith("/$recursiveRef")?W(u,c,!0):c},z=(e,t)=>{const r=S(e,t);if("file"===_(r)&&"file"!==_(e))throw Error("Can't access file resource from network context");return r},_=e=>{const t=e.match(/(.+):\/\//)[1];return t?t[1]:""},C=e=>`${e.id}#${encodeURI(e.pointer)}`,D=e=>f.get(e.pointer,e.schema),B=(e,t)=>{const r=f.append(e,t.pointer);return W(`#${encodeURI(r)}`,t)},F=t((e,t)=>D(t).map(async(r,n)=>e(await B(n,t),n)));var T={add:k,get:W,uri:C,value:D,step:B,sibling:(e,t)=>{const r=t.pointer.split("/");r.pop();const n=f.append(e,r.join("/"));return W(`#${encodeURI(n)}`,t)},entries:e=>Object.keys(D(e)).map(t=>[t,B(t,e)]),map:F};const G="FLAG",M="BASIC",N="DETAILED",H="VERBOSE";let Q=N;const X=async(e,t,r)=>{const n={},s=await ce(e,n),i=(e,t=G)=>{let r=[];if(![G,M,N,H].includes(t))throw Error(`The '${t}' error format is not supported`);return E.subscribe("result",Y(t,r)),le(s,O.cons(e),n),r[0]};return void 0===t?i:i(t,r)},Y=(e,t)=>{const r=[];return(n,s)=>{for(s.errors=[];r.length>0&&Z(r[r.length-1],s);){const t=r.pop();let n=[];if(e===M&&(n=t.errors,delete t.errors),s.errors.unshift(t,...n),ee(s))break}(e===H||e!==G&&!s.valid)&&r.push(s),t[0]=s}},Z=(e,t)=>e.instanceLocation.startsWith(t.instanceLocation)&&(e.absoluteKeywordLocation.startsWith(t.absoluteKeywordLocation)||ee(e)),ee=e=>e.keyword.endsWith("#$ref")||e.keyword.endsWith("#$recursiveRef"),te={},re=e=>te[e],ne=e=>e in te,se=(e,t)=>{te[e]=t},ie={},oe={},ae={},ce=async(e,t)=>{if(!ae[e.id]){if(!ne(`${e.schemaVersion}#validate`))throw Error(`Unsupported schema version: ${e.schemaVersion}`);if(!await ue(e)){if(!(e.schemaVersion in oe)){const t=await T.get(e.schemaVersion),r=await ue(t);Object.entries(r||{}).forEach(([t,r])=>{if(t in ie)Object.entries(ie[t]).forEach(([t,r])=>{se(`${e.schemaVersion}#${t}`,r)});else if(r)throw Error(`Missing required vocabulary: ${t}`)}),oe[e.schemaVersion]=await X(t)}const t=T.value(e),r=oe[e.schemaVersion](t,Q);if(!r.valid)throw r}ae[e.id]=!0}return await re(`${e.schemaVersion}#validate`).compile(e,t),T.uri(e)},ue=async e=>{try{const t=await T.get("#/$vocabulary",e);return T.value(t)}catch(e){}},le=(e,t,r)=>{const[n]=r[e];return re(n).interpret(e,t,r)};var he={validate:X,setMetaOutputFormat:e=>{Q=e},FLAG:G,BASIC:M,DETAILED:N,VERBOSE:H,addKeyword:se,getKeyword:re,hasKeyword:ne,addVocabulary:(e,t)=>{ie[e]=t},compileSchema:ce,interpretSchema:le};var fe={compile:()=>{},interpret:()=>!0},de=async e=>Object.entries(await e),pe=t(async(e,t)=>(await t).map(e)),ye=t(async(e,t,r)=>(await r).reduce(async(t,r)=>e(await t,r),t)),me=t(async(e,t,r={})=>ye(async(t,r)=>await e(r)?t.concat([r]):t,[],t,r)),be=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).some(e=>e)}),ve=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).every(e=>e)}),we=t((e,t)=>e.reduce(async(e,t)=>t(await e),t)),ge={entries:de,map:pe,filter:me,reduce:ye,some:be,every:ve,pipeline:we,all:e=>Promise.all(e),allValues:e=>we([de,ye(async(e,[t,r])=>(e[t]=await r,e),{})],e)};var $e={compile:async(e,t)=>{const r=T.uri(e);if(!(r in t)){t[r]=!1;const n=T.value(e);t[r]=[`${e.schemaVersion}#validate`,T.uri(e),"boolean"==typeof n?n:await ge.pipeline([T.entries,ge.map(([t,r])=>[`${e.schemaVersion}#${t}`,r]),ge.filter(([e])=>he.hasKeyword(e)),ge.map(async([e,r])=>{const n=await r,s=await he.getKeyword(e).compile(n,t);return[e,T.uri(n),s]}),ge.all],e)]}},interpret:(e,t,r)=>{const[n,s,i]=r[e],o="boolean"==typeof i?i:i.every(([e,n,s])=>{const i=he.getKeyword(e).interpret(s,t,r);return E.publish("result",{keyword:e,absoluteKeywordLocation:n,instanceLocation:O.uri(t),valid:i}),i});return E.publish("result",{keyword:n,absoluteKeywordLocation:s,instanceLocation:O.uri(t),valid:o}),o}},je={JsonSchema:he,Schema:T,Json:O,PubSub:E,Keywords:{metaData:fe,validate:$e}};e("default",je);e("JsonSchema",je.JsonSchema),e("Schema",je.Schema),e("Json",je.Json),e("PubSub",je.PubSub),e("Keywords",je.Keywords)}}})); | ||
//# sourceMappingURL=json-schema-core-system.min.js.map |
@@ -255,3 +255,3 @@ (function (global, factory) { | ||
resultArray.pop(); // remove previous | ||
} else if (current !== '') { | ||
} else if (current !== '' || index === pathSplit.length - 1) { | ||
resultArray.push(current); | ||
@@ -721,3 +721,3 @@ } | ||
const compile$1 = (schema) => undefined; | ||
const compile$1 = () => undefined; | ||
const interpret = () => true; | ||
@@ -724,0 +724,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).JsonSchema={})}(this,(function(e){"use strict";var t=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.apply(this,n.concat([].slice.call(arguments)))}}};const r=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(u)},n=(e,t,r,i)=>{if(0===e.length)return r;if(e.length>1){const s=e.shift();return{...t,[s]:n(e,l(t,s,i),r,a(s,i))}}if(Array.isArray(t)){const n={...t};return n[e[0]]=r,n}return"object"==typeof t&&null!==t?{...t,[e[0]]:r}:l(t,e[0],i)},i=(e,t,r,n)=>{if(0!==e.length)if(1!==e.length||h(t)){const s=e.shift();i(e,l(t,s,n),r,a(s,n))}else{t[e[0]]=r}},s=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),i=l(t,n,r);return{...t,[n]:s(e,i,a(n,r))}}if(Array.isArray(t))return t.filter((t,r)=>r!=e[0]);if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return l(t,e[0],r)}},o=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),i=l(t,n,r);o(e,i,a(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:l(t,e[0],r)},a=t((e,t)=>t+"/"+c(e)),c=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),u=e=>e.toString().replace(/~0/g,"~").replace(/~1/g,"/"),l=(e,t,r="")=>{if(h(e))throw Error(`Value at '${r}' is a scalar and can't be indexed`);if(!(t in e))throw Error(`Value at '${r}' does not have index '${t}'`);return e[t]},h=e=>null===e||"object"!=typeof e;var f={nil:"",append:a,get:(e,t)=>{const n=r(e),i=e=>n.reduce(([e,t],r)=>[l(e,r,t),a(r,t)],[e,""])[0];return void 0===t?i:i(t)},set:(e,i,s)=>{const o=r(e),a=t((e,t)=>n(o,e,t,""));return void 0===i?a:a(i,s)},assign:(e,n,s)=>{const o=r(e),a=t((e,t)=>i(o,e,t,""));return void 0===n?a:a(n,s)},unset:(e,t)=>{const n=r(e),i=e=>s(n,e,"");return void 0===t?i:i(t)},delete:(e,t)=>{const n=r(e),i=e=>o(n,e,"");return void 0===t?i:i(t)}};var d={isObject:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,splitUrl:e=>{const[t,r=""]=e.split("#",2);return[decodeURI(t),decodeURI(r)]}};const{splitUrl:p}=d,y=Object.freeze({pointer:"",json:void 0}),m=(e,t=y)=>Object.freeze({...t,pointer:p(e)[1]}),b=e=>f.get(e.pointer,e.json),v=(e,t)=>{const r=f.append(e,t.pointer);return m(`#${encodeURI(r)}`,t)},w=t((e,t)=>b(t).map((r,n)=>e(v(n,t),n))),g=t((e,t,r)=>b(r).reduce((t,n,i)=>e(t,v(i,r),i),t)),$=t((e,t)=>Object.keys(b(t)).every((r,n)=>e(v(r,t),n))),j=t((e,t)=>Object.keys(b(t)).some((r,n)=>e(v(r,t),n)));var O={cons:e=>Object.freeze({...y,json:e}),get:m,uri:e=>`#${encodeURI(e.pointer)}`,value:b,step:v,entries:e=>Object.keys(b(e)).map(t=>[t,v(t,e)]),map:w,reduce:g,every:$,some:j};const A={};var E={publish:(e,t)=>{e in A&&A[e](e,t)},subscribe:(e,t)=>{A[e]=t}},V=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;if(""===e)return I(t)?S(t):t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");if(-1===n)throw new Error("Error, protocol is not specified");t.protocol=r.substring(0,n),n+=2;const i=e.indexOf("/",n),s=e.indexOf("?"),o=e.indexOf("#");-1!==o&&(r=r.substring(0,o));if(-1!==s){const e=r.substring(s);t.query=e,r=r.substring(0,s)}if(-1!==i){const e=r.substring(0,i);t.host=e,r=r.substring(i),t.path=r}else t.host=r;return t}(e);if(""===t){const{host:e,path:t,query:n}=r;return t||n?e+t+n:S(e)}const n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(x.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:t.relativePath=!0;let r=e;const n=e.indexOf("?"),i=e.indexOf("#");if(-1!==i){const e=r.substring(i);t.hash=e,r=r.substring(0,i)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),I(n.href)?S(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:i}=n;return r.host+P(e)+t+i}if(n.relativePath){const{path:e,query:t,hash:i}=n;let s,o=r.path,a=r.host;return 0===e.length?s=o:(o=o.substring(0,o.lastIndexOf("/")),s=P(o+"/"+e)),a+=""!==s||t||i?s+t+i:"/",a}};function S(e){return e+("/"===e[e.length-1]?"":"/")}function P(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach((e,t)=>{"."!==e&&(".."===e?r.pop():""!==e&&r.push(e))}),"/"+r.join("/")}const x=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");function I(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),i=!e.includes("#",t);return r&&n&&i}var K=fetch;const{isObject:L,splitUrl:R}=d,U={},k=(e,t="",r="")=>{const n=R(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const i=R(t||e.$id||"")[0];if(!i)throw Error("Couldn't determine an identifier for the schema");const s={};U[i]={schemaVersion:n,schema:q(e,i,n,f.nil,s),anchors:s,recursiveAnchor:!!e.$recursiveAnchor}},q=(e,t,r,n,i)=>{if(L(e)){if("string"==typeof e.$id){const n=e.$id,i=_(t,n),[s,o]=R(i);if(delete e.$id,o&&(e.$anchor=o),s!==t)return k(e,_(t,s),r),{$__jref:n}}return"string"==typeof e.$anchor&&(i[e.$anchor]=n,delete e.$anchor),Object.entries(e).reduce((e,[s,o])=>(e[s]=q(o,t,r,f.append(s,n),i),e),{})}return Array.isArray(e)?e.map((e,s)=>q(e,t,r,f.append(s,n),i)):e},J=Object.freeze({id:"http://",schemaVersion:void 0,pointer:"",schema:void 0,recursiveAnchor:!1}),W=async(e,t=J,r=!1)=>{const n=r&&t.recursiveAnchor?t.recursiveAnchor:C(t),i=_(n,e),[s,o]=R(i);if(!(s in U)){const e=await K(s);k(await e.json(),s)}const a=o&&"/"!==o[0]?U[s].anchors[o]:o,c=Object.freeze({id:s,schemaVersion:U[s].schemaVersion,pointer:a,schema:U[s].schema,recursiveAnchor:t.recursiveAnchor||!!U[s].recursiveAnchor&&s}),u=D(c);return L(u)&&"$__jref"in u?W(u.$__jref,c,r):"string"==typeof u&&c.pointer.endsWith("/$ref")?W(u,c,r):"string"==typeof u&&c.pointer.endsWith("/$recursiveRef")?W(u,c,!0):c},_=(e,t)=>{const r=V(e,t);if("file"===z(r)&&"file"!==z(e))throw Error("Can't access file resource from network context");return r},z=e=>{const t=e.match(/(.+):\/\//)[1];return t?t[1]:""},C=e=>`${e.id}#${encodeURI(e.pointer)}`,D=e=>f.get(e.pointer,e.schema),B=(e,t)=>{const r=f.append(e,t.pointer);return W(`#${encodeURI(r)}`,t)},F=t((e,t)=>D(t).map(async(r,n)=>e(await B(n,t),n)));var M={add:k,get:W,uri:C,value:D,step:B,sibling:(e,t)=>{const r=t.pointer.split("/");r.pop();const n=f.append(e,r.join("/"));return W(`#${encodeURI(n)}`,t)},entries:e=>Object.keys(D(e)).map(t=>[t,B(t,e)]),map:F};const T="FLAG",G="BASIC",N="DETAILED",H="VERBOSE";let Q=N;const X=async(e,t,r)=>{const n={},i=await ce(e,n),s=(e,t=T)=>{let r=[];if(![T,G,N,H].includes(t))throw Error(`The '${t}' error format is not supported`);return E.subscribe("result",Y(t,r)),le(i,O.cons(e),n),r[0]};return void 0===t?s:s(t,r)},Y=(e,t)=>{const r=[];return(n,i)=>{for(i.errors=[];r.length>0&&Z(r[r.length-1],i);){const t=r.pop();let n=[];if(e===G&&(n=t.errors,delete t.errors),i.errors.unshift(t,...n),ee(i))break}(e===H||e!==T&&!i.valid)&&r.push(i),t[0]=i}},Z=(e,t)=>e.instanceLocation.startsWith(t.instanceLocation)&&(e.absoluteKeywordLocation.startsWith(t.absoluteKeywordLocation)||ee(e)),ee=e=>e.keyword.endsWith("#$ref")||e.keyword.endsWith("#$recursiveRef"),te={},re=e=>te[e],ne=e=>e in te,ie=(e,t)=>{te[e]=t},se={},oe={},ae={},ce=async(e,t)=>{if(!ae[e.id]){if(!ne(`${e.schemaVersion}#validate`))throw Error(`Unsupported schema version: ${e.schemaVersion}`);if(!await ue(e)){if(!(e.schemaVersion in oe)){const t=await M.get(e.schemaVersion),r=await ue(t);Object.entries(r||{}).forEach(([t,r])=>{if(t in se)Object.entries(se[t]).forEach(([t,r])=>{ie(`${e.schemaVersion}#${t}`,r)});else if(r)throw Error(`Missing required vocabulary: ${t}`)}),oe[e.schemaVersion]=await X(t)}const t=M.value(e),r=oe[e.schemaVersion](t,Q);if(!r.valid)throw r}ae[e.id]=!0}return await re(`${e.schemaVersion}#validate`).compile(e,t),M.uri(e)},ue=async e=>{try{const t=await M.get("#/$vocabulary",e);return M.value(t)}catch(e){}},le=(e,t,r)=>{const[n]=r[e];return re(n).interpret(e,t,r)};var he={validate:X,setMetaOutputFormat:e=>{Q=e},FLAG:T,BASIC:G,DETAILED:N,VERBOSE:H,addKeyword:ie,getKeyword:re,hasKeyword:ne,addVocabulary:(e,t)=>{se[e]=t},compileSchema:ce,interpretSchema:le};var fe={compile:e=>{},interpret:()=>!0},de=async e=>Object.entries(await e),pe=t(async(e,t)=>(await t).map(e)),ye=t(async(e,t,r)=>(await r).reduce(async(t,r)=>e(await t,r),t)),me=t(async(e,t,r={})=>ye(async(t,r)=>await e(r)?t.concat([r]):t,[],t,r)),be=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).some(e=>e)}),ve=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).every(e=>e)}),we=t((e,t)=>e.reduce(async(e,t)=>t(await e),t)),ge={entries:de,map:pe,filter:me,reduce:ye,some:be,every:ve,pipeline:we,all:e=>Promise.all(e),allValues:e=>we([de,ye(async(e,[t,r])=>(e[t]=await r,e),{})],e)};var $e={compile:async(e,t)=>{const r=M.uri(e);if(!(r in t)){t[r]=!1;const n=M.value(e);t[r]=[`${e.schemaVersion}#validate`,M.uri(e),"boolean"==typeof n?n:await ge.pipeline([M.entries,ge.map(([t,r])=>[`${e.schemaVersion}#${t}`,r]),ge.filter(([e])=>he.hasKeyword(e)),ge.map(async([e,r])=>{const n=await r,i=await he.getKeyword(e).compile(n,t);return[e,M.uri(n),i]}),ge.all],e)]}},interpret:(e,t,r)=>{const[n,i,s]=r[e],o="boolean"==typeof s?s:s.every(([e,n,i])=>{const s=he.getKeyword(e).interpret(i,t,r);return E.publish("result",{keyword:e,absoluteKeywordLocation:n,instanceLocation:O.uri(t),valid:s}),s});return E.publish("result",{keyword:n,absoluteKeywordLocation:i,instanceLocation:O.uri(t),valid:o}),o}},je={JsonSchema:he,Schema:M,Json:O,PubSub:E,Keywords:{metaData:fe,validate:$e}},Oe=je.JsonSchema,Ae=je.Schema,Ee=je.Json,Ve=je.PubSub,Se=je.Keywords;e.Json=Ee,e.JsonSchema=Oe,e.Keywords=Se,e.PubSub=Ve,e.Schema=Ae,e.default=je,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).JsonSchema={})}(this,(function(e){"use strict";var t=function(e,t){return function r(){null==t&&(t=e.length);var n=[].slice.call(arguments);return n.length>=t?e.apply(this,n):function(){return r.apply(this,n.concat([].slice.call(arguments)))}}};const r=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(u)},n=(e,t,r,i)=>{if(0===e.length)return r;if(e.length>1){const s=e.shift();return{...t,[s]:n(e,l(t,s,i),r,a(s,i))}}if(Array.isArray(t)){const n={...t};return n[e[0]]=r,n}return"object"==typeof t&&null!==t?{...t,[e[0]]:r}:l(t,e[0],i)},i=(e,t,r,n)=>{if(0!==e.length)if(1!==e.length||h(t)){const s=e.shift();i(e,l(t,s,n),r,a(s,n))}else{t[e[0]]=r}},s=(e,t,r)=>{if(0!=e.length){if(e.length>1){const n=e.shift(),i=l(t,n,r);return{...t,[n]:s(e,i,a(n,r))}}if(Array.isArray(t))return t.filter((t,r)=>r!=e[0]);if("object"==typeof t&&null!==t){const{[e[0]]:r,...n}=t;return n}return l(t,e[0],r)}},o=(e,t,r)=>{if(0!==e.length)if(e.length>1){const n=e.shift(),i=l(t,n,r);o(e,i,a(n,r))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:l(t,e[0],r)},a=t((e,t)=>t+"/"+c(e)),c=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),u=e=>e.toString().replace(/~0/g,"~").replace(/~1/g,"/"),l=(e,t,r="")=>{if(h(e))throw Error(`Value at '${r}' is a scalar and can't be indexed`);if(!(t in e))throw Error(`Value at '${r}' does not have index '${t}'`);return e[t]},h=e=>null===e||"object"!=typeof e;var f={nil:"",append:a,get:(e,t)=>{const n=r(e),i=e=>n.reduce(([e,t],r)=>[l(e,r,t),a(r,t)],[e,""])[0];return void 0===t?i:i(t)},set:(e,i,s)=>{const o=r(e),a=t((e,t)=>n(o,e,t,""));return void 0===i?a:a(i,s)},assign:(e,n,s)=>{const o=r(e),a=t((e,t)=>i(o,e,t,""));return void 0===n?a:a(n,s)},unset:(e,t)=>{const n=r(e),i=e=>s(n,e,"");return void 0===t?i:i(t)},delete:(e,t)=>{const n=r(e),i=e=>o(n,e,"");return void 0===t?i:i(t)}};var d={isObject:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,splitUrl:e=>{const[t,r=""]=e.split("#",2);return[decodeURI(t),decodeURI(r)]}};const{splitUrl:p}=d,y=Object.freeze({pointer:"",json:void 0}),m=(e,t=y)=>Object.freeze({...t,pointer:p(e)[1]}),b=e=>f.get(e.pointer,e.json),v=(e,t)=>{const r=f.append(e,t.pointer);return m(`#${encodeURI(r)}`,t)},w=t((e,t)=>b(t).map((r,n)=>e(v(n,t),n))),g=t((e,t,r)=>b(r).reduce((t,n,i)=>e(t,v(i,r),i),t)),$=t((e,t)=>Object.keys(b(t)).every((r,n)=>e(v(r,t),n))),j=t((e,t)=>Object.keys(b(t)).some((r,n)=>e(v(r,t),n)));var O={cons:e=>Object.freeze({...y,json:e}),get:m,uri:e=>`#${encodeURI(e.pointer)}`,value:b,step:v,entries:e=>Object.keys(b(e)).map(t=>[t,v(t,e)]),map:w,reduce:g,every:$,some:j};const A={};var E={publish:(e,t)=>{e in A&&A[e](e,t)},subscribe:(e,t)=>{A[e]=t}},V=function(e,t){if(e=e.trim(),(t=t.trim()).startsWith("about:"))return t;if(""===e)return I(t)?S(t):t;const r=function(e){const t={host:"",path:"",query:"",protocol:""};let r=e,n=e.indexOf("//");if(-1===n)throw new Error("Error, protocol is not specified");t.protocol=r.substring(0,n),n+=2;const i=e.indexOf("/",n),s=e.indexOf("?"),o=e.indexOf("#");-1!==o&&(r=r.substring(0,o));if(-1!==s){const e=r.substring(s);t.query=e,r=r.substring(0,s)}if(-1!==i){const e=r.substring(0,i);t.host=e,r=r.substring(i),t.path=r}else t.host=r;return t}(e);if(""===t){const{host:e,path:t,query:n}=r;return t||n?e+t+n:S(e)}const n=function(e){const t={href:e,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(x.test(e))return t.netPath=!0,t;"/"===e[0]?t.absolutePath=!0:t.relativePath=!0;let r=e;const n=e.indexOf("?"),i=e.indexOf("#");if(-1!==i){const e=r.substring(i);t.hash=e,r=r.substring(0,i)}if(-1!==n){const e=r.substring(n);t.query=e,r=r.substring(0,n)}return t.path=r,t}(t);if(n.netPath)return n.href.startsWith("//")&&(n.href=r.protocol+n.href),I(n.href)?S(n.href):n.href;if(n.absolutePath){const{path:e,query:t,hash:i}=n;return r.host+P(e)+t+i}if(n.relativePath){const{path:e,query:t,hash:i}=n;let s,o=r.path,a=r.host;return 0===e.length?s=o:(o=o.substring(0,o.lastIndexOf("/")),s=P(o+"/"+e)),a+=""!==s||t||i?s+t+i:"/",a}};function S(e){return e+("/"===e[e.length-1]?"":"/")}function P(e){let t=e.split("/");""===t[0]&&(t=t.slice(1));let r=[];return t.forEach((e,n)=>{"."!==e&&(".."===e?r.pop():""===e&&n!==t.length-1||r.push(e))}),"/"+r.join("/")}const x=new RegExp("^([a-z][a-z0-9+.-]*:)?//","i");function I(e){const t=e.indexOf("//")+2,r=!e.includes("/",t),n=!e.includes("?",t),i=!e.includes("#",t);return r&&n&&i}var K=fetch;const{isObject:L,splitUrl:R}=d,U={},k=(e,t="",r="")=>{const n=R(e.$schema||r)[0];if(!n)throw Error("Couldn't determine schema version");delete e.$schema;const i=R(t||e.$id||"")[0];if(!i)throw Error("Couldn't determine an identifier for the schema");const s={};U[i]={schemaVersion:n,schema:q(e,i,n,f.nil,s),anchors:s,recursiveAnchor:!!e.$recursiveAnchor}},q=(e,t,r,n,i)=>{if(L(e)){if("string"==typeof e.$id){const n=e.$id,i=_(t,n),[s,o]=R(i);if(delete e.$id,o&&(e.$anchor=o),s!==t)return k(e,_(t,s),r),{$__jref:n}}return"string"==typeof e.$anchor&&(i[e.$anchor]=n,delete e.$anchor),Object.entries(e).reduce((e,[s,o])=>(e[s]=q(o,t,r,f.append(s,n),i),e),{})}return Array.isArray(e)?e.map((e,s)=>q(e,t,r,f.append(s,n),i)):e},J=Object.freeze({id:"http://",schemaVersion:void 0,pointer:"",schema:void 0,recursiveAnchor:!1}),W=async(e,t=J,r=!1)=>{const n=r&&t.recursiveAnchor?t.recursiveAnchor:C(t),i=_(n,e),[s,o]=R(i);if(!(s in U)){const e=await K(s);k(await e.json(),s)}const a=o&&"/"!==o[0]?U[s].anchors[o]:o,c=Object.freeze({id:s,schemaVersion:U[s].schemaVersion,pointer:a,schema:U[s].schema,recursiveAnchor:t.recursiveAnchor||!!U[s].recursiveAnchor&&s}),u=D(c);return L(u)&&"$__jref"in u?W(u.$__jref,c,r):"string"==typeof u&&c.pointer.endsWith("/$ref")?W(u,c,r):"string"==typeof u&&c.pointer.endsWith("/$recursiveRef")?W(u,c,!0):c},_=(e,t)=>{const r=V(e,t);if("file"===z(r)&&"file"!==z(e))throw Error("Can't access file resource from network context");return r},z=e=>{const t=e.match(/(.+):\/\//)[1];return t?t[1]:""},C=e=>`${e.id}#${encodeURI(e.pointer)}`,D=e=>f.get(e.pointer,e.schema),B=(e,t)=>{const r=f.append(e,t.pointer);return W(`#${encodeURI(r)}`,t)},F=t((e,t)=>D(t).map(async(r,n)=>e(await B(n,t),n)));var M={add:k,get:W,uri:C,value:D,step:B,sibling:(e,t)=>{const r=t.pointer.split("/");r.pop();const n=f.append(e,r.join("/"));return W(`#${encodeURI(n)}`,t)},entries:e=>Object.keys(D(e)).map(t=>[t,B(t,e)]),map:F};const T="FLAG",G="BASIC",N="DETAILED",H="VERBOSE";let Q=N;const X=async(e,t,r)=>{const n={},i=await ce(e,n),s=(e,t=T)=>{let r=[];if(![T,G,N,H].includes(t))throw Error(`The '${t}' error format is not supported`);return E.subscribe("result",Y(t,r)),le(i,O.cons(e),n),r[0]};return void 0===t?s:s(t,r)},Y=(e,t)=>{const r=[];return(n,i)=>{for(i.errors=[];r.length>0&&Z(r[r.length-1],i);){const t=r.pop();let n=[];if(e===G&&(n=t.errors,delete t.errors),i.errors.unshift(t,...n),ee(i))break}(e===H||e!==T&&!i.valid)&&r.push(i),t[0]=i}},Z=(e,t)=>e.instanceLocation.startsWith(t.instanceLocation)&&(e.absoluteKeywordLocation.startsWith(t.absoluteKeywordLocation)||ee(e)),ee=e=>e.keyword.endsWith("#$ref")||e.keyword.endsWith("#$recursiveRef"),te={},re=e=>te[e],ne=e=>e in te,ie=(e,t)=>{te[e]=t},se={},oe={},ae={},ce=async(e,t)=>{if(!ae[e.id]){if(!ne(`${e.schemaVersion}#validate`))throw Error(`Unsupported schema version: ${e.schemaVersion}`);if(!await ue(e)){if(!(e.schemaVersion in oe)){const t=await M.get(e.schemaVersion),r=await ue(t);Object.entries(r||{}).forEach(([t,r])=>{if(t in se)Object.entries(se[t]).forEach(([t,r])=>{ie(`${e.schemaVersion}#${t}`,r)});else if(r)throw Error(`Missing required vocabulary: ${t}`)}),oe[e.schemaVersion]=await X(t)}const t=M.value(e),r=oe[e.schemaVersion](t,Q);if(!r.valid)throw r}ae[e.id]=!0}return await re(`${e.schemaVersion}#validate`).compile(e,t),M.uri(e)},ue=async e=>{try{const t=await M.get("#/$vocabulary",e);return M.value(t)}catch(e){}},le=(e,t,r)=>{const[n]=r[e];return re(n).interpret(e,t,r)};var he={validate:X,setMetaOutputFormat:e=>{Q=e},FLAG:T,BASIC:G,DETAILED:N,VERBOSE:H,addKeyword:ie,getKeyword:re,hasKeyword:ne,addVocabulary:(e,t)=>{se[e]=t},compileSchema:ce,interpretSchema:le};var fe={compile:()=>{},interpret:()=>!0},de=async e=>Object.entries(await e),pe=t(async(e,t)=>(await t).map(e)),ye=t(async(e,t,r)=>(await r).reduce(async(t,r)=>e(await t,r),t)),me=t(async(e,t,r={})=>ye(async(t,r)=>await e(r)?t.concat([r]):t,[],t,r)),be=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).some(e=>e)}),ve=t(async(e,t)=>{const r=await pe(e,t);return(await Promise.all(r)).every(e=>e)}),we=t((e,t)=>e.reduce(async(e,t)=>t(await e),t)),ge={entries:de,map:pe,filter:me,reduce:ye,some:be,every:ve,pipeline:we,all:e=>Promise.all(e),allValues:e=>we([de,ye(async(e,[t,r])=>(e[t]=await r,e),{})],e)};var $e={compile:async(e,t)=>{const r=M.uri(e);if(!(r in t)){t[r]=!1;const n=M.value(e);t[r]=[`${e.schemaVersion}#validate`,M.uri(e),"boolean"==typeof n?n:await ge.pipeline([M.entries,ge.map(([t,r])=>[`${e.schemaVersion}#${t}`,r]),ge.filter(([e])=>he.hasKeyword(e)),ge.map(async([e,r])=>{const n=await r,i=await he.getKeyword(e).compile(n,t);return[e,M.uri(n),i]}),ge.all],e)]}},interpret:(e,t,r)=>{const[n,i,s]=r[e],o="boolean"==typeof s?s:s.every(([e,n,i])=>{const s=he.getKeyword(e).interpret(i,t,r);return E.publish("result",{keyword:e,absoluteKeywordLocation:n,instanceLocation:O.uri(t),valid:s}),s});return E.publish("result",{keyword:n,absoluteKeywordLocation:i,instanceLocation:O.uri(t),valid:o}),o}},je={JsonSchema:he,Schema:M,Json:O,PubSub:E,Keywords:{metaData:fe,validate:$e}},Oe=je.JsonSchema,Ae=je.Schema,Ee=je.Json,Ve=je.PubSub,Se=je.Keywords;e.Json=Ee,e.JsonSchema=Oe,e.Keywords=Se,e.PubSub=Ve,e.Schema=Ae,e.default=je,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=json-schema-core-umd.min.js.map |
@@ -1,7 +0,4 @@ | ||
const Schema = require("../schema"); | ||
const compile = (schema) => undefined; | ||
const compile = () => undefined; | ||
const interpret = () => true; | ||
module.exports = { compile, interpret }; |
@@ -1,2 +0,2 @@ | ||
const resolveUrl = require("url-resolve-browser"); | ||
const resolveUrl = require("./url-resolve-browser"); | ||
const curry = require("just-curry-it"); | ||
@@ -3,0 +3,0 @@ const JsonPointer = require("@hyperjump/json-pointer"); |
{ | ||
"name": "@hyperjump/json-schema-core", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A framework for building JSON Schema tools", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
879808
39
4910