/var/www/myprog.com.ua/server/node/node_modules/bcrypt
NameSizeModeActions
.github/-0755rm
examples/-0755rm
lib/-0755rm
src/-0755rm
test/-0755rm
.editorconfig2840644editdlrm
.travis.yml13110644editdlrm
appveyor.yml9210644editdlrm
bcrypt.js73150644editdlrm
binding.gyp15860644editdlrm
CHANGELOG.md39020644editdlrm
ISSUE_TEMPLATE.md10260644editdlrm
LICENSE10600644editdlrm
Makefile2150644editdlrm
package.json25020644editdlrm
promises.js11480644editdlrm
README.md172450644editdlrm
SECURITY.md4740644editdlrm
test-docker.sh2860755editdlrm
Edit: /var/www/myprog.com.ua/server/node/node_modules/bcrypt/promises.js (1148B)
'use strict'; var Promise = global.Promise; /// encapsulate a method with a node-style callback in a Promise /// @param {object} 'this' of the encapsulated function /// @param {function} function to be encapsulated /// @param {Array-like} args to be passed to the called function /// @return {Promise} a Promise encapsulating the function module.exports.promise = function (fn, context, args) { if (!Array.isArray(args)) { args = Array.prototype.slice.call(args); } if (typeof fn !== 'function') { return Promise.reject(new Error('fn must be a function')); } return new Promise(function(resolve, reject) { args.push(function(err, data) { if (err) { reject(err); } else { resolve(data); } }); fn.apply(context, args); }); }; /// @param {err} the error to be thrown module.exports.reject = function (err) { return Promise.reject(err); }; /// changes the promise implementation that bcrypt uses /// @param {Promise} the implementation to use module.exports.use = function(promise) { Promise = promise; };