Initial
This commit is contained in:
21
resources/app/node_modules/catering/LICENSE
generated
vendored
Normal file
21
resources/app/node_modules/catering/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright © 2018 Vincent Weevers
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
28
resources/app/node_modules/catering/index.js
generated
vendored
Normal file
28
resources/app/node_modules/catering/index.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
'use strict'
|
||||
|
||||
var nextTick = require('./next-tick')
|
||||
|
||||
exports.fromCallback = function (callback, symbol) {
|
||||
if (callback === undefined) {
|
||||
var promise = new Promise(function (resolve, reject) {
|
||||
callback = function (err, res) {
|
||||
if (err) reject(err)
|
||||
else resolve(res)
|
||||
}
|
||||
})
|
||||
|
||||
callback[symbol !== undefined ? symbol : 'promise'] = promise
|
||||
} else if (typeof callback !== 'function') {
|
||||
throw new TypeError('Callback must be a function')
|
||||
}
|
||||
|
||||
return callback
|
||||
}
|
||||
|
||||
exports.fromPromise = function (promise, callback) {
|
||||
if (callback === undefined) return promise
|
||||
|
||||
promise
|
||||
.then(function (res) { nextTick(() => callback(null, res)) })
|
||||
.catch(function (err) { nextTick(() => callback(err)) })
|
||||
}
|
||||
1
resources/app/node_modules/catering/next-tick-browser.js
generated
vendored
Normal file
1
resources/app/node_modules/catering/next-tick-browser.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = typeof queueMicrotask === 'function' ? queueMicrotask : (fn) => Promise.resolve().then(fn)
|
||||
1
resources/app/node_modules/catering/next-tick.js
generated
vendored
Normal file
1
resources/app/node_modules/catering/next-tick.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = process.nextTick.bind(process)
|
||||
28
resources/app/node_modules/catering/package.json
generated
vendored
Normal file
28
resources/app/node_modules/catering/package.json
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "catering",
|
||||
"version": "2.1.1",
|
||||
"description": "Simple utility to allow your module to be consumed with a callback or promise",
|
||||
"license": "MIT",
|
||||
"author": "Vincent Weevers",
|
||||
"types": "index.d.ts",
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts",
|
||||
"next-tick.js",
|
||||
"next-tick-browser.js"
|
||||
],
|
||||
"browser": {
|
||||
"./next-tick.js": "./next-tick-browser.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"airtap": "^4.0.4",
|
||||
"airtap-playwright": "^1.0.1",
|
||||
"standard": "^16.0.4",
|
||||
"tape": "^5.4.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"repository": "vweevers/catering",
|
||||
"homepage": "https://github.com/vweevers/catering"
|
||||
}
|
||||
Reference in New Issue
Block a user