Skip to content

v2.0.0-10

Compare
Choose a tag to compare
@eemeli eemeli released this 31 Dec 15:14

This version of yaml has been published to npm using the next dist-tag, so install it with:

npm install --save-exact yaml@next

BREAKING CHANGES

  • The TS type of doc.directives now indicates it as optional. Its actual value has not changed, but the type needs to account for what might happen if doc.setSchema() is called with a null version argument. (#344)

New Features

Add a compatibility checker (#335)

Adds a new schema option compat: string | Tags. If set, warns during composition about compatibility issues with the given schema. When stringifying, uses scalar styles that are parsed correctly by the compat schema as well as the actual schema.

Support for Non-YAML Schemas

While YAML is a superset of JSON, it isn't a strict superset of other JSON-based configuration languages. Feature-wise, though, these languages are as a rule a subset of YAML features, so let's build some groundwork for supporting them as well by making additional aspects of this library configurable.

  • Add commentString option, refactor internals to support it (#336)
  • Add toStringDefaults option (#337)
  • Add collectionStyle option (#343)
  • Allow for Schema instance as schema option (#344)

Test Improvements

  • Add json-test-suite as git submodule (#340)
  • Update to latest yaml-test-suite data
  • Add {} and [] indicators to flow maps & sequences in test-events output (used by the YAML Test Matrix)
  • Use --target es5 in test:dist:types script (#334)

Bugfixes

  • Allow for custom schemas in TS types (#325)
  • Flow collection expected-end error (#328)
  • parser: flow-error-end token should not advance offset
  • Handle duplicate flow : indicators correctly
  • Correctly stringify non-finite scalars with format: 'EXP'
  • Allow block map with flow collection key as explicit key
  • Do not use negative indent for any parser tokens