Socket
Socket
Sign inDemoInstall

chai

Package Overview
Dependencies
Maintainers
2
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai - npm Package Compare versions

Comparing version 4.3.10 to 4.4.1

3

lib/chai/assertion.js

@@ -55,2 +55,4 @@ /*!

*
* - `eql`: This flag contains the deepEqual function to be used by the assertion.
*
* @param {Mixed} obj target of the assertion

@@ -68,2 +70,3 @@ * @param {String} msg (optional) custom error message

flag(this, 'message', msg);
flag(this, 'eql', config.deepEqual || util.eql);

@@ -70,0 +73,0 @@ return util.proxify(this);

@@ -93,3 +93,29 @@ module.exports = {

proxyExcludedKeys: ['then', 'catch', 'inspect', 'toJSON']
proxyExcludedKeys: ['then', 'catch', 'inspect', 'toJSON'],
/**
* ### config.deepEqual
*
* User configurable property, defines which a custom function to use for deepEqual
* comparisons.
* By default, the function used is the one from the `deep-eql` package without custom comparator.
*
* // use a custom comparator
* chai.config.deepEqual = (expected, actual) => {
* return chai.util.eql(expected, actual, {
* comparator: (expected, actual) => {
* // for non number comparison, use the default behavior
* if(typeof expected !== 'number') return null;
* // allow a difference of 10 between compared numbers
* return typeof actual === 'number' && Math.abs(actual - expected) < 10
* }
* })
* };
*
* @param {Function}
* @api public
*/
deepEqual: null
};

2

package.json

@@ -20,3 +20,3 @@ {

],
"version": "4.3.10",
"version": "4.4.1",
"repository": {

@@ -23,0 +23,0 @@ "type": "git",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc