From e42513624b9e6976ac76f6eda20c8aee6f2d1ae4 Mon Sep 17 00:00:00 2001 From: Louis-Dominique Dubeau Date: Fri, 9 Sep 2016 19:33:01 -0400 Subject: [PATCH] Redesign UMD code to allow imports --- lib/chai-as-promised.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/chai-as-promised.js b/lib/chai-as-promised.js index 78dfb0e..c34cd41 100644 --- a/lib/chai-as-promised.js +++ b/lib/chai-as-promised.js @@ -1,26 +1,24 @@ -(function () { +(function (factory) { "use strict"; - - // Module systems magic dance. - /* istanbul ignore else */ if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { // NodeJS - module.exports = chaiAsPromised; + module.exports = factory(); } else if (typeof define === "function" && define.amd) { // AMD - define(function () { - return chaiAsPromised; - }); + define(factory); } else { /*global self: false */ // Other environment (usually