skema
Version:
Skema provides a handy & composable way to validate / transform / purify the input data.
35 lines (26 loc) • 833 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Options = void 0;
var _promiseFaker = _interopRequireDefault(require("promise-faker"));
var _promise = require("promise.extra");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const promiseExtra = {
series: _promise.series,
waterfall: _promise.waterfall
};
const IS_DEFAULT = (rawParent, key) => !(key in rawParent);
class Options {
constructor({
// For now, there is only one option
async = false,
isDefault = IS_DEFAULT
}) {
this.promise = async ? Promise : _promiseFaker.default;
this.promiseExtra = async ? promiseExtra : (0, _promise.factory)(_promiseFaker.default);
this.async = async;
this.isDefault = isDefault;
}
}
exports.Options = Options;
;