
| Current Path : /usr/share/nodejs/json-stringify-safe/node_modules/must/lib/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //usr/share/nodejs/json-stringify-safe/node_modules/must/lib/thenable.js |
var wrap = require("lodash.wrap")
var lookupGetter = require("oolong").lookupGetter
exports = module.exports = function(must, promisify) {
must = Object.create(must)
for (var name in must)
if (hasFunction(must, name)) must[name] = promisify(must[name])
Object.defineProperty(must, "assert", {
value: wrap(must.assert, exports.prototype.assert),
configurable: true, writable: true
})
return must
}
exports.prototype.assert = function assert(orig, ok, msg, opts) {
opts = opts ? Object.create(opts) : {}
if ("stack" in this) opts.stack = this.stack
orig.call(this, ok, msg, opts)
}
exports.prototype.then = function(fn, args, actual) {
this.actual = actual
fn.apply(this, args)
}
function hasFunction(obj, name) {
return !lookupGetter(obj, name) && typeof obj[name] == "function"
}