import.js
458 Bytes
let importExress = {
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"local": {
"type": "Identifier",
}
}
],
"source": {
"type": "Literal",
}
};
module.exports = (name) => {
importExress.specifiers[0].local.name = name;
importExress.source.raw = importExress.source.value = `./${name}`;
return importExress;
};