INNER CODE UNIT · JavaScript

makeImportSpecifier

grapp-dev/stacks · plugin/index.js:32

  const makeImportSpecifier = name => {
    const identifier = t.Identifier(name);
    return t.ImportSpecifier(identifier, identifier);
  };

  let importDeclaration = undefined;
  let program = undefined;

  return {
    visitor: {
      Program(path) {
        program = path;
      },
      ImportDeclaration(path) {
        if (path.node.source.value === '@grapp/stacks') {
          importDeclaration = path;
        }
      },

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…