Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chai-as-promised

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai-as-promised - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

16

lib/chai-as-promised.js

@@ -24,2 +24,8 @@ (function (chaiAsPromised) {

// Chai as Promised needs a way to detect that chaining-time is over and it should return a promise resolved with
// `undefined`, instead of with a chainable assertion. All function asserts make this assumption, but most
// properties exist only for chaining purposes, so we keep a list of the ones that signal "done"ness here. TODO:
// make this less of a hack.
var capstoneProperties = ["arguments", "empty", "exist", "false", "ok", "true"];
function property(name, asserter) {

@@ -214,3 +220,4 @@ Object.defineProperty(Assertion.prototype, name, {

return promiseToDoAsserter(function (assertion) {
return assertion[asserterName].apply(assertion, args);
// Don't pass through the result: this is the end of the chain
assertion[asserterName].apply(assertion, args);
});

@@ -221,3 +228,8 @@ };

return promiseToDoAsserter(function (assertion) {
return assertion[asserterName];
var result = assertion[asserterName];
// Only pass through the result if we want to continue chaining.
if (capstoneProperties.indexOf(asserterName) === -1) {
return result;
}
});

@@ -224,0 +236,0 @@ };

2

package.json

@@ -9,3 +9,3 @@ {

],
"version": "1.0.0",
"version": "1.1.0",
"author": "Domenic Denicola <domenic@domenicdenicola.com> (http://domenicdenicola.com)",

@@ -12,0 +12,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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