aboutsummaryrefslogtreecommitdiff
path: root/node_modules/universalify/index.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
commitcc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch)
tree92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/universalify/index.js
parent3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff)
remove node_modules
Diffstat (limited to 'node_modules/universalify/index.js')
-rw-r--r--node_modules/universalify/index.js25
1 files changed, 0 insertions, 25 deletions
diff --git a/node_modules/universalify/index.js b/node_modules/universalify/index.js
deleted file mode 100644
index 0c9ba393c..000000000
--- a/node_modules/universalify/index.js
+++ /dev/null
@@ -1,25 +0,0 @@
-'use strict'
-
-exports.fromCallback = function (fn) {
- return Object.defineProperty(function () {
- if (typeof arguments[arguments.length - 1] === 'function') fn.apply(this, arguments)
- else {
- return new Promise((resolve, reject) => {
- arguments[arguments.length] = (err, res) => {
- if (err) return reject(err)
- resolve(res)
- }
- arguments.length++
- fn.apply(this, arguments)
- })
- }
- }, 'name', { value: fn.name })
-}
-
-exports.fromPromise = function (fn) {
- return Object.defineProperty(function () {
- const cb = arguments[arguments.length - 1]
- if (typeof cb !== 'function') return fn.apply(this, arguments)
- else fn.apply(this, arguments).then(r => cb(null, r), cb)
- }, 'name', { value: fn.name })
-}