Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
attributes = function (attrs) {
attrs = compact.call(map.call(attrs, function (attr) {
if (startsWith.call(attr.name, 'data-')) return null;
return (!re.test(attr.name) ? ('\'' + attr.name + '\'') : attr.name) +
': ' + text(attr.value);
}));
if (!attrs.length) return null;
return '{ ' + attrs.join(', ') + ' }';
};
element = function (dom, nest) {
return dom.nodeName.toLowerCase() + '(' +
compact.call([dom.attributes.length ? attributes(dom.attributes) : null,
dom.childNodes.length ? childNodes(dom.childNodes, nest,
dom.attributes.length) : null]).join(', ') + ')';
};
childNodes = function (nodes, nest, doBreak) {
var firstDone;
return compact.call(map.call(nodes, function (node, idx) {
var str, type = node.nodeType;
if (type === 1) {
str = ((doBreak || firstDone) ? ('\n' + repeat.call('\t', nest)) : '') +
element(node, nest + 1);
firstDone = true;
return str;
}
if ((type === 3) || (type === 4)) {
if (node.data.trim()) {
str = (idx ? ' ' : '') + text2(node.data.trim());
firstDone = true;
return str;
}
return null;
}
if (type === 8) return null;
.map(resourceName => {
const resource = this.resources[resourceName];
if (resource.Type !== "AWS::DynamoDB::Table") return null;
const configList = compact.call(
objToArray(
resolvedPluginConfig,
(config, pattern) =>
minimatch(resourceName, pattern) ? copyDeep(config) : null
)
);
return {
resource: { name: resourceName, value: resource },
config: assignDeep({}, copyDeep(tableDefaults), ...configList)
};
})
.filter(Boolean);