api-smart-diff
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -1,2 +0,2 @@ | ||
/*! api-smart-diff@0.2.5 */ | ||
var ApiSmartDiff=function(a){var r={};function i(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return a[e].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=a,i.c=r,i.d=function(e,n,a){i.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:a})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(n,e){if(1&e&&(n=i(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var r in n)i.d(a,r,function(e){return n[e]}.bind(null,r));return a},i.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(n,"a",n),n},i.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},i.p="",i(i.s=4)}([function(e,a,n){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.breakingIfAfterTrue=a.breakingIf=a.allAnnotation=a.allUnclassified=a.addNonBreaking=a.onlyAddBreaking=a.allBreaking=a.allNonBreaking=a.unclassified=a.annotation=a.nonBreaking=a.breaking=void 0,a.breaking="breaking",a.nonBreaking="non-breaking",a.annotation="annotation",a.unclassified="unclassified",a.allNonBreaking=[a.nonBreaking,a.nonBreaking,a.nonBreaking],a.allBreaking=[a.breaking,a.breaking,a.breaking],a.onlyAddBreaking=[a.breaking,a.nonBreaking,a.nonBreaking],a.addNonBreaking=[a.nonBreaking,a.breaking,a.breaking],a.allUnclassified=[a.unclassified,a.unclassified,a.unclassified],a.allAnnotation=[a.annotation,a.annotation,a.annotation];a.breakingIf=e=>e?a.breaking:a.nonBreaking;a.breakingIfAfterTrue=(e,n)=>(0,a.breakingIf)(n)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findExternalRefs=t.buildPath=t.parsePath=t.typeOf=void 0;t.typeOf=e=>Array.isArray(e)?"array":null==typeof e?"null":typeof e,t.parsePath=e=>{var[,...e]=e.split("/").map(e=>e.replace(new RegExp("~1","g"),"/"));return e},t.buildPath=e=>"/"+e.map(e=>String(e).replace(new RegExp("/","g"),"~1")).join("/");t.findExternalRefs=e=>{if("object"!=typeof e)return[];let n=new Set;if("array"===(0,t.typeOf)(e))for(const r of e)"object"==typeof r&&(n=new Set([...n,...(0,t.findExternalRefs)(r)]));else for(const i of Object.keys(e)){var a;"$ref"===i?([a]=e[i].split("#"),a&&n.add(a)):"object"==typeof e[i]&&(n=new Set([...n,...(0,t.findExternalRefs)(e[i])]))}return[...n]}},function(e,n,a){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ActionType=void 0,(n=n.ActionType||(n.ActionType={})).add="add",n.remove="remove",n.replace="replace"},function(e,n,a){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.jsonSchemaRules=void 0;const r=a(0),i=[r.breaking,r.nonBreaking,(e,n)=>(0,r.breakingIf)(n<e)],t=[r.breaking,r.nonBreaking,(e,n)=>(0,r.breakingIf)(e<n)],o=[r.breakingIfAfterTrue,r.nonBreaking,r.breakingIfAfterTrue],s=[r.breakingIfAfterTrue,r.nonBreaking,r.breakingIfAfterTrue],l=[r.breaking,r.nonBreaking,(e,n)=>(0,r.breakingIf)(!!(e%n))];n.jsonSchemaRules=(e=r.allUnclassified)=>({"/":e,"/title":r.allAnnotation,"/multipleOf":l,"/maximum":i,"/exclusiveMaximum":o,"/minimum":t,"/exclusiveMinimum":o,"/maxLength":i,"/minLength":t,"/pattern":[r.breaking,r.nonBreaking,r.breaking],"/maxItems":i,"/minItems":t,"/uniqueItems":s,"/maxProperties":i,"/minProperties":t,"/required":{"/":r.onlyAddBreaking,"/*":[r.breaking,r.nonBreaking,r.breaking]},"/enum":{"/":[r.breaking,r.nonBreaking,r.breaking],"/*":[r.nonBreaking,r.breaking,r.breaking]},"/type":[r.breaking,r.nonBreaking,r.breaking],"/not":{"/":[r.breaking,r.nonBreaking,r.breaking],"/*":()=>(0,n.jsonSchemaRules)(r.allBreaking)},"/allOf":{"/":[r.breaking,r.nonBreaking,r.breaking],"/*":()=>(0,n.jsonSchemaRules)(r.allBreaking)},"/oneOf":{"/":[r.breaking,r.nonBreaking,r.breaking],"/*":()=>(0,n.jsonSchemaRules)(r.addNonBreaking)},"/anyOf":{"/":[r.breaking,r.nonBreaking,r.breaking],"/*":()=>(0,n.jsonSchemaRules)(r.addNonBreaking)},"/items":()=>(0,n.jsonSchemaRules)(r.addNonBreaking),"/properties":{"/":[r.breaking,r.nonBreaking,r.breaking],"/*":()=>(0,n.jsonSchemaRules)(r.addNonBreaking)},"/additionalProperties":()=>(0,n.jsonSchemaRules)([r.breaking,r.breaking,r.breakingIfAfterTrue]),"/description":r.allAnnotation,"/format":[r.breaking,r.nonBreaking,r.breaking],"/default":[r.nonBreaking,r.breaking,r.breaking],"/nullable":s,"/discriminator":{"/":r.allUnclassified,"/propertyName":r.allUnclassified,"/mapping":r.allUnclassified},"/readOnly":s,"/writeOnly":s,"/example":r.allAnnotation,"/externalDocs":r.allAnnotation,"/deprecated":s,"/xml":{"/":r.allUnclassified,"/name":r.allUnclassified,"/namespace":r.allUnclassified,"/prefix":r.allUnclassified,"/attribute":r.allUnclassified,"/wrapped":r.allUnclassified}})},function(e,n,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,n,a,r){void 0===r&&(r=a);var i=Object.getOwnPropertyDescriptor(n,a);i&&("get"in i?n.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return n[a]}}),Object.defineProperty(e,r,i)}:function(e,n,a,r){e[r=void 0===r?a:r]=n[a]}),i=this&&this.__exportStar||function(e,n){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(n,a)||r(n,e,a)},t=(Object.defineProperty(n,"__esModule",{value:!0}),n.findExternalRefs=n.apiMerge=n.apiDiff=void 0,a(5)),o=(Object.defineProperty(n,"apiDiff",{enumerable:!0,get:function(){return t.apiDiff}}),i(a(9),n),i(a(2),n),a(12)),s=(Object.defineProperty(n,"apiMerge",{enumerable:!0,get:function(){return o.apiMerge}}),a(1));Object.defineProperty(n,"findExternalRefs",{enumerable:!0,get:function(){return s.findExternalRefs}})},function(e,g,n){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.findEqualItemIndex=g.findDiff=g.apiDiff=void 0;const c=n(2),k=n(6),d=n(7),r=n(8),u=n(1);g.apiDiff=(e,n,a)=>(0,g.findDiff)(e,n,new r.DiffContext(e,n,a));g.findDiff=(e,n,a,r=[])=>{var i;if((0,u.typeOf)(e)!==(0,u.typeOf)(n))return i={path:r,before:e,after:n,action:c.ActionType.replace},[(0,d.classifyDiff)(i,a.rules)];switch((0,u.typeOf)(e)){case"object":return s(e,n,a,r);case"array":return l(e,n,a,r);default:"string"===(0,u.typeOf)(e)&&(e=o(e,a),n=o(n,a));var t={path:r,before:e,after:n,action:c.ActionType.replace};return e!==n?[(0,d.classifyDiff)(t,a.rules)]:[]}};const o=(e,n)=>(e=n.trimStrings?e.trim():e,e=n.caseSensitive?e:e.toLowerCase()),s=(e,n,a,r)=>{const i=[];var t,o="#"+(0,u.buildPath)(r);a.beforeRefs.add(o),a.afterRefs.add(o);const s=(0,k.dereference)(e,a.before,a.beforeRefs,a.beforeCache),l=(0,k.dereference)(n,a.after,a.afterRefs,a.afterCache);for(const f of new Set([...Object.keys(s),...Object.keys(l)]))if("symbol"!=typeof f)if(s.hasOwnProperty(f)?l.hasOwnProperty(f)?i.push(...(0,g.findDiff)(s[f],l[f],a,[...r,f])):(t={path:[...r,f],before:s[f],action:c.ActionType.remove},i.push((0,d.classifyDiff)(t,a.rules))):(t={path:[...r,f],after:l[f],action:c.ActionType.add},i.push((0,d.classifyDiff)(t,a.rules))),a.findFirstDiff&&i.length)break;return e.$ref&&a.beforeRefs.delete(e.$ref),n.$ref&&a.afterRefs.delete(n.$ref),a.beforeRefs.delete(o),a.afterRefs.delete(o),i};g.findEqualItemIndex=(n,a,r)=>{for(let e=0;e<a.length;e++){r.findFirstDiff=!0;var i=(0,g.findDiff)(n,a[e],r);if(r.findFirstDiff=!1,!i.length)return e}return-1};const l=(n,a,r,i)=>{const t=[],o=[...a];for(let e=0;e<n.length;e++){var s,l;if(r.strictArrays?e>=a.length?(s={path:[...i,e],before:n[e],action:c.ActionType.remove},t.push((0,d.classifyDiff)(s,r.rules))):t.push(...(0,g.findDiff)(n[e],a[e],r,[...i,e])):0<=(s=(0,g.findEqualItemIndex)(n[e],o,r))?o.splice(s,1):(l={path:[...i,e],before:n[e],action:c.ActionType.remove},t.push((0,d.classifyDiff)(l,r.rules))),r.findFirstDiff&&t.length)break}r.strictArrays&&o.splice(0,n.length);for(let e=0;e<o.length;e++){var f={path:[...i,n.length+e],after:o[e],action:c.ActionType.add};t.push((0,d.classifyDiff)(f,r.rules))}return t}},function(e,l,n){"use strict";var f=this&&this.__rest||function(e,n){var a={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(a[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(a[i[r]]=e[i[r]]);return a};Object.defineProperty(l,"__esModule",{value:!0}),l.dereference=l.resolveObjValue=void 0;const t=n(1);Symbol("circularRef"),l.resolveObjValue=(e,n,a={})=>{let r=e;a=new Map(Object.entries(a));for(const i of(0,t.parsePath)(n)){if(void 0===(r="array"===(0,t.typeOf)(r)?r[+i]:r[i]))break;r=(0,l.dereference)(r,e,new Set,a)}return r};l.dereference=(e,n,a,r)=>{if(e.hasOwnProperty("$ref")){const o=e["$ref"],s=f(e,["$ref"]);if(a.has(o))return e;var[i,t]=o.split("#");if(i){if(!r.has(i))return e;n=r.get(i)}e=Object.assign(Object.assign({},s),(0,l.resolveObjValue)(n,t,r)),a.add(o),r.set(o,e)}return e}},function(e,i,n){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.classifyDiff=i.findClassifier=void 0;const t=n(0);i.findClassifier=(e,n)=>{let a=e;for(var r of[...n,""]){if(a.hasOwnProperty("/"+r)&&"number"!=typeof r||(r="*"),!a.hasOwnProperty("/"+r))return t.allUnclassified;{const i=a["/"+r];if(Array.isArray(i))return i;a="function"==typeof i?i():i}}return t.allUnclassified};i.classifyDiff=(e,n={})=>{const a=e;const r=(0,i.findClassifier)(n,e.path)[["add","remove","replace"].indexOf(e.action)];return a.type="function"==typeof r?r(e.before,e.after):r,a}},function(e,r,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.MergeContext=r.DiffContext=r.DIFF_META_KEY=void 0;const a=n(9),i=n(4);r.DIFF_META_KEY="_diff";class t{constructor(e,n,a){this.before=e,this.after=n,this.beforeRefs=new Set,this.afterRefs=new Set,this.beforeCache=new Map,this.afterCache=new Map,this.findFirstDiff=!1,this.rules="string"==typeof a.rules?this.getBaseRules(a.rules):a.rules,this.trimStrings=a.trimStrings,this.caseSensitive=a.caseSensitive,this.strictArrays=a.strictArrays,this.circularRef=a.circularRef||!1,this.arrayMeta=a.arrayMeta||!1;var r=a.externalRefs||{};for(const i of Object.keys(r))this.beforeCache.set(i,r[i]),this.afterCache.set(i,r[i])}getBaseRules(e){switch(e){case"OpenApi3":return a.openapi3Rules;case"AsyncApi2":return a.asyncApi2Rules;case"JsonSchema":return(0,a.jsonSchemaRules)()}}}(class extends(r.DiffContext=t){});r.MergeContext=class extends t{constructor(e,n,a){super(e,n,a),this._formatMeta=e=>Object.assign({type:e.type,action:e.action},e.action===i.ActionType.replace?{replaced:e.before}:{}),this.formatMeta=a.formatMeta||(e=>this._formatMeta(e)),this.metaKey=a.metaKey||r.DIFF_META_KEY}}},function(e,n,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,n,a,r){void 0===r&&(r=a);var i=Object.getOwnPropertyDescriptor(n,a);i&&("get"in i?n.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return n[a]}}),Object.defineProperty(e,r,i)}:function(e,n,a,r){e[r=void 0===r?a:r]=n[a]}),i=this&&this.__exportStar||function(e,n){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(n,a)||r(n,e,a)};Object.defineProperty(n,"__esModule",{value:!0}),i(a(10),n),i(a(11),n),i(a(3),n),i(a(0),n)},function(e,n,a){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.asyncApi2Rules=n.messageRules=n.messageTraitsRules=void 0;const r=a(3);var a=a(0),i={"/":a.addNonBreaking,"/location":a.addNonBreaking,"/description":a.allAnnotation},t={"/summary":a.allAnnotation,"/tags":a.allAnnotation,"/externalDocs":a.allAnnotation,"/bindings":a.allUnclassified},o=Object.assign({"/":a.addNonBreaking,"/*":a.addNonBreaking,"/operationId":a.addNonBreaking,"/description":a.allAnnotation},t),i=(n.messageTraitsRules=Object.assign({"/":a.addNonBreaking,"/*":a.addNonBreaking,"/headers":a.allUnclassified,"/correlationId":i,"/schemaFormat":a.allBreaking,"/contentType":a.addNonBreaking,"/name":a.allNonBreaking,"/title":a.allNonBreaking,"/examples":a.allAnnotation},t),n.messageRules=Object.assign({"/":a.allBreaking,"/headers":a.allUnclassified,"/correlationId":i,"/schemaFormat":a.allBreaking,"/contentType":a.addNonBreaking,"/name":a.allNonBreaking,"/title":a.allNonBreaking,"/description":a.allNonBreaking,"/examples":a.allAnnotation,"/traits":n.messageTraitsRules,"/payload":(0,r.jsonSchemaRules)(a.allBreaking)},t),Object.assign({"/":a.addNonBreaking,"/operationId":a.addNonBreaking,"/description":a.allAnnotation,"/traits":o,"/message":n.messageRules},t)),o={"/":a.addNonBreaking,"/version":a.addNonBreaking,"/termsOfService":a.addNonBreaking,"/license":{"/":a.addNonBreaking,"/name":a.allBreaking,"/url":a.onlyAddBreaking},"/title":a.allAnnotation,"/description":a.allAnnotation,"/contact":{"/":a.allAnnotation,"/name":a.allAnnotation,"/url":a.allAnnotation,"/email":a.allAnnotation}},t={"/":a.addNonBreaking,"/*":{"/":a.addNonBreaking,"/url":a.addNonBreaking,"/description":a.allAnnotation,"/protocol":a.allBreaking,"/protocolVersion":a.allBreaking,"/variables":{"/":a.addNonBreaking,"/*":{"/":a.addNonBreaking,"/enum":{"/":a.addNonBreaking,"/*":a.addNonBreaking},"/default":a.allBreaking,"/description":a.allAnnotation,"/examples":a.allAnnotation}},"/security":{"/":a.allBreaking,"/*":a.allBreaking},"/bindings":a.allUnclassified}},i={"/":a.addNonBreaking,"/description":a.allNonBreaking,"/bindings":a.allUnclassified,"/subscribe":i,"/publish":i,"/parameters":{"/":a.allBreaking,"/*":{"/":a.addNonBreaking,"/description":a.allNonBreaking,"/schema":(0,r.jsonSchemaRules)(a.allBreaking),"/location":a.allBreaking}}};n.asyncApi2Rules={"/asyncapi":a.addNonBreaking,"/id":a.allAnnotation,"/defaultContentType":a.allBreaking,"/info":o,"/servers":t,"/channels":{"/":a.addNonBreaking,"/*":i},"/components":a.allNonBreaking,"/tags":a.allAnnotation,"/externalDocs":a.allAnnotation}},function(e,n,a){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.openapi3Rules=void 0;const r=a(3),i=a(0);var a={"/":[i.nonBreaking,i.breaking,i.breaking],"/*":{"/":[i.nonBreaking,i.breaking,i.breaking],"/url":[i.nonBreaking,i.breaking,i.breaking],"/description":i.allAnnotation,"/variables":{"/":[i.nonBreaking,i.breaking,i.breaking],"/*":{"/":[i.nonBreaking,i.breaking,i.breaking],"/enum":{"/":[i.nonBreaking,i.breaking,i.breaking],"/*":[i.nonBreaking,i.breaking,i.breaking]},"/default":[i.breaking,i.breaking,i.breaking],"/description":i.allAnnotation}}}},t={"/":[i.nonBreaking,i.breaking,i.breaking],"/*":{"/":[i.nonBreaking,i.breaking,i.breaking],"/name":[i.nonBreaking,i.breaking,i.breaking],"/in":[i.nonBreaking,i.breaking,i.breaking],"/description":i.allAnnotation,"/required":[i.breaking,i.nonBreaking,i.breakingIfAfterTrue],"/deprecated":[i.breaking,i.nonBreaking,i.breakingIfAfterTrue]}},o={"/":[i.nonBreaking,i.breaking,i.breaking],"/*":{"/":[i.nonBreaking,i.breaking,i.breaking],"/description":i.allAnnotation,"/required":[i.breaking,i.nonBreaking,i.breakingIfAfterTrue],"/deprecated":[i.breaking,i.nonBreaking,i.breakingIfAfterTrue]}},s={"/":[i.nonBreaking,i.nonBreaking,i.nonBreaking],"/*":{"/contentType":[i.nonBreaking,i.breaking,i.breaking],"/headers":o,"/style":[i.nonBreaking,i.breaking,i.breaking],"/explode":[i.nonBreaking,i.breaking,i.breaking],"/allowReserved":[i.nonBreaking,i.breaking,i.breaking]}},s={"/":[i.nonBreaking,i.breaking,i.breaking],"/*":{"/":[i.nonBreaking,i.breaking,i.breaking],"/schema":(0,r.jsonSchemaRules)(i.allBreaking),"/example":i.allAnnotation,"/examples":i.allAnnotation,"/encoding":s}},l={"/":[i.nonBreaking,i.breaking,i.breaking],"/*":{"/":[i.nonBreaking,i.breaking,i.breaking],"/description":i.allAnnotation,"/content":s,"/required":[i.breaking,i.nonBreaking,(e,n)=>n?i.breaking:i.nonBreaking]}},s={"/":[i.nonBreaking,i.breaking,i.breaking],"/*":{"/":[i.nonBreaking,i.breaking,i.breaking],"/description":i.allAnnotation,"/headers":o,"/content":s}},f={"/":[i.breaking,i.nonBreaking,i.unclassified],"/*":[i.breaking,i.nonBreaking,i.unclassified]},g={"/":[i.nonBreaking,i.breaking,i.breaking],"/tags":i.allAnnotation,"/summary":i.allAnnotation,"/description":i.allAnnotation,"/externalDocs":i.allAnnotation,"/operationId":[i.nonBreaking,i.breaking,i.breaking],"/parameters":t,"/requestBody":l,"/responses":s,"/deprecated":[i.breaking,i.nonBreaking,i.breakingIfAfterTrue],"/security":f,"/servers":a};n.openapi3Rules={"/openapi":[i.nonBreaking,i.breaking,i.breaking],"/info":{"/":[i.nonBreaking,i.breaking,i.breaking],"/title":i.allAnnotation,"/description":i.allAnnotation,"/termsOfService":i.allAnnotation,"/contact":i.allAnnotation,"/licence":{"/":[i.nonBreaking,i.breaking,i.breaking],"/name":[i.breaking,i.breaking,i.breaking],"/url":[i.breaking,i.nonBreaking,i.nonBreaking]},"/version":i.allAnnotation},"/servers":a,"/paths":{"/":[i.nonBreaking,i.breaking,i.breaking],"/*":{"/":[i.nonBreaking,i.breaking,i.breaking],"/summary":i.allAnnotation,"/description":i.allAnnotation,"/*":g,"/servers":a,"/parameters":t}},"/components":{"/":[i.nonBreaking,i.nonBreaking,i.nonBreaking],"/schemas":{"/":[i.nonBreaking,i.breaking,i.breaking],"/*":(0,r.jsonSchemaRules)(i.addNonBreaking)},"/responses":{"/":[i.nonBreaking,i.breaking,i.breaking],"/*":s},"/parameters":{"/":[i.nonBreaking,i.breaking,i.breaking],"/*":t},"/examples":i.allAnnotation,"/requestBodies":{"/":[i.nonBreaking,i.breaking,i.breaking],"/*":l},"/headers":o,"/securitySchemes":{"/":[i.breaking,i.nonBreaking,i.breaking],"/*":{"/":[i.breaking,i.nonBreaking,i.breaking],"/type":[i.breaking,i.nonBreaking,i.breaking],"/description":i.allAnnotation,"/name":[i.breaking,i.nonBreaking,i.breaking],"/in":[i.breaking,i.nonBreaking,i.breaking],"/scheme":[i.breaking,i.nonBreaking,i.breaking],"/bearerFormat":i.allAnnotation,"/flows":[i.breaking,i.nonBreaking,i.breaking],"/openIdConnectUrl":i.allAnnotation}}},"/security":f,"/tags":i.allAnnotation,"/externalDocs":i.allAnnotation}},function(e,n,a){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.apiMerge=void 0;const r=a(8),c=a(6),k=a(7),d=a(5),o=a(1),u=a(2);n.apiMerge=(e,n,a)=>{var[e]=b(e,n,new r.MergeContext(e,n,a),[]);return e};const b=(e,n,a,r=[])=>{var i,t;if((0,o.typeOf)(e)!==(0,o.typeOf)(n))return i={path:r,before:e,after:n,action:u.ActionType.replace},[n,a.formatMeta((0,k.classifyDiff)(i,a.rules))];switch((0,o.typeOf)(e)){case"object":return l(e,n,a,r);case"array":return f(e,n,a,r);default:if("string"==typeof e&&(e=s(e,a),n=s(n,a)),e!==n)return t={path:r,before:e,after:n,action:u.ActionType.replace},[n,a.formatMeta((0,k.classifyDiff)(t,a.rules))]}return[n]},s=(e,n)=>(e=n.trimStrings?e.trim():e,e=n.caseSensitive?e:e.toLowerCase()),l=(e,n,a,r)=>{const i={},t={},o=(0,c.dereference)(e,a.before,a.beforeRefs,a.beforeCache),s=(0,c.dereference)(n,a.after,a.afterRefs,a.afterCache);var l,f;for(const g of new Set([...Object.keys(o),...Object.keys(s)]))"symbol"!=typeof g&&(o.hasOwnProperty(g)?s.hasOwnProperty(g)?([l,f]=b(o[g],s[g],a,[...r,g]),i[g]=l,f&&(t[g]=f)):(l={path:[...r,g],before:o[g],action:u.ActionType.remove},i[g]=o[g],t[g]=a.formatMeta((0,k.classifyDiff)(l,a.rules))):(f={path:[...r,g],after:s[g],action:u.ActionType.add},i[g]=s[g],t[g]=a.formatMeta((0,k.classifyDiff)(f,a.rules))));return e.$ref&&a.beforeRefs.delete(e.$ref),n.$ref&&a.afterRefs.delete(n.$ref),Object.keys(t).length&&(i[a.metaKey]=t),[i]},f=(a,n,r,i)=>{var t,o,s,e={array:{}};const l=e.array,f=[],g=[...n];for(let e=0;e<a.length;e++)r.strictArrays?e>=n.length?(t={path:[...i,e],before:a[e],action:u.ActionType.remove},f[e]=a[e],l[e]=r.formatMeta((0,k.classifyDiff)(t,r.rules))):([t,o]=b(a[e],n[e],r,[...i,e]),f[e]=t,o&&(l[e]=o)):(o=(0,d.findEqualItemIndex)(a[e],g,r),f[e]=a[e],0<=o?g.splice(o,1):(s={path:[...i,e],before:a[e],action:u.ActionType.remove},l[e]=r.formatMeta((0,k.classifyDiff)(s,r.rules))));r.strictArrays&&g.splice(0,a.length);for(let e=a.length,n=0;e<a.length+g.length;e++,n++){f[e]=g[n];var c={path:[...i,e],after:g[n],action:u.ActionType.add};l[e]=r.formatMeta((0,k.classifyDiff)(c,r.rules))}return r.arrayMeta&&Object.keys(e.array).length&&(f[r.metaKey]=e.array),r.arrayMeta||!Object.keys(e.array).length?[f]:[f,e]}}]); | ||
/*! api-smart-diff@0.2.6 */ | ||
var ApiSmartDiff=function(r){var n={};function a(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,a),t.l=!0,t.exports}return a.m=r,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)a.d(r,n,function(e){return t[e]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=0)}([function(_,e,t){"use strict";t.r(e),t.d(e,"messageTraitsRules",function(){return R}),t.d(e,"messageRules",function(){return M}),t.d(e,"asyncApi2Rules",function(){return k}),t.d(e,"openapi3Rules",function(){return C}),t.d(e,"jsonSchemaRules",function(){return x}),t.d(e,"DIFF_META_KEY",function(){return n}),t.d(e,"DiffAction",function(){return p}),t.d(e,"ClassifierType",function(){return r}),t.d(e,"breaking",function(){return a}),t.d(e,"nonBreaking",function(){return s}),t.d(e,"unclassified",function(){return i}),t.d(e,"annotation",function(){return o}),t.d(e,"allNonBreaking",function(){return c}),t.d(e,"allBreaking",function(){return f}),t.d(e,"onlyAddBreaking",function(){return u}),t.d(e,"addNonBreaking",function(){return l}),t.d(e,"allUnclassified",function(){return d}),t.d(e,"allAnnotation",function(){return m}),t.d(e,"apiDiff",function(){return J}),t.d(e,"apiMerge",function(){return H}),t.d(e,"findExternalRefs",function(){return g});const n="$diff";var p,r;(t=p=p||{}).add="add",t.remove="remove",t.replace="replace",(e=r=r||{}).breaking="breaking",e.nonBreaking="non-breaking",e.annotation="annotation",e.unclassified="unclassified";const{breaking:a,nonBreaking:s,unclassified:i,annotation:o}=r,c=[s,s,s],f=[a,a,a],u=[a,s,s],l=[s,a,a],d=[i,i,i],m=[o,o,o],y=e=>e?a:s,h=(e,t)=>y(t),b=e=>Array.isArray(e)?"array":null==typeof e?"null":typeof e,g=e=>{if("object"!=typeof e)return[];let t=new Set;if("array"===b(e))for(const n of e)"object"==typeof n&&(t=new Set([...t,...g(n)]));else for(const a of Object.keys(e)){var r;"$ref"===a?([r]=e[a].split("#"),r&&t.add(r)):"object"==typeof e[a]&&(t=new Set([...t,...g(e[a])]))}return[...t]},v=[a,s,(e,t)=>y(t<e)],O=[a,s,(e,t)=>y(e<t)],j=[h,s,h],w=[h,s,h],T=[a,s,(e,t)=>!(e%t)?s:a],x=(e=d)=>({"/":e,"/title":m,"/multipleOf":T,"/maximum":v,"/exclusiveMaximum":j,"/minimum":O,"/exclusiveMinimum":j,"/maxLength":v,"/minLength":O,"/pattern":[a,s,a],"/maxItems":v,"/minItems":O,"/uniqueItems":w,"/maxProperties":v,"/minProperties":O,"/required":{"/":u,"/*":[a,s,a]},"/enum":{"/":[a,s,a],"/*":[s,a,a]},"/type":[a,s,a],"/not":{"/":[a,s,a],"/*":()=>x(f)},"/allOf":{"/":[a,s,a],"/*":()=>x(f)},"/oneOf":{"/":[a,s,a],"/*":()=>x(l)},"/anyOf":{"/":[a,s,a],"/*":()=>x(l)},"/items":()=>x(l),"/properties":{"/":[a,s,a],"/*":()=>x(l)},"/additionalProperties":()=>x([a,a,h]),"/description":m,"/format":[a,s,a],"/default":[s,a,a],"/nullable":w,"/discriminator":{"/":d,"/propertyName":d,"/mapping":d},"/readOnly":w,"/writeOnly":w,"/example":m,"/externalDocs":m,"/deprecated":w,"/xml":{"/":d,"/name":d,"/namespace":d,"/prefix":d,"/attribute":d,"/wrapped":d}});var t={"/":l,"/location":l,"/description":m},e={"/summary":m,"/tags":m,"/externalDocs":m,"/bindings":d},S=Object.assign({"/":l,"/*":l,"/operationId":l,"/description":m},e);const R=Object.assign({"/":l,"/*":l,"/headers":d,"/correlationId":t,"/schemaFormat":f,"/contentType":l,"/name":c,"/title":c,"/examples":m},e),M=Object.assign({"/":f,"/headers":d,"/correlationId":t,"/schemaFormat":f,"/contentType":l,"/name":c,"/title":c,"/description":c,"/examples":m,"/traits":R,"/payload":x(f)},e);t=Object.assign({"/":l,"/operationId":l,"/description":m,"/traits":S,"/message":M},e),S={"/":l,"/version":l,"/termsOfService":l,"/license":{"/":l,"/name":f,"/url":u},"/title":m,"/description":m,"/contact":{"/":m,"/name":m,"/url":m,"/email":m}},e={"/":l,"/*":{"/":l,"/url":l,"/description":m,"/protocol":f,"/protocolVersion":f,"/variables":{"/":l,"/*":{"/":l,"/enum":{"/":l,"/*":l},"/default":f,"/description":m,"/examples":m}},"/security":{"/":f,"/*":f},"/bindings":d}},t={"/":l,"/description":c,"/bindings":d,"/subscribe":t,"/publish":t,"/parameters":{"/":f,"/*":{"/":l,"/description":c,"/schema":x(f),"/location":f}}};const k={"/asyncapi":l,"/id":m,"/defaultContentType":f,"/info":S,"/servers":e,"/channels":{"/":l,"/*":t},"/components":c,"/tags":m,"/externalDocs":m};var S={"/":[s,a,a],"/*":{"/":[s,a,a],"/url":[s,a,a],"/description":m,"/variables":{"/":[s,a,a],"/*":{"/":[s,a,a],"/enum":{"/":[s,a,a],"/*":[s,a,a]},"/default":[a,a,a],"/description":m}}}},e={"/":[s,a,a],"/*":{"/":[s,a,a],"/name":[s,a,a],"/in":[s,a,a],"/description":m,"/required":[a,s,h],"/deprecated":[a,s,h]}},t={"/":[s,a,a],"/*":{"/":[s,a,a],"/description":m,"/required":[a,s,h],"/deprecated":[a,s,h]}},A={"/":[s,s,s],"/*":{"/contentType":[s,a,a],"/headers":t,"/style":[s,a,a],"/explode":[s,a,a],"/allowReserved":[s,a,a]}},A={"/":[s,a,a],"/*":{"/":[s,a,a],"/schema":x(f),"/example":m,"/examples":m,"/encoding":A}},P={"/":[s,a,a],"/*":{"/":[s,a,a],"/description":m,"/content":A,"/required":[a,s,(e,t)=>t?a:s]}},A={"/":[s,a,a],"/*":{"/":[s,a,a],"/description":m,"/headers":t,"/content":A}},D={"/":[a,s,i],"/*":[a,s,i]},q={"/":[s,a,a],"/tags":m,"/summary":m,"/description":m,"/externalDocs":m,"/operationId":[s,a,a],"/parameters":e,"/requestBody":P,"/responses":A,"/deprecated":[a,s,h],"/security":D,"/servers":S};const C={"/openapi":[s,a,a],"/info":{"/":[s,a,a],"/title":m,"/description":m,"/termsOfService":m,"/contact":m,"/licence":{"/":[s,a,a],"/name":[a,a,a],"/url":[a,s,s]},"/version":m},"/servers":S,"/paths":{"/":[s,a,a],"/*":{"/":[s,a,a],"/summary":m,"/description":m,"/*":q,"/servers":S,"/parameters":e}},"/components":{"/":[s,s,s],"/schemas":{"/":[s,a,a],"/*":x(l)},"/responses":{"/":[s,a,a],"/*":A},"/parameters":{"/":[s,a,a],"/*":e},"/examples":m,"/requestBodies":{"/":[s,a,a],"/*":P},"/headers":t,"/securitySchemes":{"/":[a,s,a],"/*":{"/":[a,s,a],"/type":[a,s,a],"/description":m,"/name":[a,s,a],"/in":[a,s,a],"/scheme":[a,s,a],"/bearerFormat":m,"/flows":[a,s,a],"/openIdConnectUrl":m}}},"/security":D,"/tags":m,"/externalDocs":m};var E=function(e,t){var r={};for(a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]]);return r};const K=(e,t,r={})=>{let n=e;r=new Map(Object.entries(r));for(const a of(e=>{var[,...e]=e.split("/").map(e=>e.replace(new RegExp("~1","g"),"/"));return e})(t)){if(void 0===(n="array"===b(n)?n[+a]:n[a]))break;n=$(n,e,new Set,r)}return n},$=(e,t,r,n)=>{if(e.hasOwnProperty("$ref")){const i=e["$ref"],o=E(e,["$ref"]);if(r.has(i))return e;var[a,s]=i.split("#");if(a){if(!n.has(a))return e;t=n.get(a)}e=Object.assign(Object.assign({},o),K(t,s,n)),r.add(i),n.set(i,e)}return e},L=(e,t)=>{let r=e;for(var n of[...t,""]){if(r.hasOwnProperty("/"+n)&&"number"!=typeof n||(n="*"),!r.hasOwnProperty("/"+n))return d;{const a=r["/"+n];if(Array.isArray(a))return a;r="function"==typeof a?a():a}}return d},B=(e,t={})=>{const r=e;const n=L(t,e.path)[["add","remove","replace"].indexOf(e.action)];return r.type="function"==typeof n?n(e.before,e.after):n,r};class N{constructor(e,t,r){this.before=e,this.after=t,this.beforeRefs=new Set,this.afterRefs=new Set,this.beforeCache=new Map,this.afterCache=new Map,this.findFirstDiff=!1,this.rules="string"==typeof r.rules?this.getBaseRules(r.rules):r.rules,this.trimStrings=r.trimStrings,this.caseSensitive=r.caseSensitive,this.strictArrays=r.strictArrays,this.circularRef=r.circularRef||!1,this.arrayMeta=r.arrayMeta||!1;var n=r.externalRefs||{};for(const a of Object.keys(n))this.beforeCache.set(a,n[a]),this.afterCache.set(a,n[a])}getBaseRules(e){switch(e){case"OpenApi3":return C;case"AsyncApi2":return k;case"JsonSchema":return x()}}}class U extends N{constructor(e,t,r){super(e,t,r),this._formatMeta=e=>Object.assign({type:e.type,action:e.action},e.action===p.replace?{replaced:e.before}:{}),this.formatMeta=r.formatMeta||(e=>this._formatMeta(e)),this.metaKey=r.metaKey||n}}const J=(e,t,r)=>I(e,t,new N(e,t,r)),I=(e,t,r,n=[])=>{var a;if(b(e)!==b(t))return a={path:n,before:e,after:t,action:p.replace},[B(a,r.rules)];switch(b(e)){case"object":return Y(e,t,r,n);case"array":return G(e,t,r,n);default:"string"===b(e)&&(e=V(e,r),t=V(t,r));var s={path:n,before:e,after:t,action:p.replace};return e!==t?[B(s,r.rules)]:[]}},V=(e,t)=>(e=t.trimStrings?e.trim():e,e=t.caseSensitive?e:e.toLowerCase()),Y=(e,t,r,n)=>{const a=[];var s,i="#"+("/"+n.map(e=>String(e).replace(new RegExp("/","g"),"~1")).join("/"));r.beforeRefs.add(i),r.afterRefs.add(i);const o=$(e,r.before,r.beforeRefs,r.beforeCache),c=$(t,r.after,r.afterRefs,r.afterCache);for(const f of new Set([...Object.keys(o),...Object.keys(c)]))if("symbol"!=typeof f)if(o.hasOwnProperty(f)?c.hasOwnProperty(f)?a.push(...I(o[f],c[f],r,[...n,f])):(s={path:[...n,f],before:o[f],action:p.remove},a.push(B(s,r.rules))):(s={path:[...n,f],after:c[f],action:p.add},a.push(B(s,r.rules))),r.findFirstDiff&&a.length)break;return e.$ref&&r.beforeRefs.delete(e.$ref),t.$ref&&r.afterRefs.delete(t.$ref),r.beforeRefs.delete(i),r.afterRefs.delete(i),a},z=(t,r,n)=>{for(let e=0;e<r.length;e++){n.findFirstDiff=!0;var a=I(t,r[e],n);if(n.findFirstDiff=!1,!a.length)return e}return-1},G=(t,r,n,a)=>{const s=[],i=[...r];for(let e=0;e<t.length;e++){var o,c;if(n.strictArrays?e>=r.length?(o={path:[...a,e],before:t[e],action:p.remove},s.push(B(o,n.rules))):s.push(...I(t[e],r[e],n,[...a,e])):0<=(o=z(t[e],i,n))?i.splice(o,1):(c={path:[...a,e],before:t[e],action:p.remove},s.push(B(c,n.rules))),n.findFirstDiff&&s.length)break}n.strictArrays&&i.splice(0,t.length);for(let e=0;e<i.length;e++){var f={path:[...a,t.length+e],after:i[e],action:p.add};s.push(B(f,n.rules))}return s},H=(e,t,r)=>{var[e]=F(e,t,new U(e,t,r),[]);return e},F=(e,t,r,n=[])=>{var a,s;if(b(e)!==b(t))return a={path:n,before:e,after:t,action:p.replace},[t,r.formatMeta(B(a,r.rules))];switch(b(e)){case"object":return W(e,t,r,n);case"array":return X(e,t,r,n);default:if("string"==typeof e&&(e=Q(e,r),t=Q(t,r)),e!==t)return s={path:n,before:e,after:t,action:p.replace},[t,r.formatMeta(B(s,r.rules))]}return[t]},Q=(e,t)=>(e=t.trimStrings?e.trim():e,e=t.caseSensitive?e:e.toLowerCase()),W=(e,t,r,n)=>{const a={},s={},i=$(e,r.before,r.beforeRefs,r.beforeCache),o=$(t,r.after,r.afterRefs,r.afterCache);var c,f;for(const u of new Set([...Object.keys(i),...Object.keys(o)]))"symbol"!=typeof u&&(i.hasOwnProperty(u)?o.hasOwnProperty(u)?([c,f]=F(i[u],o[u],r,[...n,u]),a[u]=c,f&&(s[u]=f)):(c={path:[...n,u],before:i[u],action:p.remove},a[u]=i[u],s[u]=r.formatMeta(B(c,r.rules))):(f={path:[...n,u],after:o[u],action:p.add},a[u]=o[u],s[u]=r.formatMeta(B(f,r.rules))));return e.$ref&&r.beforeRefs.delete(e.$ref),t.$ref&&r.afterRefs.delete(t.$ref),Object.keys(s).length&&(a[r.metaKey]=s),[a]},X=(r,t,n,a)=>{const s={},i=[],o=[...t];for(let e=0;e<r.length;e++){var c,f,u;n.strictArrays?e>=t.length?(c={path:[...a,e],before:r[e],action:p.remove},i[e]=r[e],s[e]=n.formatMeta(B(c,n.rules))):([c,f]=F(r[e],t[e],n,[...a,e]),i[e]=c,f&&(s[e]=f)):(f=z(r[e],o,n),i[e]=r[e],0<=f?o.splice(f,1):(u={path:[...a,e],before:r[e],action:p.remove},s[e]=n.formatMeta(B(u,n.rules))))}n.strictArrays&&o.splice(0,r.length);for(let e=r.length,t=0;e<r.length+o.length;e++,t++){i[e]=o[t];var l={path:[...a,e],after:o[t],action:p.add};s[e]=n.formatMeta(B(l,n.rules))}return n.arrayMeta&&Object.keys(s).length&&(i[n.metaKey]=s),n.arrayMeta||!Object.keys(i).length?[i]:[i,{array:s}]}}]); |
@@ -1,6 +0,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.classifyDiff = exports.findClassifier = void 0; | ||
const helpers_1 = require("./rules/helpers"); | ||
const findClassifier = (rules, path) => { | ||
import { allUnclassified } from "./constants"; | ||
export const findClassifier = (rules, path) => { | ||
let _rules = rules; | ||
@@ -21,11 +18,10 @@ for (let key of [...path, ""]) { | ||
else { | ||
return helpers_1.allUnclassified; | ||
return allUnclassified; | ||
} | ||
} | ||
return helpers_1.allUnclassified; | ||
return allUnclassified; | ||
}; | ||
exports.findClassifier = findClassifier; | ||
const classifyDiff = (diff, rules = {}) => { | ||
export const classifyDiff = (diff, rules = {}) => { | ||
const _diff = diff; | ||
const classifier = (0, exports.findClassifier)(rules, diff.path); | ||
const classifier = findClassifier(rules, diff.path); | ||
const index = ["add", "remove", "replace"].indexOf(diff.action); | ||
@@ -38,3 +34,2 @@ const changeType = classifier[index]; | ||
}; | ||
exports.classifyDiff = classifyDiff; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3NpZmllci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9jbGFzc2lmaWVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUNBLDZDQUFpRDtBQUUxQyxNQUFNLGNBQWMsR0FBRyxDQUFDLEtBQVksRUFBRSxJQUFjLEVBQWMsRUFBRTtJQUN6RSxJQUFJLE1BQU0sR0FBRyxLQUFLLENBQUE7SUFDbEIsS0FBSyxJQUFJLEdBQUcsSUFBSSxDQUFDLEdBQUcsSUFBSSxFQUFFLEVBQUUsQ0FBQyxFQUFFO1FBQzdCLHFEQUFxRDtRQUNyRCxJQUFJLENBQUMsTUFBTSxDQUFDLGNBQWMsQ0FBQyxJQUFJLEdBQUcsRUFBRSxDQUFDLElBQUks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LEVBQUU7Z0JBQ3ZCLE9BQU8sSUFBSSxDQUFBO2FBQ1o7WUFDRCxNQUFNLEdBQUcsT0FBTyxJQUFJLEtBQUssVUFBVSxDQUFDLENBQUMsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFBO1NBQ3BEO2FBQU07WUFDTCxPQUFPLGVBQWUsQ0FBQTtTQUN2QjtLQUNGO0lBQ0QsT0FBTyxlQUFlLENBQUE7QUFDeEIsQ0FBQyxDQUFBO0FBRUQsTUFBTSxDQUFDLE1BQU0sWUFBWSxHQUFHLENBQUMsSUFBc0IsRUFBRSxRQUFlLEVBQUUsRUFBUSxFQUFFO0lBQzlFLE1BQU0sS0FBSyxHQUFHLElBQVksQ0FBQTtJQUUxQixNQUFNLFVBQVUsR0FBRyxjQUFjLENBQUMsS0FBSyxFQUFFLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQTtJQUVuRCxNQUFNLEtBQUssR0FBRyxDQUFDLEtBQUssRUFBRSxRQUFRLEVBQUUsU0FBUyxDQUFDLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQTtJQUMvRCxNQUFNLFVBQVUsR0FBRyxVQUFVLENBQUMsS0FBSyxDQUFDLENBQUE7SUFFcEMsS0FBSyxDQUFDLElBQUksR0FBRyxPQUFPLFVBQVUsS0FBSyxVQUFVO1FBQzNDLENBQUMsQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLE1BQU0sRUFBRSxJQUFJLENBQUMsS0FBSyxDQUFDO1FBQ3JDLENBQUMsQ0FBQyxVQUFVLENBQUE7SUFFZCxPQUFPLEtBQUssQ0FBQTtBQUNkLENBQUMsQ0FBQSJ9 |
@@ -1,4 +0,2 @@ | ||
import { Diff, MergedKeyMeta, MergeOptions } from "."; | ||
import { DiffOptions, Rules } from "./types"; | ||
export declare const DIFF_META_KEY = "_diff"; | ||
import { Diff, DiffOptions, Rules, MergedKeyMeta, MergeOptions } from "./types"; | ||
export declare class DiffContext implements DiffOptions { | ||
@@ -5,0 +3,0 @@ before: any; |
@@ -1,8 +0,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MergeContext = exports.DiffContext = exports.DIFF_META_KEY = void 0; | ||
const rules_1 = require("./rules"); | ||
const _1 = require("."); | ||
exports.DIFF_META_KEY = "_diff"; | ||
class DiffContext { | ||
import { asyncApi2Rules, jsonSchemaRules, openapi3Rules } from "./rules"; | ||
import { DiffAction, DIFF_META_KEY, } from "./constants"; | ||
export class DiffContext { | ||
constructor(before, after, options) { | ||
@@ -31,22 +27,20 @@ this.before = before; | ||
case "OpenApi3": | ||
return rules_1.openapi3Rules; | ||
return openapi3Rules; | ||
case "AsyncApi2": | ||
return rules_1.asyncApi2Rules; | ||
return asyncApi2Rules; | ||
case "JsonSchema": | ||
return (0, rules_1.jsonSchemaRules)(); | ||
return jsonSchemaRules(); | ||
} | ||
} | ||
} | ||
exports.DiffContext = DiffContext; | ||
class MergeContext extends DiffContext { | ||
export class MergeContext extends DiffContext { | ||
constructor(before, after, options) { | ||
super(before, after, options); | ||
this._formatMeta = (diff) => { | ||
return Object.assign({ type: diff.type, action: diff.action }, diff.action === _1.ActionType.replace ? { replaced: diff.before } : {}); | ||
return Object.assign({ type: diff.type, action: diff.action }, diff.action === DiffAction.replace ? { replaced: diff.before } : {}); | ||
}; | ||
this.formatMeta = options.formatMeta || ((d) => this._formatMeta(d)); | ||
this.metaKey = options.metaKey || exports.DIFF_META_KEY; | ||
this.metaKey = options.metaKey || DIFF_META_KEY; | ||
} | ||
} | ||
exports.MergeContext = MergeContext; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGV4dC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9jb250ZXh0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLG1DQU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QTtTQUMzQjtJQUNILENBQUM7Q0FFRjtBQUVELE1BQU0sT0FBTyxZQUFhLFNBQVEsV0FBVztJQUkzQyxZQUFZLE1BQVcsRUFBRSxLQUFVLEVBQUUsT0FBcUI7UUFDeEQsS0FBSyxDQUFDLE1BQU0sRUFBRSxLQUFLLEVBQUUsT0FBTyxDQUFDLENBQUE7UUFLdkIsZ0JBQVcsR0FBRyxDQUFDLElBQVUsRUFBaUIsRUFBRTtZQUNsRCx1QkFDRSxJQUFJLEVBQUUsSUFBSSxDQUFDLElBQUksRUFDZixNQUFNLEVBQUUsSUFBSSxDQUFDLE1BQU0sSUFDaEIsSUFBSSxDQUFDLE1BQU0sS0FBSyxVQUFVLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxFQUFFLFFBQVEsRUFBRSxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFDdkU7UUFDSCxDQUFDLENBQUE7UUFWQyxJQUFJLENBQUMsVUFBVSxHQUFHLE9BQU8sQ0FBQyxVQUFVLElBQUksQ0FBQyxDQUFDLENBQU8sRUFBRSxFQUFFLENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFBO1FBQzFFLElBQUksQ0FBQyxPQUFPLEdBQUcsT0FBTyxDQUFDLE9BQU8sSUFBSSxhQUFhLENBQUE7SUFDakQsQ0FBQztDQVNGIn0= |
@@ -1,2 +0,1 @@ | ||
"use strict"; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
@@ -13,23 +12,20 @@ var t = {}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.dereference = exports.resolveObjValue = void 0; | ||
const utils_1 = require("./utils"); | ||
const circularRef = Symbol("circularRef"); | ||
const resolveObjValue = (obj, path, cache = {}) => { | ||
import { parsePath, typeOf } from "./utils"; | ||
export const resolveObjValue = (obj, path, cache = {}) => { | ||
let value = obj; | ||
cache = new Map(Object.entries(cache)); | ||
for (const key of (0, utils_1.parsePath)(path)) { | ||
value = (0, utils_1.typeOf)(value) === "array" ? value[+key] : value[key]; | ||
for (const key of parsePath(path)) { | ||
value = typeOf(value) === "array" ? value[+key] : value[key]; | ||
if (value === undefined) { | ||
break; | ||
} | ||
value = (0, exports.dereference)(value, obj, new Set(), cache); | ||
value = dereference(value, obj, new Set(), cache); | ||
} | ||
return value; | ||
}; | ||
exports.resolveObjValue = resolveObjValue; | ||
const dereference = (value, source, refs, cache) => { | ||
export const dereference = (value, source, refs, cache) => { | ||
if (value.hasOwnProperty("$ref")) { | ||
const { $ref } = value, rest = __rest(value, ["$ref"]); | ||
if (refs.has($ref)) { | ||
// TODO: return { ...refObject, ...rest } if circularRefs === true | ||
return value; | ||
@@ -45,3 +41,3 @@ } | ||
} | ||
value = Object.assign(Object.assign({}, rest), (0, exports.resolveObjValue)(source, path, cache)); | ||
value = Object.assign(Object.assign({}, rest), resolveObjValue(source, path, cache)); | ||
refs.add($ref); | ||
@@ -52,3 +48,2 @@ cache.set($ref, value); | ||
}; | ||
exports.dereference = dereference; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVyZWZlcmVuY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvZGVyZWZlcmVuY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7QUFBQSxtQ0FBMkM7QUFFM0MsTUFBTSxXQUFXLEdBQUcsTUFBTSxDQUFDLGFBQWEsQ0FBQyxDQUFBO0FBRWxDLE1BQU0sZUFBZSxHQUFHLENBQUMsR0FBUSxFQUFFLElBQVksRUFBRSxRQUFhLEVBQUUsRUFBRSxFQUFFO0lBQ3pFLElBQUksS0FBSyxHQUFHLEdBQUcsQ0FBQTtJQUNmLEtBQUssR0FBRyxJQUFJLEdBQUcsQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLEt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2I7WUFDRCxNQUFNLEdBQUcsS0FBSyxDQUFDLEdBQUcsQ0FBQyxRQUFRLENBQUMsQ0FBQTtTQUM3QjtRQUVELEtBQUssbUNBQVEsSUFBSSxHQUFLLGVBQWUsQ0FBQyxNQUFNLEVBQUUsSUFBSSxFQUFFLEtBQUssQ0FBQyxDQUFFLENBQUE7UUFDNUQsSUFBSSxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsQ0FBQTtRQUNkLEtBQUssQ0FBQyxHQUFHLENBQUMsSUFBSSxFQUFFLEtBQUssQ0FBQyxDQUFBO0tBQ3ZCO0lBQ0QsT0FBTyxLQUFLLENBQUE7QUFDZCxDQUFDLENBQUEifQ== |
@@ -1,19 +0,15 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.findEqualItemIndex = exports.findDiff = exports.apiDiff = void 0; | ||
const types_1 = require("./types"); | ||
const dereference_1 = require("./dereference"); | ||
const classifier_1 = require("./classifier"); | ||
const context_1 = require("./context"); | ||
const utils_1 = require("./utils"); | ||
const apiDiff = (before, after, options) => { | ||
return (0, exports.findDiff)(before, after, new context_1.DiffContext(before, after, options)); | ||
import { dereference } from "./dereference"; | ||
import { classifyDiff } from "./classifier"; | ||
import { buildPath, typeOf } from "./utils"; | ||
import { DiffContext } from "./context"; | ||
import { DiffAction } from "./constants"; | ||
export const apiDiff = (before, after, options) => { | ||
return findDiff(before, after, new DiffContext(before, after, options)); | ||
}; | ||
exports.apiDiff = apiDiff; | ||
const findDiff = (before, after, ctx, path = []) => { | ||
if ((0, utils_1.typeOf)(before) !== (0, utils_1.typeOf)(after)) { | ||
const diff = { path: path, before, after, action: types_1.ActionType.replace }; | ||
return [(0, classifier_1.classifyDiff)(diff, ctx.rules)]; | ||
export const findDiff = (before, after, ctx, path = []) => { | ||
if (typeOf(before) !== typeOf(after)) { | ||
const diff = { path: path, before, after, action: DiffAction.replace }; | ||
return [classifyDiff(diff, ctx.rules)]; | ||
} | ||
switch ((0, utils_1.typeOf)(before)) { | ||
switch (typeOf(before)) { | ||
case "object": | ||
@@ -24,11 +20,10 @@ return objectsDiff(before, after, ctx, path); | ||
default: | ||
if ((0, utils_1.typeOf)(before) === "string") { | ||
if (typeOf(before) === "string") { | ||
before = normalizeString(before, ctx); | ||
after = normalizeString(after, ctx); | ||
} | ||
const diff = { path, before, after, action: types_1.ActionType.replace }; | ||
return before !== after ? [(0, classifier_1.classifyDiff)(diff, ctx.rules)] : []; | ||
const diff = { path, before, after, action: DiffAction.replace }; | ||
return before !== after ? [classifyDiff(diff, ctx.rules)] : []; | ||
} | ||
}; | ||
exports.findDiff = findDiff; | ||
const normalizeString = (value, ctx) => { | ||
@@ -41,7 +36,7 @@ value = ctx.trimStrings ? value.trim() : value; | ||
const diffs = []; | ||
const ref = "#" + (0, utils_1.buildPath)(path); | ||
const ref = "#" + buildPath(path); | ||
ctx.beforeRefs.add(ref); | ||
ctx.afterRefs.add(ref); | ||
const _before = (0, dereference_1.dereference)(before, ctx.before, ctx.beforeRefs, ctx.beforeCache); | ||
const _after = (0, dereference_1.dereference)(after, ctx.after, ctx.afterRefs, ctx.afterCache); | ||
const _before = dereference(before, ctx.before, ctx.beforeRefs, ctx.beforeCache); | ||
const _after = dereference(after, ctx.after, ctx.afterRefs, ctx.afterCache); | ||
const keys = new Set([...Object.keys(_before), ...Object.keys(_after)]); | ||
@@ -55,13 +50,13 @@ for (const key of keys) { | ||
// added key | ||
const diff = { path: [...path, key], after: _after[key], action: types_1.ActionType.add }; | ||
diffs.push((0, classifier_1.classifyDiff)(diff, ctx.rules)); | ||
const diff = { path: [...path, key], after: _after[key], action: DiffAction.add }; | ||
diffs.push(classifyDiff(diff, ctx.rules)); | ||
} | ||
else if (!_after.hasOwnProperty(key)) { | ||
// deleted key | ||
const diff = { path: [...path, key], before: _before[key], action: types_1.ActionType.remove }; | ||
diffs.push((0, classifier_1.classifyDiff)(diff, ctx.rules)); | ||
const diff = { path: [...path, key], before: _before[key], action: DiffAction.remove }; | ||
diffs.push(classifyDiff(diff, ctx.rules)); | ||
} | ||
else { | ||
// updated value | ||
diffs.push(...(0, exports.findDiff)(_before[key], _after[key], ctx, [...path, key])); | ||
diffs.push(...findDiff(_before[key], _after[key], ctx, [...path, key])); | ||
} | ||
@@ -79,6 +74,6 @@ if (ctx.findFirstDiff && diffs.length) { | ||
}; | ||
const findEqualItemIndex = (item, array, ctx) => { | ||
export const findEqualItemIndex = (item, array, ctx) => { | ||
for (let j = 0; j < array.length; j++) { | ||
ctx.findFirstDiff = true; | ||
const diff = (0, exports.findDiff)(item, array[j], ctx); | ||
const diff = findDiff(item, array[j], ctx); | ||
ctx.findFirstDiff = false; | ||
@@ -91,3 +86,2 @@ if (!diff.length) { | ||
}; | ||
exports.findEqualItemIndex = findEqualItemIndex; | ||
const arrayDiff = (before, after, ctx, path) => { | ||
@@ -99,11 +93,11 @@ const diffs = []; | ||
if (i >= after.length) { | ||
const diff = { path: [...path, i], before: before[i], action: types_1.ActionType.remove }; | ||
diffs.push((0, classifier_1.classifyDiff)(diff, ctx.rules)); | ||
const diff = { path: [...path, i], before: before[i], action: DiffAction.remove }; | ||
diffs.push(classifyDiff(diff, ctx.rules)); | ||
} | ||
else { | ||
diffs.push(...(0, exports.findDiff)(before[i], after[i], ctx, [...path, i])); | ||
diffs.push(...findDiff(before[i], after[i], ctx, [...path, i])); | ||
} | ||
} | ||
else { | ||
const index = (0, exports.findEqualItemIndex)(before[i], _after, ctx); | ||
const index = findEqualItemIndex(before[i], _after, ctx); | ||
if (index >= 0) { | ||
@@ -113,4 +107,4 @@ _after.splice(index, 1); | ||
else { | ||
const diff = { path: [...path, i], before: before[i], action: types_1.ActionType.remove }; | ||
diffs.push((0, classifier_1.classifyDiff)(diff, ctx.rules)); | ||
const diff = { path: [...path, i], before: before[i], action: DiffAction.remove }; | ||
diffs.push(classifyDiff(diff, ctx.rules)); | ||
} | ||
@@ -126,7 +120,7 @@ } | ||
for (let i = 0; i < _after.length; i++) { | ||
const diff = { path: [...path, before.length + i], after: _after[i], action: types_1.ActionType.add }; | ||
diffs.push((0, classifier_1.classifyDiff)(diff, ctx.rules)); | ||
const diff = { path: [...path, before.length + i], after: _after[i], action: DiffAction.add }; | ||
diffs.push(classifyDiff(diff, ctx.rules)); | ||
} | ||
return diffs; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlmZi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9kaWZmLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLG1DQUFpRTtBQUNqRSwrQ0FBMkM7QUFDM0MsNkNBQTJDO0FBQzNDLHVDQUF1QztBQUN2QyxtQ0FBMkM7QUFFcEMsTUFBTSxPQUFPLEdBQUcsQ0FBQyxNQUFXLEVBQUUsS0FBVSxFQUFFLE9BQW9CLEVBQVUsRUFBRTtJQUMvRSxPQUFPLElBQUEsZ0JBQVEsRUFBQyxNQUFNLEVBQUUsS0FBSyxFQUFFLElBQUkscUJBQVcsQ0FBQyxNQUFNLEVBQUUsS0FBSyxFQUFFLE9BQU8sQ0FBQyxDQUFDLENBQUE7QUFDekUsQ0FBQyxDQUFBO0FBRlksUUFBQSxPQUFPLFdBRW5CO0FBRU0sTUFBTSxRQUFRLEdBQUcsQ0FBQyxNQUFXLEVBQUUsS0FBVSxFQUFFLEdBQWdCLEVBQUUsT0FBaUIsRUFBRSxFQUFVLEVBQUU7SUFDakcsSUFBSSxJQUFBLGNBQU0sRUFBQyxNQUFNLENBQUMsS0FBSyxJQUFBLGNBQU0sRUFBQyxLQUFLLENBQUMsRUFBRTtRQUNwQyxNQUFNLElBQUksR0FBRyxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsTUFBTSxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsa0JBQVUsQ0FBQyxPQUFPLEVBQUUsQ0FBQTtRQUN0RSxPQUFPLENBQUMsS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QUVELEtBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO1FBQ3RDLE1BQU0sSUFBSSxHQUFHLEVBQUUsSUFBSSxFQUFFLENBQUMsR0FBRyxJQUFJLEVBQUUsTUFBTSxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsRUFBRSxLQUFLLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLE1BQU0sRUFBRSxVQUFVLENBQUMsR0FBRyxFQUFFLENBQUE7UUFDN0YsS0FBSyxDQUFDLElBQUksQ0FBQyxZQUFZLENBQUMsSUFBSSxFQUFFLEdBQUcsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFBO0tBQzFDO0lBRUQsT0FBTyxLQUFLLENBQUE7QUFDZCxDQUFDLENBQUEifQ== |
@@ -0,5 +1,6 @@ | ||
export * from "./rules/index"; | ||
export * from "./types"; | ||
export * from "./constants"; | ||
export { apiDiff } from "./diff"; | ||
export * from "./rules"; | ||
export * from "./types"; | ||
export { apiMerge } from "./merge"; | ||
export { findExternalRefs } from "./utils"; |
@@ -1,22 +0,7 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.findExternalRefs = exports.apiMerge = exports.apiDiff = void 0; | ||
var diff_1 = require("./diff"); | ||
Object.defineProperty(exports, "apiDiff", { enumerable: true, get: function () { return diff_1.apiDiff; } }); | ||
__exportStar(require("./rules"), exports); | ||
__exportStar(require("./types"), exports); | ||
var merge_1 = require("./merge"); | ||
Object.defineProperty(exports, "apiMerge", { enumerable: true, get: function () { return merge_1.apiMerge; } }); | ||
var utils_1 = require("./utils"); | ||
Object.defineProperty(exports, "findExternalRefs", { enumerable: true, get: function () { return utils_1.findExternalRefs; } }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OztBQUFBLCtCQUFnQztBQUF2QiwrRkFBQSxPQUFPLE9BQUE7QUFDaEIsMENBQXVCO0FBQ3ZCLDBDQUF1QjtBQUN2QixpQ0FBa0M7QUFBekIsaUdBQUEsUUFBUSxPQUFBO0FBQ2pCLGlDQUEwQztBQUFqQyx5R0FBQSxnQkFBZ0IsT0FBQSJ9 | ||
export * from "./rules/index"; | ||
export * from "./types"; | ||
export * from "./constants"; | ||
export { apiDiff } from "./diff"; | ||
export { apiMerge } from "./merge"; | ||
export { findExternalRefs } from "./utils"; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxlQUFlLENBQUE7QUFDN0IsY0FBYyxTQUFTLENBQUE7QUFDdkIsY0FBYyxhQUFhLENBQUE7QUFDM0IsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLFFBQVEsQ0FBQTtBQUNoQyxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sU0FBUyxDQUFBO0FBQ2xDLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLFNBQVMsQ0FBQSJ9 |
@@ -1,21 +0,17 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.apiMerge = void 0; | ||
const context_1 = require("./context"); | ||
const dereference_1 = require("./dereference"); | ||
const classifier_1 = require("./classifier"); | ||
const diff_1 = require("./diff"); | ||
const utils_1 = require("./utils"); | ||
const types_1 = require("./types"); | ||
const apiMerge = (before, after, options) => { | ||
const [value] = mergeChanges(before, after, new context_1.MergeContext(before, after, options), []); | ||
import { MergeContext } from "./context"; | ||
import { dereference } from "./dereference"; | ||
import { classifyDiff } from "./classifier"; | ||
import { findEqualItemIndex } from "./diff"; | ||
import { DiffAction } from "./constants"; | ||
import { typeOf } from "./utils"; | ||
export const apiMerge = (before, after, options) => { | ||
const [value] = mergeChanges(before, after, new MergeContext(before, after, options), []); | ||
return value; | ||
}; | ||
exports.apiMerge = apiMerge; | ||
const mergeChanges = (before, after, ctx, path = []) => { | ||
if ((0, utils_1.typeOf)(before) !== (0, utils_1.typeOf)(after)) { | ||
const diff = { path, before, after, action: types_1.ActionType.replace }; | ||
return [after, ctx.formatMeta((0, classifier_1.classifyDiff)(diff, ctx.rules))]; | ||
if (typeOf(before) !== typeOf(after)) { | ||
const diff = { path, before, after, action: DiffAction.replace }; | ||
return [after, ctx.formatMeta(classifyDiff(diff, ctx.rules))]; | ||
} | ||
switch ((0, utils_1.typeOf)(before)) { | ||
switch (typeOf(before)) { | ||
case "object": | ||
@@ -31,4 +27,4 @@ return mergeObjects(before, after, ctx, path); | ||
if (before !== after) { | ||
const diff = { path, before, after, action: types_1.ActionType.replace }; | ||
return [after, ctx.formatMeta((0, classifier_1.classifyDiff)(diff, ctx.rules))]; | ||
const diff = { path, before, after, action: DiffAction.replace }; | ||
return [after, ctx.formatMeta(classifyDiff(diff, ctx.rules))]; | ||
} | ||
@@ -46,4 +42,4 @@ } | ||
const meta = {}; | ||
const _before = (0, dereference_1.dereference)(before, ctx.before, ctx.beforeRefs, ctx.beforeCache); | ||
const _after = (0, dereference_1.dereference)(after, ctx.after, ctx.afterRefs, ctx.afterCache); | ||
const _before = dereference(before, ctx.before, ctx.beforeRefs, ctx.beforeCache); | ||
const _after = dereference(after, ctx.after, ctx.afterRefs, ctx.afterCache); | ||
const keys = new Set([...Object.keys(_before), ...Object.keys(_after)]); | ||
@@ -57,11 +53,11 @@ for (const key of keys) { | ||
// added key | ||
const diff = { path: [...path, key], after: _after[key], action: types_1.ActionType.add }; | ||
const diff = { path: [...path, key], after: _after[key], action: DiffAction.add }; | ||
merged[key] = _after[key]; | ||
meta[key] = ctx.formatMeta((0, classifier_1.classifyDiff)(diff, ctx.rules)); | ||
meta[key] = ctx.formatMeta(classifyDiff(diff, ctx.rules)); | ||
} | ||
else if (!_after.hasOwnProperty(key)) { | ||
// deleted key | ||
const diff = { path: [...path, key], before: _before[key], action: types_1.ActionType.remove }; | ||
const diff = { path: [...path, key], before: _before[key], action: DiffAction.remove }; | ||
merged[key] = _before[key]; | ||
meta[key] = ctx.formatMeta((0, classifier_1.classifyDiff)(diff, ctx.rules)); | ||
meta[key] = ctx.formatMeta(classifyDiff(diff, ctx.rules)); | ||
} | ||
@@ -86,4 +82,3 @@ else { | ||
const mergeArrays = (before, after, ctx, path) => { | ||
const arrMeta = { array: {} }; | ||
const meta = arrMeta.array; | ||
const arrMeta = {}; | ||
const array = []; | ||
@@ -94,5 +89,5 @@ const _after = [...after]; | ||
if (i >= after.length) { | ||
const diff = { path: [...path, i], before: before[i], action: types_1.ActionType.remove }; | ||
const diff = { path: [...path, i], before: before[i], action: DiffAction.remove }; | ||
array[i] = before[i]; | ||
meta[i] = ctx.formatMeta(((0, classifier_1.classifyDiff)(diff, ctx.rules))); | ||
arrMeta[i] = ctx.formatMeta((classifyDiff(diff, ctx.rules))); | ||
} | ||
@@ -103,3 +98,3 @@ else { | ||
if (m) { | ||
meta[i] = m; | ||
arrMeta[i] = m; | ||
} | ||
@@ -109,3 +104,3 @@ } | ||
else { | ||
const index = (0, diff_1.findEqualItemIndex)(before[i], _after, ctx); | ||
const index = findEqualItemIndex(before[i], _after, ctx); | ||
array[i] = before[i]; | ||
@@ -116,4 +111,4 @@ if (index >= 0) { | ||
else { | ||
const diff = { path: [...path, i], before: before[i], action: types_1.ActionType.remove }; | ||
meta[i] = ctx.formatMeta((0, classifier_1.classifyDiff)(diff, ctx.rules)); | ||
const diff = { path: [...path, i], before: before[i], action: DiffAction.remove }; | ||
arrMeta[i] = ctx.formatMeta(classifyDiff(diff, ctx.rules)); | ||
} | ||
@@ -127,15 +122,15 @@ } | ||
array[j] = _after[i]; | ||
const diff = { path: [...path, j], after: _after[i], action: types_1.ActionType.add }; | ||
meta[j] = ctx.formatMeta((0, classifier_1.classifyDiff)(diff, ctx.rules)); | ||
const diff = { path: [...path, j], after: _after[i], action: DiffAction.add }; | ||
arrMeta[j] = ctx.formatMeta(classifyDiff(diff, ctx.rules)); | ||
} | ||
if (ctx.arrayMeta && Object.keys(arrMeta.array).length) { | ||
array[ctx.metaKey] = arrMeta.array; | ||
if (ctx.arrayMeta && Object.keys(arrMeta).length) { | ||
array[ctx.metaKey] = arrMeta; | ||
} | ||
if (ctx.arrayMeta || !Object.keys(arrMeta.array).length) { | ||
if (ctx.arrayMeta || !Object.keys(array).length) { | ||
return [array]; | ||
} | ||
else { | ||
return [array, arrMeta]; | ||
return [array, { array: arrMeta }]; | ||
} | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVyZ2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvbWVyZ2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsdUNBQXFEO0FBQ3JELCtDQUEyQztBQUMzQyw2Q0FBMkM7QUFDM0MsaUNBQTJDO0FBQzNDLG1DQUFnQztBQUNoQyxtQ0FHZ0I7QUFFVCxNQUFNLFFBQVEsR0FBRyxDQUFDLE1BQVcsRUFBRSxLQU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YSxDQUFDLEdBQUcsQ0FBQyxPQUFPLENBQUMsR0FBRyxPQUFPLENBQUE7S0FDdEM7SUFFRCxJQUFJLEdBQUcsQ0FBQyxTQUFTLElBQUksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLE1BQU0sRUFBRTtRQUMvQyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUE7S0FDZjtTQUFNO1FBQ0wsT0FBTyxDQUFDLEtBQUssRUFBRSxFQUFFLEtBQUssRUFBRSxPQUFPLEVBQUUsQ0FBQyxDQUFBO0tBQ25DO0FBQ0gsQ0FBQyxDQUFBIn0= |
@@ -1,97 +0,94 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.asyncApi2Rules = exports.messageRules = exports.messageTraitsRules = void 0; | ||
const jsonschema_1 = require("./jsonschema"); | ||
const helpers_1 = require("./helpers"); | ||
import { jsonSchemaRules } from "./jsonschema"; | ||
import { addNonBreaking, allBreaking, allNonBreaking, allUnclassified, onlyAddBreaking, allAnnotation } from "../constants"; | ||
const correlationIdRules = { | ||
"/": helpers_1.addNonBreaking, | ||
"/location": helpers_1.addNonBreaking, | ||
"/description": helpers_1.allAnnotation, | ||
"/": addNonBreaking, | ||
"/location": addNonBreaking, | ||
"/description": allAnnotation, | ||
}; | ||
const commonRules = { | ||
"/summary": helpers_1.allAnnotation, | ||
"/tags": helpers_1.allAnnotation, | ||
"/externalDocs": helpers_1.allAnnotation, | ||
"/bindings": helpers_1.allUnclassified, | ||
"/summary": allAnnotation, | ||
"/tags": allAnnotation, | ||
"/externalDocs": allAnnotation, | ||
"/bindings": allUnclassified, | ||
}; | ||
const pubsubTraitsRules = Object.assign({ "/": helpers_1.addNonBreaking, "/*": helpers_1.addNonBreaking, "/operationId": helpers_1.addNonBreaking, "/description": helpers_1.allAnnotation }, commonRules); | ||
exports.messageTraitsRules = Object.assign({ "/": helpers_1.addNonBreaking, "/*": helpers_1.addNonBreaking, "/headers": helpers_1.allUnclassified, "/correlationId": correlationIdRules, "/schemaFormat": helpers_1.allBreaking, "/contentType": helpers_1.addNonBreaking, "/name": helpers_1.allNonBreaking, "/title": helpers_1.allNonBreaking, "/examples": helpers_1.allAnnotation }, commonRules); | ||
exports.messageRules = Object.assign({ "/": helpers_1.allBreaking, "/headers": helpers_1.allUnclassified, "/correlationId": correlationIdRules, "/schemaFormat": helpers_1.allBreaking, "/contentType": helpers_1.addNonBreaking, "/name": helpers_1.allNonBreaking, "/title": helpers_1.allNonBreaking, "/description": helpers_1.allNonBreaking, "/examples": helpers_1.allAnnotation, "/traits": exports.messageTraitsRules, "/payload": (0, jsonschema_1.jsonSchemaRules)(helpers_1.allBreaking) }, commonRules); | ||
const pubsubRules = Object.assign({ "/": helpers_1.addNonBreaking, "/operationId": helpers_1.addNonBreaking, "/description": helpers_1.allAnnotation, "/traits": pubsubTraitsRules, "/message": exports.messageRules }, commonRules); | ||
const pubsubTraitsRules = Object.assign({ "/": addNonBreaking, "/*": addNonBreaking, "/operationId": addNonBreaking, "/description": allAnnotation }, commonRules); | ||
export const messageTraitsRules = Object.assign({ "/": addNonBreaking, "/*": addNonBreaking, "/headers": allUnclassified, "/correlationId": correlationIdRules, "/schemaFormat": allBreaking, "/contentType": addNonBreaking, "/name": allNonBreaking, "/title": allNonBreaking, "/examples": allAnnotation }, commonRules); | ||
export const messageRules = Object.assign({ "/": allBreaking, "/headers": allUnclassified, "/correlationId": correlationIdRules, "/schemaFormat": allBreaking, "/contentType": addNonBreaking, "/name": allNonBreaking, "/title": allNonBreaking, "/description": allNonBreaking, "/examples": allAnnotation, "/traits": messageTraitsRules, "/payload": jsonSchemaRules(allBreaking) }, commonRules); | ||
const pubsubRules = Object.assign({ "/": addNonBreaking, "/operationId": addNonBreaking, "/description": allAnnotation, "/traits": pubsubTraitsRules, "/message": messageRules }, commonRules); | ||
const infoRules = { | ||
"/": helpers_1.addNonBreaking, | ||
"/version": helpers_1.addNonBreaking, | ||
"/termsOfService": helpers_1.addNonBreaking, | ||
"/": addNonBreaking, | ||
"/version": addNonBreaking, | ||
"/termsOfService": addNonBreaking, | ||
"/license": { | ||
"/": helpers_1.addNonBreaking, | ||
"/name": helpers_1.allBreaking, | ||
"/url": helpers_1.onlyAddBreaking, | ||
"/": addNonBreaking, | ||
"/name": allBreaking, | ||
"/url": onlyAddBreaking, | ||
}, | ||
"/title": helpers_1.allAnnotation, | ||
"/description": helpers_1.allAnnotation, | ||
"/title": allAnnotation, | ||
"/description": allAnnotation, | ||
"/contact": { | ||
"/": helpers_1.allAnnotation, | ||
"/name": helpers_1.allAnnotation, | ||
"/url": helpers_1.allAnnotation, | ||
"/email": helpers_1.allAnnotation, | ||
"/": allAnnotation, | ||
"/name": allAnnotation, | ||
"/url": allAnnotation, | ||
"/email": allAnnotation, | ||
}, | ||
}; | ||
const serversRules = { | ||
"/": helpers_1.addNonBreaking, | ||
"/": addNonBreaking, | ||
"/*": { | ||
"/": helpers_1.addNonBreaking, | ||
"/url": helpers_1.addNonBreaking, | ||
"/description": helpers_1.allAnnotation, | ||
"/protocol": helpers_1.allBreaking, | ||
"/protocolVersion": helpers_1.allBreaking, | ||
"/": addNonBreaking, | ||
"/url": addNonBreaking, | ||
"/description": allAnnotation, | ||
"/protocol": allBreaking, | ||
"/protocolVersion": allBreaking, | ||
"/variables": { | ||
"/": helpers_1.addNonBreaking, | ||
"/": addNonBreaking, | ||
"/*": { | ||
"/": helpers_1.addNonBreaking, | ||
"/": addNonBreaking, | ||
"/enum": { | ||
"/": helpers_1.addNonBreaking, | ||
"/*": helpers_1.addNonBreaking, | ||
"/": addNonBreaking, | ||
"/*": addNonBreaking, | ||
}, | ||
"/default": helpers_1.allBreaking, | ||
"/description": helpers_1.allAnnotation, | ||
"/examples": helpers_1.allAnnotation, | ||
"/default": allBreaking, | ||
"/description": allAnnotation, | ||
"/examples": allAnnotation, | ||
}, | ||
}, | ||
"/security": { | ||
"/": helpers_1.allBreaking, | ||
"/*": helpers_1.allBreaking, | ||
"/": allBreaking, | ||
"/*": allBreaking, | ||
}, | ||
"/bindings": helpers_1.allUnclassified, | ||
"/bindings": allUnclassified, | ||
}, | ||
}; | ||
const channelRules = { | ||
"/": helpers_1.addNonBreaking, | ||
"/description": helpers_1.allNonBreaking, | ||
"/bindings": helpers_1.allUnclassified, | ||
"/": addNonBreaking, | ||
"/description": allNonBreaking, | ||
"/bindings": allUnclassified, | ||
"/subscribe": pubsubRules, | ||
"/publish": pubsubRules, | ||
"/parameters": { | ||
"/": helpers_1.allBreaking, | ||
"/": allBreaking, | ||
"/*": { | ||
"/": helpers_1.addNonBreaking, | ||
"/description": helpers_1.allNonBreaking, | ||
"/schema": (0, jsonschema_1.jsonSchemaRules)(helpers_1.allBreaking), | ||
"/location": helpers_1.allBreaking, | ||
"/": addNonBreaking, | ||
"/description": allNonBreaking, | ||
"/schema": jsonSchemaRules(allBreaking), | ||
"/location": allBreaking, | ||
}, | ||
}, | ||
}; | ||
exports.asyncApi2Rules = { | ||
"/asyncapi": helpers_1.addNonBreaking, | ||
"/id": helpers_1.allAnnotation, | ||
"/defaultContentType": helpers_1.allBreaking, | ||
export const asyncApi2Rules = { | ||
"/asyncapi": addNonBreaking, | ||
"/id": allAnnotation, | ||
"/defaultContentType": allBreaking, | ||
"/info": infoRules, | ||
"/servers": serversRules, | ||
"/channels": { | ||
"/": helpers_1.addNonBreaking, | ||
"/": addNonBreaking, | ||
"/*": channelRules, | ||
}, | ||
"/components": helpers_1.allNonBreaking, | ||
"/tags": helpers_1.allAnnotation, | ||
"/externalDocs": helpers_1.allAnnotation, | ||
"/components": allNonBreaking, | ||
"/tags": allAnnotation, | ||
"/externalDocs": allAnnotation, | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXN5bmNhcGkyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3J1bGVzL2FzeW5jYXBpMi50cyJdLCJ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UFFLGVBQWU7SUFDNUIsWUFBWSxFQUFFLFdBQVc7SUFDekIsVUFBVSxFQUFFLFdBQVc7SUFDdkIsYUFBYSxFQUFFO1FBQ2IsR0FBRyxFQUFFLFdBQVc7UUFDaEIsSUFBSSxFQUFFO1lBQ0osR0FBRyxFQUFFLGNBQWM7WUFDbkIsY0FBYyxFQUFFLGNBQWM7WUFDOUIsU0FBUyxFQUFFLGVBQWUsQ0FBQyxXQUFXLENBQUM7WUFDdkMsV0FBVyxFQUFFLFdBQVc7U0FDekI7S0FDRjtDQUNGLENBQUE7QUFFRCxNQUFNLENBQUMsTUFBTSxjQUFjLEdBQVU7SUFDbkMsV0FBVyxFQUFFLGNBQWM7SUFDM0IsS0FBSyxFQUFFLGFBQWE7SUFDcEIscUJBQXFCLEVBQUUsV0FBVztJQUNsQyxPQUFPLEVBQUUsU0FBUztJQUNsQixVQUFVLEVBQUUsWUFBWTtJQUN4QixXQUFXLEVBQUU7UUFDWCxHQUFHLEVBQUUsY0FBYztRQUNuQixJQUFJLEVBQUUsWUFBWTtLQUNuQjtJQUNELGFBQWEsRUFBRSxjQUFjO0lBQzdCLE9BQU8sRUFBRSxhQUFhO0lBQ3RCLGVBQWUsRUFBRSxhQUFhO0NBQy9CLENBQUEifQ== |
export * from "./asyncapi2"; | ||
export * from "./openapi3"; | ||
export * from "./jsonschema"; | ||
export * from "./helpers"; |
@@ -1,17 +0,4 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./asyncapi2"), exports); | ||
__exportStar(require("./openapi3"), exports); | ||
__exportStar(require("./jsonschema"), exports); | ||
__exportStar(require("./helpers"), exports); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcnVsZXMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBQUEsOENBQTJCO0FBQzNCLDZDQUEwQjtBQUMxQiwrQ0FBNEI7QUFDNUIsNENBQXlCIn0= | ||
export * from "./asyncapi2"; | ||
export * from "./openapi3"; | ||
export * from "./jsonschema"; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcnVsZXMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxhQUFhLENBQUE7QUFDM0IsY0FBYyxZQUFZLENBQUE7QUFDMUIsY0FBYyxjQUFjLENBQUEifQ== |
@@ -1,33 +0,31 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.jsonSchemaRules = void 0; | ||
const helpers_1 = require("./helpers"); | ||
import { breakingIf, breakingIfAfterTrue } from "../utils"; | ||
import { breaking, nonBreaking, addNonBreaking, allAnnotation, allBreaking, allUnclassified, onlyAddBreaking, } from "../constants"; | ||
const maxClassifier = [ | ||
helpers_1.breaking, | ||
helpers_1.nonBreaking, | ||
(b, a) => (0, helpers_1.breakingIf)(b > a) | ||
breaking, | ||
nonBreaking, | ||
(b, a) => breakingIf(b > a) | ||
]; | ||
const minClassifier = [ | ||
helpers_1.breaking, | ||
helpers_1.nonBreaking, | ||
(b, a) => (0, helpers_1.breakingIf)(b < a) | ||
breaking, | ||
nonBreaking, | ||
(b, a) => breakingIf(b < a) | ||
]; | ||
const exclusiveClassifier = [ | ||
helpers_1.breakingIfAfterTrue, | ||
helpers_1.nonBreaking, | ||
helpers_1.breakingIfAfterTrue | ||
breakingIfAfterTrue, | ||
nonBreaking, | ||
breakingIfAfterTrue | ||
]; | ||
const booleanClassifier = [ | ||
helpers_1.breakingIfAfterTrue, | ||
helpers_1.nonBreaking, | ||
helpers_1.breakingIfAfterTrue | ||
breakingIfAfterTrue, | ||
nonBreaking, | ||
breakingIfAfterTrue | ||
]; | ||
const multipleOfClassifier = [ | ||
helpers_1.breaking, | ||
helpers_1.nonBreaking, | ||
(b, a) => (0, helpers_1.breakingIf)(!!(b % a)) | ||
breaking, | ||
nonBreaking, | ||
(b, a) => breakingIf(!!(b % a)) | ||
]; | ||
const jsonSchemaRules = (rootRule = helpers_1.allUnclassified) => ({ | ||
export const jsonSchemaRules = (rootRule = allUnclassified) => ({ | ||
"/": rootRule, | ||
"/title": helpers_1.allAnnotation, | ||
"/title": allAnnotation, | ||
"/multipleOf": multipleOfClassifier, | ||
@@ -40,3 +38,3 @@ "/maximum": maxClassifier, | ||
"/minLength": minClassifier, | ||
"/pattern": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/pattern": [breaking, nonBreaking, breaking], | ||
"/maxItems": maxClassifier, | ||
@@ -48,58 +46,57 @@ "/minItems": minClassifier, | ||
"/required": { | ||
"/": helpers_1.onlyAddBreaking, | ||
"/*": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/": onlyAddBreaking, | ||
"/*": [breaking, nonBreaking, breaking], | ||
}, | ||
"/enum": { | ||
"/": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/*": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/": [breaking, nonBreaking, breaking], | ||
"/*": [nonBreaking, breaking, breaking], | ||
}, | ||
"/type": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/type": [breaking, nonBreaking, breaking], | ||
"/not": { | ||
"/": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/*": () => (0, exports.jsonSchemaRules)(helpers_1.allBreaking), | ||
"/": [breaking, nonBreaking, breaking], | ||
"/*": () => jsonSchemaRules(allBreaking), | ||
}, | ||
"/allOf": { | ||
"/": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/*": () => (0, exports.jsonSchemaRules)(helpers_1.allBreaking), | ||
"/": [breaking, nonBreaking, breaking], | ||
"/*": () => jsonSchemaRules(allBreaking), | ||
}, | ||
"/oneOf": { | ||
"/": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/*": () => (0, exports.jsonSchemaRules)(helpers_1.addNonBreaking), | ||
"/": [breaking, nonBreaking, breaking], | ||
"/*": () => jsonSchemaRules(addNonBreaking), | ||
}, | ||
"/anyOf": { | ||
"/": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/*": () => (0, exports.jsonSchemaRules)(helpers_1.addNonBreaking), | ||
"/": [breaking, nonBreaking, breaking], | ||
"/*": () => jsonSchemaRules(addNonBreaking), | ||
}, | ||
"/items": () => (0, exports.jsonSchemaRules)(helpers_1.addNonBreaking), | ||
"/items": () => jsonSchemaRules(addNonBreaking), | ||
"/properties": { | ||
"/": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/*": () => (0, exports.jsonSchemaRules)(helpers_1.addNonBreaking), | ||
"/": [breaking, nonBreaking, breaking], | ||
"/*": () => jsonSchemaRules(addNonBreaking), | ||
}, | ||
"/additionalProperties": () => (0, exports.jsonSchemaRules)([helpers_1.breaking, helpers_1.breaking, helpers_1.breakingIfAfterTrue]), | ||
"/description": helpers_1.allAnnotation, | ||
"/format": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/default": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/additionalProperties": () => jsonSchemaRules([breaking, breaking, breakingIfAfterTrue]), | ||
"/description": allAnnotation, | ||
"/format": [breaking, nonBreaking, breaking], | ||
"/default": [nonBreaking, breaking, breaking], | ||
"/nullable": booleanClassifier, | ||
"/discriminator": { | ||
// TODO | ||
"/": helpers_1.allUnclassified, | ||
"/propertyName": helpers_1.allUnclassified, | ||
"/mapping": helpers_1.allUnclassified, | ||
"/": allUnclassified, | ||
"/propertyName": allUnclassified, | ||
"/mapping": allUnclassified, | ||
}, | ||
"/readOnly": booleanClassifier, | ||
"/writeOnly": booleanClassifier, | ||
"/example": helpers_1.allAnnotation, | ||
"/externalDocs": helpers_1.allAnnotation, | ||
"/example": allAnnotation, | ||
"/externalDocs": allAnnotation, | ||
"/deprecated": booleanClassifier, | ||
"/xml": { | ||
// TODO | ||
"/": helpers_1.allUnclassified, | ||
"/name": helpers_1.allUnclassified, | ||
"/namespace": helpers_1.allUnclassified, | ||
"/prefix": helpers_1.allUnclassified, | ||
"/attribute": helpers_1.allUnclassified, | ||
"/wrapped": helpers_1.allUnclassified, | ||
"/": allUnclassified, | ||
"/name": allUnclassified, | ||
"/namespace": allUnclassified, | ||
"/prefix": allUnclassified, | ||
"/attribute": allUnclassified, | ||
"/wrapped": allUnclassified, | ||
}, | ||
}); | ||
exports.jsonSchemaRules = jsonSchemaRules; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianNvbnNjaGVtYS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9qc29uc2NoZW1hLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUNBLHVDQUlrQjtBQUVsQixNQUFNLGFBQWEsR0FBZTtJQUNoQyxrQkFBUTtJQUNSLHFCQUFXO0lBQ1gsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxJQUFBLG9CQUFVLEV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SxDQUFDO1FBQ3RDLElBQUksRUFBRSxHQUFHLEVBQUUsQ0FBQyxlQUFlLENBQUMsY0FBYyxDQUFDO0tBQzVDO0lBQ0QsdUJBQXVCLEVBQUUsR0FBRyxFQUFFLENBQUMsZUFBZSxDQUFDLENBQUMsUUFBUSxFQUFFLFFBQVEsRUFBRSxtQkFBbUIsQ0FBQyxDQUFDO0lBQ3pGLGNBQWMsRUFBRSxhQUFhO0lBQzdCLFNBQVMsRUFBRSxDQUFDLFFBQVEsRUFBRSxXQUFXLEVBQUUsUUFBUSxDQUFDO0lBQzVDLFVBQVUsRUFBRSxDQUFDLFdBQVcsRUFBRSxRQUFRLEVBQUUsUUFBUSxDQUFDO0lBQzdDLFdBQVcsRUFBRSxpQkFBaUI7SUFDOUIsZ0JBQWdCLEVBQUU7UUFDaEIsT0FBTztRQUNQLEdBQUcsRUFBRSxlQUFlO1FBQ3BCLGVBQWUsRUFBRSxlQUFlO1FBQ2hDLFVBQVUsRUFBRSxlQUFlO0tBQzVCO0lBQ0QsV0FBVyxFQUFFLGlCQUFpQjtJQUM5QixZQUFZLEVBQUUsaUJBQWlCO0lBQy9CLFVBQVUsRUFBRSxhQUFhO0lBQ3pCLGVBQWUsRUFBRSxhQUFhO0lBQzlCLGFBQWEsRUFBRSxpQkFBaUI7SUFDaEMsTUFBTSxFQUFFO1FBQ04sT0FBTztRQUNQLEdBQUcsRUFBRSxlQUFlO1FBQ3BCLE9BQU8sRUFBRSxlQUFlO1FBQ3hCLFlBQVksRUFBRSxlQUFlO1FBQzdCLFNBQVMsRUFBRSxlQUFlO1FBQzFCLFlBQVksRUFBRSxlQUFlO1FBQzdCLFVBQVUsRUFBRSxlQUFlO0tBQzVCO0NBQ0YsQ0FBQyxDQUFBIn0= |
@@ -1,22 +0,20 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.openapi3Rules = void 0; | ||
const jsonschema_1 = require("./jsonschema"); | ||
const helpers_1 = require("./helpers"); | ||
import { breakingIfAfterTrue } from "../utils"; | ||
import { jsonSchemaRules } from "./jsonschema"; | ||
import { breaking, nonBreaking, unclassified, allAnnotation, addNonBreaking, allBreaking, } from "../constants"; | ||
const serversRules = { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/*": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/url": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/description": helpers_1.allAnnotation, | ||
"/": [nonBreaking, breaking, breaking], | ||
"/url": [nonBreaking, breaking, breaking], | ||
"/description": allAnnotation, | ||
"/variables": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/*": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/enum": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/*": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/*": [nonBreaking, breaking, breaking], | ||
}, | ||
"/default": [helpers_1.breaking, helpers_1.breaking, helpers_1.breaking], | ||
"/description": helpers_1.allAnnotation, | ||
"/default": [breaking, breaking, breaking], | ||
"/description": allAnnotation, | ||
}, | ||
@@ -27,38 +25,38 @@ }, | ||
const parametersRules = { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/*": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/name": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/in": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/description": helpers_1.allAnnotation, | ||
"/required": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breakingIfAfterTrue], | ||
"/deprecated": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breakingIfAfterTrue], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/name": [nonBreaking, breaking, breaking], | ||
"/in": [nonBreaking, breaking, breaking], | ||
"/description": allAnnotation, | ||
"/required": [breaking, nonBreaking, breakingIfAfterTrue], | ||
"/deprecated": [breaking, nonBreaking, breakingIfAfterTrue], | ||
}, | ||
}; | ||
const headersRules = { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/*": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/description": helpers_1.allAnnotation, | ||
"/required": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breakingIfAfterTrue], | ||
"/deprecated": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breakingIfAfterTrue], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/description": allAnnotation, | ||
"/required": [breaking, nonBreaking, breakingIfAfterTrue], | ||
"/deprecated": [breaking, nonBreaking, breakingIfAfterTrue], | ||
}, | ||
}; | ||
const encodingRules = { | ||
"/": [helpers_1.nonBreaking, helpers_1.nonBreaking, helpers_1.nonBreaking], | ||
"/": [nonBreaking, nonBreaking, nonBreaking], | ||
"/*": { | ||
"/contentType": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/contentType": [nonBreaking, breaking, breaking], | ||
"/headers": headersRules, | ||
"/style": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/explode": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/allowReserved": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/style": [nonBreaking, breaking, breaking], | ||
"/explode": [nonBreaking, breaking, breaking], | ||
"/allowReserved": [nonBreaking, breaking, breaking], | ||
}, | ||
}; | ||
const contentRules = { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/*": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/schema": (0, jsonschema_1.jsonSchemaRules)(helpers_1.allBreaking), | ||
"/example": helpers_1.allAnnotation, | ||
"/examples": helpers_1.allAnnotation, | ||
"/": [nonBreaking, breaking, breaking], | ||
"/schema": jsonSchemaRules(allBreaking), | ||
"/example": allAnnotation, | ||
"/examples": allAnnotation, | ||
"/encoding": encodingRules, | ||
@@ -68,15 +66,15 @@ }, | ||
const requestBodiesRules = { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/*": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/description": helpers_1.allAnnotation, | ||
"/": [nonBreaking, breaking, breaking], | ||
"/description": allAnnotation, | ||
"/content": contentRules, | ||
"/required": [helpers_1.breaking, helpers_1.nonBreaking, (_, a) => (a ? helpers_1.breaking : helpers_1.nonBreaking)], | ||
"/required": [breaking, nonBreaking, (_, a) => (a ? breaking : nonBreaking)], | ||
}, | ||
}; | ||
const responsesRules = { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/*": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/description": helpers_1.allAnnotation, | ||
"/": [nonBreaking, breaking, breaking], | ||
"/description": allAnnotation, | ||
"/headers": headersRules, | ||
@@ -87,41 +85,41 @@ "/content": contentRules, | ||
const securityRules = { | ||
"/": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.unclassified], | ||
"/*": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.unclassified], | ||
"/": [breaking, nonBreaking, unclassified], | ||
"/*": [breaking, nonBreaking, unclassified], | ||
}; | ||
const operationRules = { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/tags": helpers_1.allAnnotation, | ||
"/summary": helpers_1.allAnnotation, | ||
"/description": helpers_1.allAnnotation, | ||
"/externalDocs": helpers_1.allAnnotation, | ||
"/operationId": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/tags": allAnnotation, | ||
"/summary": allAnnotation, | ||
"/description": allAnnotation, | ||
"/externalDocs": allAnnotation, | ||
"/operationId": [nonBreaking, breaking, breaking], | ||
"/parameters": parametersRules, | ||
"/requestBody": requestBodiesRules, | ||
"/responses": responsesRules, | ||
"/deprecated": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breakingIfAfterTrue], | ||
"/deprecated": [breaking, nonBreaking, breakingIfAfterTrue], | ||
"/security": securityRules, | ||
"/servers": serversRules, | ||
}; | ||
exports.openapi3Rules = { | ||
"/openapi": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
export const openapi3Rules = { | ||
"/openapi": [nonBreaking, breaking, breaking], | ||
"/info": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/title": helpers_1.allAnnotation, | ||
"/description": helpers_1.allAnnotation, | ||
"/termsOfService": helpers_1.allAnnotation, | ||
"/contact": helpers_1.allAnnotation, | ||
"/": [nonBreaking, breaking, breaking], | ||
"/title": allAnnotation, | ||
"/description": allAnnotation, | ||
"/termsOfService": allAnnotation, | ||
"/contact": allAnnotation, | ||
"/licence": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/name": [helpers_1.breaking, helpers_1.breaking, helpers_1.breaking], | ||
"/url": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.nonBreaking], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/name": [breaking, breaking, breaking], | ||
"/url": [breaking, nonBreaking, nonBreaking], | ||
}, | ||
"/version": helpers_1.allAnnotation, | ||
"/version": allAnnotation, | ||
}, | ||
"/servers": serversRules, | ||
"/paths": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/*": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/summary": helpers_1.allAnnotation, | ||
"/description": helpers_1.allAnnotation, | ||
"/": [nonBreaking, breaking, breaking], | ||
"/summary": allAnnotation, | ||
"/description": allAnnotation, | ||
"/*": operationRules, | ||
@@ -133,18 +131,18 @@ "/servers": serversRules, | ||
"/components": { | ||
"/": [helpers_1.nonBreaking, helpers_1.nonBreaking, helpers_1.nonBreaking], | ||
"/": [nonBreaking, nonBreaking, nonBreaking], | ||
"/schemas": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/*": (0, jsonschema_1.jsonSchemaRules)(helpers_1.addNonBreaking), | ||
"/": [nonBreaking, breaking, breaking], | ||
"/*": jsonSchemaRules(addNonBreaking), | ||
}, | ||
"/responses": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/*": responsesRules, | ||
}, | ||
"/parameters": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/*": parametersRules, | ||
}, | ||
"/examples": helpers_1.allAnnotation, | ||
"/examples": allAnnotation, | ||
"/requestBodies": { | ||
"/": [helpers_1.nonBreaking, helpers_1.breaking, helpers_1.breaking], | ||
"/": [nonBreaking, breaking, breaking], | ||
"/*": requestBodiesRules, | ||
@@ -154,13 +152,13 @@ }, | ||
"/securitySchemes": { | ||
"/": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/": [breaking, nonBreaking, breaking], | ||
"/*": { | ||
"/": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/type": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/description": helpers_1.allAnnotation, | ||
"/name": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/in": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/scheme": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/bearerFormat": helpers_1.allAnnotation, | ||
"/flows": [helpers_1.breaking, helpers_1.nonBreaking, helpers_1.breaking], | ||
"/openIdConnectUrl": helpers_1.allAnnotation, | ||
"/": [breaking, nonBreaking, breaking], | ||
"/type": [breaking, nonBreaking, breaking], | ||
"/description": allAnnotation, | ||
"/name": [breaking, nonBreaking, breaking], | ||
"/in": [breaking, nonBreaking, breaking], | ||
"/scheme": [breaking, nonBreaking, breaking], | ||
"/bearerFormat": allAnnotation, | ||
"/flows": [breaking, nonBreaking, breaking], | ||
"/openIdConnectUrl": allAnnotation, | ||
}, | ||
@@ -170,5 +168,5 @@ }, | ||
"/security": securityRules, | ||
"/tags": helpers_1.allAnnotation, | ||
"/externalDocs": helpers_1.allAnnotation, | ||
"/tags": allAnnotation, | ||
"/externalDocs": allAnnotation, | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3BlbmFwaTMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcnVsZXMvb3BlbmFwaTMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNkNBQThDO0FBRTlDLHVDQUlrQjtBQUVsQixNQUFNLFlBQVksR0FBVTtJQUMxQixHQUFHLEVBQUUsQ0FBQyxxQkFBVyxFQUFFLGtCQUFRLEVBQUUsa0JBQVEsQ0FBQztJQUN0QyxJQUFJLEVBQUU7UUFDSixHQUFHLEVBQUUsQ0FBQyxxQkFBVyxFQUFFLGtCQUFRLEVBQUUsa0JBQVEsQ0FBQztRQUN0QyxNQUFNLEVBQUUsQ0F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xDQUFDLFFBQVEsRUFBRSxXQUFXLEVBQUUsUUFBUSxDQUFDO2dCQUN4QyxTQUFTLEVBQUUsQ0FBQyxRQUFRLEVBQUUsV0FBVyxFQUFFLFFBQVEsQ0FBQztnQkFDNUMsZUFBZSxFQUFFLGFBQWE7Z0JBQzlCLFFBQVEsRUFBRSxDQUFDLFFBQVEsRUFBRSxXQUFXLEVBQUUsUUFBUSxDQUFDO2dCQUMzQyxtQkFBbUIsRUFBRSxhQUFhO2FBQ25DO1NBQ0Y7S0FDRjtJQUNELFdBQVcsRUFBRSxhQUFhO0lBQzFCLE9BQU8sRUFBRSxhQUFhO0lBQ3RCLGVBQWUsRUFBRSxhQUFhO0NBQy9CLENBQUEifQ== |
export declare type DiffPath = Array<string | number>; | ||
export declare enum ActionType { | ||
add = "add", | ||
remove = "remove", | ||
replace = "replace" | ||
} | ||
export declare type ActionType = "add" | "remove" | "replace"; | ||
export declare type UnclassifiedDiff = { | ||
@@ -8,0 +4,0 @@ action: ActionType; |
@@ -1,10 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ActionType = void 0; | ||
var ActionType; | ||
(function (ActionType) { | ||
ActionType["add"] = "add"; | ||
ActionType["remove"] = "remove"; | ||
ActionType["replace"] = "replace"; | ||
})(ActionType = exports.ActionType || (exports.ActionType = {})); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRUEsSUFBWSxVQUlYO0FBSkQsV0FBWSxVQUFVO0lBQ3BCLHlCQUFXLENBQUE7SUFDWCwrQkFBaUIsQ0FBQTtJQUNqQixpQ0FBbUIsQ0FBQTtBQUNyQixDQUFDLEVBSlcsVUFBVSxHQUFWLGtCQUFVLEtBQVYsa0JBQVUsUUFJckIifQ== | ||
export {}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9 |
@@ -1,2 +0,4 @@ | ||
import { DiffPath } from "./types"; | ||
import { DiffType, DiffPath } from "./types"; | ||
export declare const breakingIf: (v: boolean) => DiffType; | ||
export declare const breakingIfAfterTrue: (_: any, a: any) => DiffType; | ||
export declare const typeOf: (value: any) => "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "array" | "null"; | ||
@@ -3,0 +5,0 @@ export declare const parsePath: (path: string) => string[]; |
@@ -1,5 +0,5 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.findExternalRefs = exports.buildPath = exports.parsePath = exports.typeOf = void 0; | ||
const typeOf = (value) => { | ||
import { breaking, nonBreaking } from "./constants"; | ||
export const breakingIf = (v) => (v ? breaking : nonBreaking); | ||
export const breakingIfAfterTrue = (_, a) => breakingIf(a); | ||
export const typeOf = (value) => { | ||
if (Array.isArray(value)) { | ||
@@ -10,13 +10,10 @@ return "array"; | ||
}; | ||
exports.typeOf = typeOf; | ||
const parsePath = (path) => { | ||
export const parsePath = (path) => { | ||
const [_, ...pathArr] = path.split("/").map((i) => i.replace(new RegExp("~1", "g"), "/")); | ||
return pathArr; | ||
}; | ||
exports.parsePath = parsePath; | ||
const buildPath = (path) => { | ||
export const buildPath = (path) => { | ||
return "/" + path.map((i) => String(i).replace(new RegExp("/", "g"), "~1")).join("/"); | ||
}; | ||
exports.buildPath = buildPath; | ||
const findExternalRefs = (source) => { | ||
export const findExternalRefs = (source) => { | ||
if (typeof source !== "object") { | ||
@@ -26,6 +23,6 @@ return []; | ||
let refs = new Set(); | ||
if ((0, exports.typeOf)(source) === "array") { | ||
if (typeOf(source) === "array") { | ||
for (const item of source) { | ||
if (typeof item === "object") { | ||
refs = new Set([...refs, ...(0, exports.findExternalRefs)(item)]); | ||
refs = new Set([...refs, ...findExternalRefs(item)]); | ||
} | ||
@@ -42,3 +39,3 @@ } | ||
if (typeof source[key] === "object") { | ||
refs = new Set([...refs, ...(0, exports.findExternalRefs)(source[key])]); | ||
refs = new Set([...refs, ...findExternalRefs(source[key])]); | ||
} | ||
@@ -50,3 +47,2 @@ } | ||
}; | ||
exports.findExternalRefs = findExternalRefs; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRU8sTUFBTSxNQUFNLEdBQUcsQ0FBQyxLQUFVLEVBQUUsRUFBRTtJQUNuQyxJQUFJLEtBQUssQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLEVBQUU7UUFDeEIsT0FBTyxPQUFPLENBQUE7S0FDZjtJQUNELE9BQU8sT0FBTyxLQUFLLElBQUksSUFBSSxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLE9BQU8sS0FBSyxDQUFBO0FBQ3JELENBQUMsQ0FBQTtBQUxZLFFBQUEsTUFBTSxVQUtsQjtBQUVNLE1BQU0sU0FBUyxHQUFHLENBQUMsSUFBWSxFQUFZLEVBQUU7SUFDbEQsTUFBTSxDQUFDLENBQUMsRUFBRSxHQUFHLE9BQU8sQ0FBQyxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLElBQUksTUFBTSxDQUFDLElBQUksRUFBRSxHQUFHLENBQUMsRUFBRSxHQUFHLENBQUMsQ0FBQyxDQUFBO0lBQ3pGLE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QUE7aUJBQzVEO2FBQ0Y7U0FDRjtLQUNGO0lBQ0QsT0FBTyxDQUFDLEdBQUcsSUFBSSxDQUFDLENBQUE7QUFDbEIsQ0FBQyxDQUFBIn0= |
{ | ||
"name": "api-smart-diff", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"description": "Generate the diff between two API specifications (OpenAPI, AsyncAPI, JsonSchema)", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
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
166054
1989