New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

api-smart-diff

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-smart-diff - npm Package Compare versions

Comparing version 0.6.3 to 0.6.4

2

browser/api-smart-diff.min.js

@@ -1,2 +0,2 @@

/*! api-smart-diff@0.6.3 */
/*! api-smart-diff@0.6.4 */
var ApiSmartDiff=function(a){var r={};function t(e){var n;return(r[e]||(n=r[e]={i:e,l:!1,exports:{}},a[e].call(n.exports,n,n.exports,t),n.l=!0,n)).exports}return t.m=a,t.c=r,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:a})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var r in n)t.d(a,r,function(e){return n[e]}.bind(null,r));return a},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=7)}([function(e,n,a){"use strict";var r,t;Object.defineProperty(n,"__esModule",{value:!0}),n.allDeprecate=n.allAnnotation=n.allUnclassified=n.addNonBreaking=n.onlyAddBreaking=n.allBreaking=n.allNonBreaking=n.deprecate=n.annotation=n.unclassified=n.nonBreaking=n.breaking=n.ClassifierType=n.DiffAction=n.DIFF_META_KEY=void 0,n.DIFF_META_KEY="$diff",(r=n.DiffAction||(n.DiffAction={})).add="add",r.remove="remove",r.replace="replace",r.rename="rename",r.test="test",(t=r=n.ClassifierType||(n.ClassifierType={})).breaking="breaking",t.nonBreaking="non-breaking",t.annotation="annotation",t.unclassified="unclassified",t.deprecate="deprecate",n.breaking=r.breaking,n.nonBreaking=r.nonBreaking,n.unclassified=r.unclassified,n.annotation=r.annotation,n.deprecate=r.deprecate,n.allNonBreaking=[n.nonBreaking,n.nonBreaking,n.nonBreaking],n.allBreaking=[n.breaking,n.breaking,n.breaking],n.onlyAddBreaking=[n.breaking,n.nonBreaking,n.nonBreaking],n.addNonBreaking=[n.nonBreaking,n.breaking,n.breaking],n.allUnclassified=[n.unclassified,n.unclassified,n.unclassified],n.allAnnotation=[n.annotation,n.annotation,n.annotation],n.allDeprecate=[n.deprecate,n.deprecate,n.deprecate]},function(e,o,n){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.includeSecurity=o.emptySecurity=o.mergeValues=o.setValueByPath=o.getValueByPath=o.resolveRef=o.objArray=o.matchRule=o.findExternalRefs=o.getPathMatchFunc=o.getPathRules=o.buildPath=o.parsePath=o.typeOf=o.isEmptyObject=o.unchanged=o.renamed=o.replaced=o.removed=o.added=o.breakingIfAfterTrue=o.breakingIf=o.PathPointer=void 0;const s=n(2),r=n(0);class a{get ref(){return this.parent?this.parent.ref+"/"+this.escapedKey:this.escapedKey}[Symbol.iterator](){let e=0;return{next:()=>({done:!(e<this.items.length),value:this.items[e++]})}}constructor(e,n){this.key=e,this.parent=n,this.items=[],void 0===e?this.escapedKey="":(this.escapedKey="string"==typeof e?e.replace(new RegExp("~1","g"),"/"):String(e),this.items=n?[...n.items,e]:[e])}childPath(e){return new a(e,this)}}o.PathPointer=a;o.breakingIf=e=>e?r.breaking:r.nonBreaking,o.breakingIfAfterTrue=({after:e})=>(0,o.breakingIf)(e),o.added=(e,n)=>({path:e.items,after:n,action:r.DiffAction.add}),o.removed=(e,n)=>({path:e.items,before:n,action:r.DiffAction.remove}),o.replaced=(e,n,a)=>({path:e.items,before:n,after:a,action:r.DiffAction.replace}),o.renamed=(e,n,a)=>({path:e.items,before:n,after:a,action:r.DiffAction.rename}),o.unchanged=(e,n)=>({path:e.items,before:n,action:r.DiffAction.test}),o.isEmptyObject=e=>{for(const n in e)return!1;return!0},o.typeOf=e=>Array.isArray(e)?"array":null==e?"null":typeof e,o.parsePath=e=>{var[,...e]=e.split("/").map(e=>e.replace(new RegExp("~1","g"),"/"));return e},o.buildPath=e=>"/"+e.map(e=>String(e).replace(new RegExp("/","g"),"~1")).join("/"),o.getPathRules=(e,n,a)=>{let r=e,t=a;for(var i of[...n]){if(t=void 0!==i&&void 0!==t?t[i]:void 0,r.hasOwnProperty("/"+i)&&"number"!=typeof i||(i="*"),!r.hasOwnProperty("/"+i))return;i=r["/"+i];if(Array.isArray(i))return i;r="function"==typeof i?i(t):i}return r},o.getPathMatchFunc=(e,n,a)=>{e=(0,o.getPathRules)(e,n.items,a);return e&&!Array.isArray(e)?e["#"]:void 0},o.findExternalRefs=e=>{if("object"!=typeof e)return[];let n=new Set;if("array"===(0,o.typeOf)(e))for(const r of e)"object"==typeof r&&(n=new Set([...n,...(0,o.findExternalRefs)(r)]));else for(const t of Object.keys(e)){var a;"$ref"===t?([a]=e[t].split("#"),a&&n.add(a)):"object"==typeof e[t]&&(n=new Set([...n,...(0,o.findExternalRefs)(e[t])]))}return[...n]},o.matchRule=(e,n)=>(e["#"]=n,e),o.objArray=(a,e)=>(0,o.matchRule)(e,({before:e,after:n})=>n.value[a]===e.value[a]),o.resolveRef=(e,n,a)=>{var r,t=e["$ref"],i=s.__rest(e,["$ref"]);return!t||([t,r]=t.split("#"),t&&!a.has(t))||void 0===(a=(0,o.getValueByPath)(t?a.get(t):n,(0,o.parsePath)(r)))?e:(0,o.isEmptyObject)(i)?a:(0,o.mergeValues)(a,i)},o.getValueByPath=(e,n)=>{let a=e;for(const r of n)if(void 0===(a="array"===(0,o.typeOf)(a)?a[+r]:a[r]))break;return a},o.setValueByPath=(e,n,a,r=0)=>{var t;r>=n.length||("object"!=typeof e[t=n[r]]&&(e[t]={}),r===n.length-1?e[t]=a:(0,o.setValueByPath)(e[t],n,a,r+1))},o.mergeValues=(e,n)=>{if(Array.isArray(e)||"object"!=typeof e||"object"!=typeof n||!n)return n;for(const a of Reflect.ownKeys(n))e[a]=(0,o.mergeValues)(e[a],n[a]);return e},o.emptySecurity=e=>!!e&&(0===e.length||1===e.length&&0===Object.keys(e[0]).length);o.includeSecurity=(e=[],n=[])=>{var a=new Set(e.map(e=>Object.keys(e)[0]));for(const r of n)if(!a.has(Object.keys(r)[0]))return!1;return!0}},function(e,n,a){"use strict";a.r(n),a.d(n,"__extends",function(){return t}),a.d(n,"__assign",function(){return i}),a.d(n,"__rest",function(){return o}),a.d(n,"__decorate",function(){return s}),a.d(n,"__param",function(){return l}),a.d(n,"__metadata",function(){return c}),a.d(n,"__awaiter",function(){return g}),a.d(n,"__generator",function(){return u}),a.d(n,"__createBinding",function(){return f}),a.d(n,"__exportStar",function(){return d}),a.d(n,"__values",function(){return p}),a.d(n,"__read",function(){return k}),a.d(n,"__spread",function(){return b}),a.d(n,"__spreadArrays",function(){return h}),a.d(n,"__await",function(){return m}),a.d(n,"__asyncGenerator",function(){return y}),a.d(n,"__asyncDelegator",function(){return B}),a.d(n,"__asyncValues",function(){return v}),a.d(n,"__makeTemplateObject",function(){return A}),a.d(n,"__importStar",function(){return j}),a.d(n,"__importDefault",function(){return O}),a.d(n,"__classPrivateFieldGet",function(){return R}),a.d(n,"__classPrivateFieldSet",function(){return _});

@@ -3,0 +3,0 @@ /*! *****************************************************************************

@@ -17,3 +17,3 @@ import { JsonCompareOptions, MatchFunc, JsonDiff, CompareResult, JsonMergedMeta } from "./types";

get merged(): any;
constructor(before: any, after: any, options?: JsonCompareOptions);
constructor(before: any, after: any, options?: JsonCompareOptions<D>);
protected _formatMergeMeta: (diff: D) => JsonMergedMeta;

@@ -20,0 +20,0 @@ private setMeta;

@@ -64,3 +64,3 @@ export type ObjPath = Array<string | number>;

};
export type ApiDiffOptions = JsonCompareOptions & {
export type ApiDiffOptions = JsonCompareOptions<Diff> & {
resolveUnchangedRefs?: boolean;

@@ -67,0 +67,0 @@ rules?: Rules;

@@ -17,3 +17,3 @@ import { JsonCompareOptions, MatchFunc, JsonDiff, CompareResult, JsonMergedMeta } from "./types";

get merged(): any;
constructor(before: any, after: any, options?: JsonCompareOptions);
constructor(before: any, after: any, options?: JsonCompareOptions<D>);
protected _formatMergeMeta: (diff: D) => JsonMergedMeta;

@@ -20,0 +20,0 @@ private setMeta;

@@ -64,3 +64,3 @@ export type ObjPath = Array<string | number>;

};
export type ApiDiffOptions = JsonCompareOptions & {
export type ApiDiffOptions = JsonCompareOptions<Diff> & {
resolveUnchangedRefs?: boolean;

@@ -67,0 +67,0 @@ rules?: Rules;

{
"name": "api-smart-diff",
"version": "0.6.3",
"version": "0.6.4",
"description": "Generate the diff between two API specifications (OpenAPI, AsyncAPI, JsonSchema)",

@@ -5,0 +5,0 @@ "module": "dist/esm/index.js",

@@ -200,6 +200,6 @@ # api-smart-diff

```ts
import { apiDiff, changeDoc, changeOpenApiRules } from "api-smart-diff"
import { apiDiff, changeDoc, changeDocOpenApiRules } from "api-smart-diff"
const diff = apiDiff(before, after, {
formatMergedMeta: (diff) => ({ ...diff, description: changeDoc(diff, before, after, changeOpenApiRules) })
formatMergedMeta: (diff) => ({ ...diff, description: changeDoc(diff, before, after, changeDocOpenApiRules) })
})

@@ -206,0 +206,0 @@ ```

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc