Оновлення yaml з 1.x до 2.x
Порівняння публічного API yaml 1.10.3 і 2.9.1, обчислене автоматично за їхніми типами TypeScript. Змінена сигнатура — можлива несумісна зміна, а не гарантія.
Підсумок
| Видалені шляхи імпорту | 0 |
|---|---|
| Видалені експорти | 6 |
| Змінені сигнатури | 4 |
| Видалені члени класів або інтерфейсів | 12 |
| Змінені члени класів або інтерфейсів | 18 |
| Нові застарівання | 0 |
| Зміни вимог (engines, peer-залежності) | 1 |
| Нові експорти | 44 |
Видалені експорти
| import | export | kind | Було |
|---|---|---|---|
yaml | AST | namespace | namespace |
yaml | Options | interface | interface |
yaml | parseCST | function | (str: string): ParsedCST |
yaml | createNode | function | (value: any, wrapScalars?: true | undefined, tag?: string | undefined): YAMLMap | YAMLSeq | Scalar | (value: any, wrapScalars: false, tag?: string | undefined): string | number | boolean | YAMLMap | YAMLSeq | null |
yaml | scalarOptions | variable | { binary: Binary; bool: Bool; int: Int; null: Null; str: Str; } |
yaml | defaultOptions | variable | Options |
Змінені сигнатури
| export | Було | Стало |
|---|---|---|
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>)[] |
Видалені члени класів або інтерфейсів
| member | import | Було |
|---|---|---|
Document.tag | yaml | never |
Document.type | yaml | Type.DOCUMENT |
Document.items | yaml | any[] |
Document.parse | yaml | (cst: Document): Document |
Document.anchors | yaml | Anchors |
Document.cstNode | yaml | Document | undefined |
Document.version | yaml | string | undefined |
Document.spaceBefore | yaml | boolean | undefined |
Document.tagPrefixes | yaml | TagPrefix[] |
Document.setTagPrefix | yaml | (handle: string, prefix: string): void |
Document.listNonDefaultTags | yaml | (): string[] |
Document.directivesEndMarker | yaml | boolean | undefined |
Змінені члени класів або інтерфейсів
| member | Було | Стало |
|---|---|---|
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 | undefined | Range | 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.schema | Schema | undefined | Schema |
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.comment | string | null | undefined | string | null |
Document.contents | any | Strict 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.commentBefore | string | null | undefined | string | null |
Нові застарівання
Не виявлено.
Зміни вимог (engines, peer-залежності)
| Було | Стало | |
|---|---|---|
engines.node | >= 6 | >= 14.6 |
Нові експорти (44)
| import | export | kind |
|---|---|---|
yaml | Node | type |
yaml | Pair | class |
yaml | Tags | type |
yaml | Alias | class |
yaml | Lexer | class |
yaml | Range | type |
yaml | TagId | type |
yaml | isMap | variable |
yaml | isSeq | variable |
yaml | visit | function |
yaml | Parser | class |
yaml | Scalar | class |
yaml | Schema | class |
yaml | isNode | function |
yaml | isPair | variable |
yaml | YAMLMap | class |
yaml | YAMLSeq | class |
yaml | YAMLSet | class |
yaml | isAlias | variable |
yaml | visitor | type |
yaml | Composer | class |
yaml | YAMLOMap | class |
yaml | isScalar | variable |
yaml | ErrorCode | type |
yaml | ScalarTag | interface |
yaml | YAMLError | class |
yaml | visitorFn | type |
yaml | ParsedNode | type |
yaml | isDocument | variable |
yaml | visitAsync | function |
yaml | EmptyStream | interface |
yaml | LineCounter | class |
yaml | ToJSOptions | type |
yaml | YAMLWarning | class |
yaml | ParseOptions | type |
yaml | asyncVisitor | type |
yaml | isCollection | function |
yaml | CollectionTag | interface |
yaml | SchemaOptions | type |
yaml | YAMLParseError | class |
yaml | asyncVisitorFn | type |
yaml | DocumentOptions | type |
yaml | ToStringOptions | type |
yaml | CreateNodeOptions | type |
Поширені запитання
Які несумісні зміни під час оновлення yaml з 1 до 2?
Між yaml 1.10.3 і 2.9.1 Vigia знайшла видалених експортів: 6, змінених сигнатур: 4, видалених або змінених членів класів та інтерфейсів: 30.
Що застаріло в yaml 2?
У yaml 2.9.1 новими застарілими позначено експортів або членів: 0.
Для агентів
GET https://vigia.coredls.cloud/v1/packages/npm/yaml/upgrade?from=1.10.3&to=2.9.1