You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
unboundedpress/node_modules/espurify/lib/create-whitelist.js

18 lines
524 B
JavaScript

5 years ago
'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;
};