How to use the @babel/helper-define-map.toDefineObject function in @babel/helper-define-map

To help you get started, we’ve selected a few @babel/helper-define-map 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-plugin-transform-es5-property-mutators / src / index.js View on Github external
node.properties = node.properties.filter(function(prop) {
          if (!prop.computed && (prop.kind === "get" || prop.kind === "set")) {
            defineMap.push(mutatorMap, prop, null, file);
            return false;
          } else {
            return true;
          }
        });

        path.replaceWith(
          t.callExpression(
            t.memberExpression(
              t.identifier("Object"),
              t.identifier("defineProperties"),
            ),
            [node, defineMap.toDefineObject(mutatorMap)],
          ),
        );
      },
    },
github babel / babel / packages / babel-plugin-transform-property-mutators / src / index.js View on Github external
node.properties = node.properties.filter(function(prop) {
          if (!prop.computed && (prop.kind === "get" || prop.kind === "set")) {
            defineMap.push(mutatorMap, prop, null, file);
            return false;
          } else {
            return true;
          }
        });

        path.replaceWith(
          t.callExpression(
            t.memberExpression(
              t.identifier("Object"),
              t.identifier("defineProperties"),
            ),
            [node, defineMap.toDefineObject(mutatorMap)],
          ),
        );
      },
    },

@babel/helper-define-map

Helper function to define a map

MIT
Latest version published 2 years ago

Package Health Score

85 / 100
Full package analysis

Similar packages