cartodb-4.42/lib/assets/javascripts/builder/helpers/required-opts.js
2024-04-06 05:25:13 +00:00

13 lines
407 B
JavaScript
Executable File

var _ = require('underscore');
module.exports = function checkAndBuildRequiredOpts (actualOpts, requiredOpts, context) {
if (requiredOpts === void 0) {
throw new Error('Opts are required');
}
_.each(requiredOpts, function (item) {
if (actualOpts === void 0 || actualOpts[item] === void 0) throw new Error(item + ' is required');
context['_' + item] = actualOpts[item];
}, context);
};