tra-analysis/website/functions/node_modules/espurify/lib/create-whitelist.js

18 lines
524 B
JavaScript
Raw Normal View History

2019-01-06 19:14:45 +00:00
'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;
};