linx-simulator2/node_modules/config/defer.js

15 lines
539 B
JavaScript
Raw Normal View History

2019-09-18 08:11:16 +00:00
// Create a deferredConfig prototype so that we can check for it when reviewing the configs later.
function DeferredConfig () {
}
DeferredConfig.prototype.resolve = function (config, original) {};
// Accept a function that we'll use to resolve this value later and return a 'deferred' configuration value to resolve it later.
function deferConfig (func) {
var obj = Object.create(DeferredConfig.prototype);
obj.resolve = func;
return obj;
}
module.exports.deferConfig = deferConfig;
module.exports.DeferredConfig = DeferredConfig;