Skip to content

Releases: eemeli/yaml

v1.7.0

25 Sep 13:21
Compare
Choose a tag to compare

New Features

  • Add optional id, customTags arguments to Document#setSchema()
  • Keep explicit keys with block scalar values as such
  • Add simpleKeys option (#122)

Improved Errors & Warnings

  • Add more context to pretty error messages
  • Improve error for missing flow collection terminator char
  • Use offset when prettifying flow collection character errors
  • Add warning when stringifying map/seq-valued keys for JS Object
  • Use process.emitWarning rather than console.warn in YAML.parse if possible

Bugfixes

  • Fix aliased anchors on null-value nodes (6KGN)
  • Fix stringification of timestamp-like strings in a YAML 1.1 context (fixes #119)
  • Consider input ending after implicit map key : as valid (Fixes #120)

v1.6.0

23 May 14:10
Compare
Choose a tag to compare
  • Allow same-column end for flow collections (#108, #113, #114)
  • Add Document#directivesEndMarker (#112)
  • Add directives-end and document-end marker ranges to CST Document during parse

v1.5.1

05 May 13:17
Compare
Choose a tag to compare
  • Apply previous document directives in YAML 1.1 streams (#109)
  • Fix export of Type from "yaml/util"
  • Update dependencies

v1.5.0

06 Apr 07:24
Compare
Choose a tag to compare

New Features

  • Refactor exports (#99, #107)
    • In addition to main export, use only yaml/parse-cst, yaml/types and yaml/util
    • Drop public export of custom tag objects
    • Rename tags option as customTags, and allow/prefer string identifiers for built-in custom tags
    • Add warnings to deprecated endpoints (set _YAML_SILENCE_DEPRECATION_WARNINGS to disable)
    • Drop babel-plugin-add-module-exports, using instead custom untranspiled CommonJS files for public exports
  • Add protection for exponential entity expansion attacks, such as Billion laughs and quadratic expansion attacks (#104)
    • Add maxAliasCount option, defaulting to max 100 aliases for any anchor
    • For Object, stringify mapping key as YAML rather than JSON
  • Simplify custom tag creation
    • Add default stringifier (item, ...) => item.toString(...) for collections
    • Add Schema#createPair(key, value, ctx); drop create{Map,Seq} exports
    • Improve & expand documentation on custom tags
  • Preserve float formatting when parsed to Document (#97)
    • Add optional minFractionDigits property to numbers
    • Add EXP format handling for float numbers
    • Allow scalar resolvers to return a Scalar instance
  • Add prettyErrors option, which makes errors prettier and drops their source reference (#96)
  • Add common ancestor YAMLError for error classes
  • Reorganise files, e.g. separating tags/ from schema/ and adding constants.js

Bugfixes

  • Tag presence in AST node now corresponds to explicit tags in YAML source (#97)
  • Add Pair#addToJSMap(ctx, map), fixing merge of anchor seq with mapAsMap: true

v1.4.0

07 Mar 19:49
Compare
Choose a tag to compare

New Features

  • Add @babel/runtime as a dependency for use via "browser" (#83)
  • Support circular objects, representing circular references using YAML alias nodes when encountered during YAML.stringify() (#84)
  • Deprecate the class attribute of tags, replacing it with the more generic identify(value) (#86)
  • Turn the string stringifier into a generic scalar stringifier, fallback to it by default, and export it as stringify() from yaml/schema (#86)
  • Add yaml-playground as a git submodule, extending ESLint rules
  • Add start script, providing an interactive node env with YAML defined

Bugfixes

  • Drop overeager browser polyfill generation; use playground/src/polyfill.js instead
  • Add BrowserStack tests to Travis CI
  • Accept arrays of tag objects as values of tags option (#90)
  • Allow for blank lines after less-indented comments (#91)

v1.3.2

08 Feb 21:32
Compare
Choose a tag to compare
  • Prevent clashes between the namespaces of top-level Nodes and their values (82ac5a8)
  • Stringify pairs with single-line flow collection values on a single line (#85)
  • Fix stringification of objects set in collection values (#87)

v1.3.1

27 Jan 11:44
Compare
Choose a tag to compare
  • Use one- rather than zero-based indexing for line/col positions (f117880)

v1.3.0

27 Jan 09:11
Compare
Choose a tag to compare

New Features

  • Add context.root and rangeAsLinePos to CST nodes (#67, #68)
  • Add collection accessor methods (#74)
    • New methods: add/delete/get/has/set and addIn/deleteIn/getIn/hasIn/setIn
    • Available on all collections as well as documents containing a collection
  • Include a separate browser build in the release (#73)
    • Used by Webpack, Rollup, etc. via the "browser" value in package.json
    • Uses a Browserslist config of > 0.5%, not dead to (currently) support at least IE 11
    • Has a dependency on @babel/runtime that is not included in the package.json dependencies
  • Optimise the Node.js release to leave out unnecessary polyfills (87beb89)
  • Run CI tests on latest, LTS & 6.0.0 versions of Node.js (#70, #73)
  • Move & reorganise test files under tests/ (12876df)
  • Add .editorconfig (#69)

Bugfixes

  • Add missing tag value to !!set (#78)
  • Improve tag matcher test to allow supporting Symbols (#79)

v1.2.1

17 Jan 10:16
Compare
Choose a tag to compare
  • Keep empty line in comment lost during parsing (#75, #76)

v1.2.0

01 Jan 09:33
Compare
Choose a tag to compare

New Features

  • Support blank lines (#64)
    • Add BLANK_LINE nodes to the CST
    • Add a boolean property spaceBefore for all AST nodes
    • cst: Assign comments & blank lines at end of collection to parent unless sufficiently indented
    • Always separate document comments from the rest by a blank line
  • Add missing YAML 1.1 collections: !!omap, !!pairs, and !!set (#65)
  • Add tag argument for createNode(), along with its refactored schema-specific implementation (29f399b)
  • Add optional createNode and nodeClass properties to tag objects (bcb8d9c, 3ae63bc)
  • Add property based tests using fast-check, thanks to @dubzzz (#62)

Bugfixes

  • Fix parsing of minimal strings: '', '-', '?', ':' (#61)
  • Revert earlier fix for #48, which is now properly handled thanks to the fix for #57 (#59)
  • cst/ParseContext: Stop advancing node.range.end past newline (08571ff)
  • cst/PlainValue: Limit valueRange.end to actual value end (0001333)
  • cst: Stop breaking the spec by allowing tab indents for map values (572f540)
  • Stop aliasing Pair comment to the comment of its value (9b49ddb, 6d3cb36):
    key: # this is now a pair comment
      value
  • Render maps with all null values as ? a\n? b\n or { a, b } (40b7a2a)