How to use the ember-rfc176-data.forEach function in ember-rfc176-data

To help you get started, we’ve selected a few ember-rfc176-data 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 ember-cli / babel-plugin-ember-modules-api-polyfill / src / index.js View on Github external
module.exports = function(babel) {
  const t = babel.types;
  // Flips the ember-rfc176-data mapping into an 'import' indexed object, that exposes the
  // default import as well as named imports, e.g. import {foo} from 'bar'
  const reverseMapping = {};
  mapping.forEach(exportDefinition => {
    const imported = exportDefinition.global;
    const importRoot = exportDefinition.module;
    let importName = exportDefinition.export;

    if (!reverseMapping[importRoot]) {
      reverseMapping[importRoot] = {};
    }

    reverseMapping[importRoot][importName] = imported;
  });

  return {
    name: 'ember-modules-api-polyfill',
    visitor: {
      ImportDeclaration(path, state) {
        let blacklist = (state.opts && state.opts.blacklist) || [];

ember-rfc176-data

JSON data for Ember.js RFC #176

MIT
Latest version published 2 years ago

Package Health Score

59 / 100
Full package analysis

Similar packages