Vigia

Passer de yaml 1.x à 2.x

Comparaison de l’API publique de yaml 1.10.3 et 2.9.1, calculée automatiquement à partir de leurs types TypeScript. Une signature modifiée est un changement incompatible possible, pas une certitude.

Résumé

Chemins d’importation supprimés0
Exports supprimés6
Signatures modifiées4
Membres de classes ou d’interfaces supprimés12
Membres de classes ou d’interfaces modifiés18
Nouvelles dépréciations0
Changements d’exigences (engines, dépendances peer)1
Nouveaux exports44

Exports supprimés

importexportkindAvant
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

Signatures modifiées

exportAvantAprès
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>)[]

Membres de classes ou d’interfaces supprimés

memberimportAvant
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

Membres de classes ou d’interfaces modifiés

memberAvantAprès
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

Nouvelles dépréciations

Aucun détecté.

Changements d’exigences (engines, dépendances peer)

AvantAprès
engines.node>= 6>= 14.6
Nouveaux 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

Questions fréquentes

Quels sont les changements incompatibles en passant de yaml 1 à 2 ?

Entre yaml 1.10.3 et 2.9.1, Vigia a trouvé 6 exports supprimés, 4 signatures modifiées et 30 membres de classes ou d’interfaces supprimés ou modifiés.

Qu’est-ce qui a été déprécié dans yaml 2 ?

0 exports ou membres sont désormais marqués comme dépréciés dans yaml 2.9.1.

Pour les agents

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