Vigia

Upgrading yaml from 1.x to 2.x

Comparison of the public API of yaml 1.10.3 and 2.9.1, computed automatically from their TypeScript types. A changed signature is a candidate for a breaking change, not a certainty.

Summary

Removed import paths0
Removed exports6
Changed signatures4
Removed class or interface members12
Changed class or interface members18
Newly deprecated0
Requirement changes (engines, peer dependencies)1
New exports44

Removed exports

importexportkindBefore
yamlASTnamespacenamespace
yamlOptionsinterfaceinterface
yamlparseCSTfunction(str: string): ParsedCST
yamlcreateNodefunction(value: any, wrapScalars?: true | undefined, tag?: string | undefined): YAMLMap | YAMLSeq | Scalar | (value: any, wrapScalars: false, tag?: string | undefined): string | number | boolean | YAMLMap | YAMLSeq | null
yamlscalarOptionsvariable{ binary: Binary; bool: Bool; int: Int; null: Null; str: Str; }
yamldefaultOptionsvariableOptions

Changed signatures

exportBeforeAfter
yaml · parse(str: string, options?: Options | undefined): any(src: string, options?: (ParseOptions & DocumentOptions & SchemaOptions & ToJSOptions) | undefined): any | (src: string, reviver: Reviver, options?: (ParseOptions & DocumentOptions & SchemaOptions & ToJSOptions) | undefined): any
yaml · stringify(value: any, options?: Options | undefined): string(value: any, options?: (DocumentOptions & SchemaOptions & ParseOptions & CreateNodeOptions & ToStringOptions) | undefined): string | (value: any, replacer?: Replacer | null | undefined, options?: string | number | (DocumentOptions & SchemaOptions & ParseOptions & CreateNodeOptions & ToStringOptions) | undefined): string
yaml · parseDocument(str: string, options?: Options | undefined): Parsed<Contents extends Node = ParsedNode, Strict extends boolean = true>(source: string, options?: (ParseOptions & DocumentOptions & SchemaOptions) | undefined): Contents extends ParsedNode ? Parsed<Contents, Strict> : Document<Contents, Strict>
yaml · parseAllDocuments(str: string, options?: Options | undefined): Parsed[]<Contents extends Node = ParsedNode, Strict extends boolean = true>(source: string, options?: (ParseOptions & DocumentOptions & SchemaOptions) | undefined): EmptyStream | (Contents extends ParsedNode ? Parsed<Contents, Strict> : Document<Contents, Strict>)[]

Removed class or interface members

memberimportBefore
Document.tagyamlnever
Document.typeyamlType.DOCUMENT
Document.itemsyamlany[]
Document.parseyaml(cst: Document): Document
Document.anchorsyamlAnchors
Document.cstNodeyamlDocument | undefined
Document.versionyamlstring | undefined
Document.spaceBeforeyamlboolean | undefined
Document.tagPrefixesyamlTagPrefix[]
Document.setTagPrefixyaml(handle: string, prefix: string): void
Document.listNonDefaultTagsyaml(): string[]
Document.directivesEndMarkeryamlboolean | undefined

Changed class or interface members

memberBeforeAfter
Document.get(key: any, keepScalar?: boolean | undefined): any(key: unknown, keepScalar?: boolean | undefined): Strict extends true ? unknown : any
Document.has(key: any): boolean(key: unknown): boolean
Document.set(key: any, value: any): void(key: any, value: unknown): void
Document.addIn(path: Iterable<any>, value: any): void(path: Iterable<unknown>, value: unknown): void
Document.getIn(path: Iterable<any>, keepScalar?: boolean | undefined): any(path: Iterable<unknown> | null, keepScalar?: boolean | undefined): Strict extends true ? unknown : any
Document.hasIn(path: Iterable<any>): boolean(path: Iterable<unknown> | null): boolean
Document.range[number, number] | null | undefinedRange | undefined
Document.setIn(path: Iterable<any>, value: any): void(path: Iterable<unknown> | null, value: unknown): void
Document.delete(key: any): boolean(key: unknown): boolean
Document.schemaSchema | undefinedSchema
Document.toJSON(arg?: string | undefined, onAnchor?: ((value: any, count: number) => void) | undefined): any(jsonArg?: string | null | undefined, onAnchor?: ((value: unknown, count: number) => void) | undefined): any
Document.commentstring | null | undefinedstring | null
Document.contentsanyStrict extends true ? Contents | null : Contents
Document.deleteIn(path: Iterable<any>): boolean(path: Iterable<unknown> | null): boolean
Document.toString(): string(options?: ToStringOptions | undefined): string
Document.setSchema(id?: "1.0" | "1.1" | "1.2" | Name | undefined, customTags?: (TagId | Tag)[] | undefined): void(version: "1.1" | "1.2" | "next" | null, options?: SchemaOptions | undefined): void
Document.constructor(options?: Options | undefined): Document<Contents extends Node = Node, Strict extends boolean = true>(value?: any, options?: (DocumentOptions & SchemaOptions & ParseOptions & CreateNodeOptions) | undefined): Document<Contents, Strict> | <Contents extends Node = Node, Strict extends boolean = true>(value: any, replacer: Replacer | null, op…
Document.commentBeforestring | null | undefinedstring | null

Newly deprecated

None detected.

Requirement changes (engines, peer dependencies)

BeforeAfter
engines.node>= 6>= 14.6
New exports (44)
importexportkind
yamlNodetype
yamlPairclass
yamlTagstype
yamlAliasclass
yamlLexerclass
yamlRangetype
yamlTagIdtype
yamlisMapvariable
yamlisSeqvariable
yamlvisitfunction
yamlParserclass
yamlScalarclass
yamlSchemaclass
yamlisNodefunction
yamlisPairvariable
yamlYAMLMapclass
yamlYAMLSeqclass
yamlYAMLSetclass
yamlisAliasvariable
yamlvisitortype
yamlComposerclass
yamlYAMLOMapclass
yamlisScalarvariable
yamlErrorCodetype
yamlScalarTaginterface
yamlYAMLErrorclass
yamlvisitorFntype
yamlParsedNodetype
yamlisDocumentvariable
yamlvisitAsyncfunction
yamlEmptyStreaminterface
yamlLineCounterclass
yamlToJSOptionstype
yamlYAMLWarningclass
yamlParseOptionstype
yamlasyncVisitortype
yamlisCollectionfunction
yamlCollectionTaginterface
yamlSchemaOptionstype
yamlYAMLParseErrorclass
yamlasyncVisitorFntype
yamlDocumentOptionstype
yamlToStringOptionstype
yamlCreateNodeOptionstype

Frequently asked questions

What are the breaking changes when upgrading yaml from 1 to 2?

Between yaml 1.10.3 and 2.9.1, Vigia found 6 removed exports, 4 changed signatures and 30 removed or changed class or interface members.

What became deprecated in yaml 2?

0 exports or members are newly marked as deprecated in yaml 2.9.1.

For agents

GET https://vigia.coredls.cloud/v1/packages/npm/yaml/upgrade?from=1.10.3&to=2.9.1