@webreflection/lie
Advanced tools
Comparing version 0.1.0 to 0.1.1
'use strict'; | ||
module.exports = typeof Promise === 'function' ? Promise : function (fn) { | ||
let queue = [], resolved = 0; | ||
fn(() => { | ||
let queue = [], resolved = 0, value; | ||
fn($ => { | ||
value = $; | ||
resolved = 1; | ||
@@ -10,4 +11,4 @@ queue.splice(0).forEach(then); | ||
function then(fn) { | ||
return (resolved ? setTimeout(fn) : queue.push(fn)), this; | ||
return (resolved ? setTimeout(fn, 0, value) : queue.push(fn)), this; | ||
} | ||
}; |
export default typeof Promise === 'function' ? Promise : function (fn) { | ||
let queue = [], resolved = 0; | ||
fn(() => { | ||
let queue = [], resolved = 0, value; | ||
fn($ => { | ||
value = $; | ||
resolved = 1; | ||
@@ -9,4 +10,4 @@ queue.splice(0).forEach(then); | ||
function then(fn) { | ||
return (resolved ? setTimeout(fn) : queue.push(fn)), this; | ||
return (resolved ? setTimeout(fn, 0, value) : queue.push(fn)), this; | ||
} | ||
}; |
{ | ||
"name": "@webreflection/lie", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A badly implemented Promise", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/index.js", |
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
1580
25