smart-eql

0.2.0 • Public • Published

smart-eql Build Status

Smart deep equality testing for Node.js. This was forked from deep-eql, with the addition of regex and function testing.

Installation

smart-eql is available on npm.

$ npm install --save smart-eql

Usage

Rules

  • Strict equality for non-traversable nodes according to egal.
    • eql(NaN, NaN).should.be.true;
    • eql(-0, +0).should.be.false;
  • Arguments are not Arrays:
    • eql([], arguments).should.be.false;
    • eql([], Array.prototype.slice.call(arguments)).should.be.true;
  • Use regex to test values:
    • eql({a: /he.+world/}, {a: 'hello world'}).should.be.true;
    • eql('hxllo world', /he.+world/).should.be.false;

Package Sidebar

Install

npm i smart-eql

Weekly Downloads

2

Version

0.2.0

License

MIT

Last publish

Collaborators

  • andyday