Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} else {
arg = args[cursor++];
}
// this points to a react element!
if (React.isValidElement(arg)) {
rv.push(React.cloneElement(arg, {key: idx}));
// not a react element, fuck around with it so that sprintf.format
// can format it for us. We make sure match[2] is null so that we
// do not go down the object path, and we set match[1] to the first
// index and then pass an array with two items in.
} else {
match[2] = null;
match[1] = 1;
rv.push(<span>
{sprintf.format([match], [null, arg])}
</span>);
}
}
});
arg = args[parseInt(match[1], 10) - 1];
} else {
arg = args[cursor++];
}
// this points to a react element!
if (React.isValidElement(arg)) {
rv.push(React.cloneElement(arg, {key: idx}));
// not a react element, fuck around with it so that sprintf.format
// can format it for us. We make sure match[2] is null so that we
// do not go down the object path, and we set match[1] to the first
// index and then pass an array with two items in.
} else {
match[2] = null;
match[1] = 1;
rv.push(<span>{sprintf.format([match], [null, arg])}</span>);
}
}
});
arg = args[parseInt(match[1], 10) - 1];
} else {
arg = args[cursor++];
}
// this points to a react element!
if (React.isValidElement(arg)) {
nodes.push(React.cloneElement(arg, {key: idx}));
} else {
// not a react element, fuck around with it so that sprintf.format
// can format it for us. We make sure match[2] is null so that we
// do not go down the object path, and we set match[1] to the first
// index and then pass an array with two items in.
match[2] = null;
match[1] = 1;
nodes.push(<span>{sprintf.format([match], [null, arg])}</span>);
}
});
} else {
let arg = null;
if (match[2]) {
arg = args[0][match[2][0]];
} else if (match[1]) {
arg = args[parseInt(match[1], 10) - 1];
} else {
arg = args[cursor++];
}
if (React.isValidElement(arg)) {
rv.push(React.cloneElement(arg, { key: idx }));
} else {
cpoyMatch[2] = null;
cpoyMatch[1] = 1;
rv.push(<span>
{sprintf.format([cpoyMatch], [null, arg])}
</span>);
}
}
});
return rv;