Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
function addSrcSetDependencies(srcset: string) {
const newSources = [];
srcset.split(',').forEach(source => {
const pair = source.trim().split(' ');
if (pair.length === 0) return;
pair[0] = addDependency(pair[0]);
newSources.push(pair.join(' '));
});
return newSources.join(',');
}
const res = parse(code, { lowerCaseAttributeNames: true });
res.walk = api.walk;
res.match = api.match;
res.walk(node => {
if (node == null) {
return node;
}
if (node.attrs) {
if (node.tag === 'meta') {
if (
!Object.keys(node.attrs).some(attr => {
const values = META[attr];
return values && values.includes(node.attrs[attr]);
})
) {
return node;
if (
componentType !== "stateless" &&
componentType !== "es5" &&
componentType !== "es6"
) {
componentType = "es6";
}
if (moduleType !== "es6" && moduleType !== "cjs") {
moduleType = "es6";
}
var components = [];
var delimiter = options.moduleFileNameDelimiter || "";
api.walk.bind(tree)(collectComponents(components));
var reactComponents = toReactComponents(
componentType,
toJsxAST(
mergeByInstance(
components.map(assignByName).map(clearAndRenderComponents)
)
)
);
if (moduleType) {
return formatCode(
toCode(toModules(moduleType, delimiter, reactComponents))
);
}
async parse(code) {
let res = await posthtmlTransform.parse(code, this);
res.walk = api.walk;
res.match = api.match;
return res;
}
"use strict";
const walk = require("posthtml/lib/api").walk,
get = require("lodash/get"),
addClassNameToNode = require("../addClassNameToNode"),
eligibleTags = [
"button",
"input"
],
className = ":default";
module.exports = function(node) {
let test = false;
if(!node.tag || node.tag !== "form" || !node.content.length) {
return node;
}
async parse(code) {
let res = await posthtmlTransform.parse(code, this);
res.walk = api.walk;
res.match = api.match;
return res;
}
function childrenToComponent(component) {
var children = [];
api.walk.bind(component)(function(node) {
if (isComponent(node)) {
var name = getComponentName(node);
children.push(name);
return {
tag: name
};
}
return toJsxAttrs(node);
});
return {