Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

posthtml-ast-compare

codsen62MIT5.2.2

deprecated - use 'ast-compare' instead

ast, posthtml, compare, object, array, tree, posthtml-tree, posthtmltree, html, xml, parser, subset, equal

readme

posthtml-ast-compare

DEPRECATED

Use ast-compare instead.
2017-10-24

Licence

MIT License (MIT)

Copyright © 2017 Codsen Ltd, Roy Revelt

changelog

Change Log

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

5.2.0 - 2017-10-24

Changed

  • ✨ switched to ESLint on airbnb-base config, with 3 exceptions: 1. no semicolons, and 2. plus-plus allowed in loops

5.1.0 - 2017-07-31

Added

  • ✨ Replaced object-assign with ES6 native Object.assign

5.0.0 - 2017-06-10

BREAKING API CHANGES. NOW AIMING TO MATCH THE JSON SPEC.

Changed

  • 🔧 Now the argument types have the same requirements as JSON: no date types, no hardcoded undefined, no functions or other nasties.
  • 🔧 On the other hand, Boolean, null and numeric values are now accepted and compared correctly.
  • 🔧 Put the functions into a separate util file.

    Added

  • ✨ More tests, the coverage is still solid 100%

4.0.0 - 2017-04-01

BREAKING API CHANGES.

Added

  • ✨ Incorporated the functionality of posthtml-ast-loose-compare into this, making aforementioned lib redundant. Set opts.hungryForWhitespace = true to activate the loose comparison mode where empty space is not considered to be a content and is matched to anything. Also, two strictly non-equal pieces of string, containing only a white space would be matched as equal when opts.hungryForWhitespace = true.
  • ✨ Added a strict compare mode, where everything has to match other side exactly. See opts.matchStrictly options key.
  • ✨ Even more tests.

    Changed

  • 🔧 Tweaked notation of the unit test numbers.

    Unchanged

  • 🏀 Unit test code coverage is still 100%

3.0.0 - 2017-03-03

Changed

  • 🔧 Rewrote the whole thing. More elegant and done with less code and fewer deps.

    Added

  • ✨ Even more tests.

    Unchanged

  • 🏀 Unit test code coverage is still 100%

2.0.0 - 2017-03-02

Changed

  • 🔧 Updated API. Now result is strictly boolean: true or false. Even when inputs are missing or don't make sense (are functions for example). Previously on nonsense input it was returning undefined, but undefined is better suited for missing, undefined things, not answers.
  • 🔧 Algorithm of this library is making use of third argument, which is for internal use, when library is recursively calling itself. However, there were only hopes that users will not accidentally put the third argument in. In v.2 this is solved by wrapping the main function with another container function which has only two arguments. Outside API doesn't consume third input argument.
  • 🔧 Input arguments are cloned and clones are used instead. This is to prevent accidental mutation of the objects and/or arrays in the input.