INNER CODE UNIT · JavaScript

BabelModePlugin

standard-things/esm · .babel.config.js:23

function BabelModePlugin({ types }) {
  // Based on `isInStrictMode()`.
  // Copyright Sebastian McKenzie and other contributors. Released under MIT license:
  // https://github.com/babel/babel/blob/master/packages/babel-traverse/src/path/introspection.js

  function isInMode(path) {
    const parent = path.find((path) => {
      if (path.isClass()) {
        return true
      }

      const isFunc = path.isFunction()

      if (! isFunc &&
          ! path.isProgram()) {
        return false
      }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…