Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-remove-functions

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-remove-functions

Remove code from ember-cli builds

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
159
increased by2171.43%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-remove-functions

Build Status

This is a WIP and experimental implementation of https://github.com/ember-cli/rfcs/pull/50.

Given the following configuration:

{
  removals: [
    {
      module: 'ember',
      methods: [
        'assert',
        'debug',
        'deprecate',
        'info',
        'runInDebug',
        'warn'
      ]
    }
  ]
}

And the following source javascript:

import Ember from 'ember';

export default Ember.Component.extend({
  didInsertElement() {
    console.log('didInsertElement');

    Ember.isEqual('this will not be removed', 'ok?');

    Ember.assert('this will be removed');
    Ember.assert('this will also be removed', true);

    Ember.debug('this will be removed');

    Ember.deprecate(
      'this will be removed',
      false,
      {
        id: 'test-deprecation',
        until: '3.0.0',
        url: 'http://foo.com'
      }
    );

    Ember.info('this will be removed');

    Ember.runInDebug(() => {
      Ember.Component.reopen({
        didInsertElement() {
          console.log('this will all be removed');
        }
      });
    });

    Ember.warn('this will be removed');
  }
});

The output will be:

import Ember from 'ember';

export default Ember.Component.extend({
  didInsertElement() {
    console.log('didInsertElement');

    Ember.isEqual('this will not be removed', 'ok?');
  }
});

Development

Use astexplorer.net for exploring and experimenting with the Babel AST.


This is based on babel-plugin-filter-imports by mmum.

Keywords

FAQs

Package last updated on 08 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc