@segment/analytics-generic-utils
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -10,5 +10,20 @@ "use strict"; | ||
var reject; | ||
var settled = false; | ||
var promise = new Promise(function (_resolve, _reject) { | ||
resolve = _resolve; | ||
reject = _reject; | ||
resolve = function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
settled = true; | ||
_resolve.apply(void 0, args); | ||
}; | ||
reject = function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
settled = true; | ||
_reject.apply(void 0, args); | ||
}; | ||
}); | ||
@@ -19,2 +34,3 @@ return { | ||
promise: promise, | ||
isSettled: function () { return settled; }, | ||
}; | ||
@@ -21,0 +37,0 @@ }; |
@@ -7,5 +7,20 @@ /** | ||
var reject; | ||
var settled = false; | ||
var promise = new Promise(function (_resolve, _reject) { | ||
resolve = _resolve; | ||
reject = _reject; | ||
resolve = function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
settled = true; | ||
_resolve.apply(void 0, args); | ||
}; | ||
reject = function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
settled = true; | ||
_reject.apply(void 0, args); | ||
}; | ||
}); | ||
@@ -16,4 +31,5 @@ return { | ||
promise: promise, | ||
isSettled: function () { return settled; }, | ||
}; | ||
}; | ||
//# sourceMappingURL=create-deferred.js.map |
@@ -8,3 +8,4 @@ /** | ||
promise: Promise<T>; | ||
isSettled: () => boolean; | ||
}; | ||
//# sourceMappingURL=create-deferred.d.ts.map |
{ | ||
"name": "@segment/analytics-generic-utils", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
@@ -7,6 +7,14 @@ /** | ||
let reject!: (reason: any) => void | ||
let settled = false | ||
const promise = new Promise<T>((_resolve, _reject) => { | ||
resolve = _resolve | ||
reject = _reject | ||
resolve = (...args) => { | ||
settled = true | ||
_resolve(...args) | ||
} | ||
reject = (...args) => { | ||
settled = true | ||
_reject(...args) | ||
} | ||
}) | ||
return { | ||
@@ -16,3 +24,4 @@ resolve, | ||
promise, | ||
isSettled: () => settled, | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23581
405