Skip to content

Latest commit

 

History

History
174 lines (104 loc) · 4.07 KB

index.md

File metadata and controls

174 lines (104 loc) · 4.07 KB

@asyncapi/diff / index

Module: index

Table of contents

Interfaces

Type aliases

Functions

Type aliases

ActionType

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

Defined in

types.ts:6


ChangeType

Ƭ ChangeType: typeof breaking | typeof nonBreaking | typeof unclassified

Defined in

types.ts:8


Changes

Ƭ Changes: DiffOutputItem[] | string

Defined in

types.ts:31


DiffOutputItem

Ƭ DiffOutputItem: DiffOutput & { type: ChangeType }

Defined in

types.ts:27


MarkdownSubtype

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

Defined in

types.ts:51


Output

Ƭ Output: JSONOutput | string

Defined in

types.ts:37


OutputType

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

Defined in

types.ts:49


OverrideStandard

Ƭ OverrideStandard: StandardType & OverrideObject

Defined in

types.ts:47


StandardType

Ƭ StandardType: typeof standard

Defined in

types.ts:41


ValueOperation

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

Defined in

types.ts:39

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:31