Skip to content

Latest commit

 

History

History
174 lines (104 loc) · 4.09 KB

index.md

File metadata and controls

174 lines (104 loc) · 4.09 KB

@asyncapi/diff / index

Module: index

Table of contents

Interfaces

Type aliases

Functions

Type aliases

ActionType

Ƭ ActionType: "add" | "remove" | "edit"

Defined in

types.ts:7


ChangeType

Ƭ ChangeType: typeof breaking | typeof nonBreaking | typeof unclassified

Defined in

types.ts:9


Changes

Ƭ Changes: DiffOutputItem[] | string

Defined in

types.ts:32


DiffOutputItem

Ƭ DiffOutputItem: DiffOutput & { type: ChangeType }

Defined in

types.ts:28


MarkdownSubtype

Ƭ MarkdownSubtype: "json" | "yaml" | "yml"

Defined in

types.ts:52


Output

Ƭ Output: JSONOutput | string

Defined in

types.ts:38


OutputType

Ƭ OutputType: "json" | "yaml" | "yml" | "markdown" | "md"

Defined in

types.ts:50


OverrideStandard

Ƭ OverrideStandard: StandardType & OverrideObject

Defined in

types.ts:48


StandardType

Ƭ StandardType: typeof v2Standard | typeof v3Standard

Defined in

types.ts:42


ValueOperation

Ƭ ValueOperation: ReplaceOperation<any> | AddOperation<any>

Defined in

types.ts:40

Functions

diff

diff(firstDocument, secondDocument, config?): AsyncAPIDiff

Generates diff between two AsyncAPI documents

example

const output = diff(firstDocument, secondDocument, {
 override: {
   '/servers': {
     add: 'non-breaking', // when a property has been added in the AsyncAPI document
     remove: 'breaking',  // when a property has been removed from the AsyncAPI document
     edit: 'unclassified' // when a property has been edited in the AsyncAPI document
   }
 },
 outputType: "yaml"
})

Parameters

Name Type Description
firstDocument any The parsed AsyncAPI document
secondDocument any The parsed AsyncAPI document
config Config Configuration options

Returns

AsyncAPIDiff

The diff data

Defined in

main.ts:32