How to use @babel/helper-split-export-declaration - 6 common examples

To help you get started, we’ve selected a few @babel/helper-split-export-declaration examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github babel / babel / packages / babel-helper-create-class-features-plugin / src / index.js View on Github external
ExportDefaultDeclaration(path) {
        if (this.file.get(versionKey) !== version) return;

        const decl = path.get("declaration");

        if (decl.isClassDeclaration() && hasDecorators(decl.node)) {
          if (decl.node.id) {
            // export default class Foo {}
            //   -->
            // class Foo {} export { Foo as default }
            splitExportDeclaration(path);
          } else {
            // Annyms class declarations can be
            // transformed as if they were expressions
            decl.node.type = "ClassExpression";
          }
        }
      },
    },
github babel / babel / packages / babel-plugin-transform-classes / src / index.js View on Github external
ExportDefaultDeclaration(path: NodePath) {
        if (!path.get("declaration").isClassDeclaration()) return;
        splitExportDeclaration(path);
      },
github babel / babel / packages / babel-traverse / src / scope / lib / renamer.js View on Github external
maybeConvertFromExportDeclaration(parentDeclar) {
    const maybeExportDeclar = parentDeclar.parentPath;

    if (!maybeExportDeclar.isExportDeclaration()) {
      return;
    }

    if (
      maybeExportDeclar.isExportDefaultDeclaration() &&
      !maybeExportDeclar.get("declaration").node.id
    ) {
      return;
    }

    splitExportDeclaration(maybeExportDeclar);
  }
github babel / babel / packages / babel-plugin-proposal-decorators / src / transformer.js View on Github external
ExportDefaultDeclaration(path) {
    let decl = path.get("declaration");
    if (!decl.isClassDeclaration() || !hasDecorators(decl)) return;

    if (decl.node.id) decl = splitExportDeclaration(path);

    decl.replaceWith(transformClass(decl, this.file));
  },
github ark120202 / babel-lua / packages / babel-plugin-lua-function-context / src / index.js View on Github external
ExportDefaultDeclaration(path) {
        if (!path.get('declaration').isFunctionDeclaration()) return;
        splitExportDeclaration(path);
      },
github babel / babel / packages / babel-helper-module-transforms / src / normalize-and-load-metadata.js View on Github external
programPath.get("body").forEach(child => {
    if (!child.isExportDefaultDeclaration()) return;
    splitExportDeclaration(child);
  });
}

@babel/helper-split-export-declaration

MIT
Latest version published 8 months ago

Package Health Score

91 / 100
Full package analysis

Popular @babel/helper-split-export-declaration functions

Similar packages