tra-analysis/website/functions/node_modules/espurify/lib/create-whitelist.js
2019-01-06 13:14:45 -06:00

18 lines
524 B
JavaScript

'use strict';
var defaultProps = require('./ast-properties');
var objectKeys = require('core-js/library/fn/object/keys');
var assign = require('core-js/library/fn/object/assign');
module.exports = function createWhitelist (options) {
var opts = assign({}, options);
var typeName, i, len;
var keys = objectKeys(defaultProps);
var result = {};
for (i = 0, len = keys.length; i < len; i += 1) {
typeName = keys[i];
result[typeName] = defaultProps[typeName].concat(opts.extra || []);
}
return result;
};