Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
adds.forEach(add => {
let name = add.node.arguments[0].value;
let key = sanitizeName(name);
while (identifiers.has(key)) {
key = `_${key}`;
}
identifiers.add(key);
if (storyNameFromExport(key) === name) {
name = null;
}
const val = add.node.arguments[1];
statements.push(
j.exportDeclaration(
false,
j.variableDeclaration('const', [j.variableDeclarator(j.identifier(key), val)])
)
);
const storyAnnotations = [];
if (name) {
storyAnnotations.push(j.property('init', j.identifier('name'), j.literal(name)));
}