Socket
Socket
Sign inDemoInstall

babel-plugin-es5-function-to-class

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-es5-function-to-class

💎 Transform ES5 Functions to ES6 Classes


Version published
Maintainers
1
Install size
21.9 kB
Created

Changelog

Source

1.1.2 (2019-06-13)

Bug Fixes

  • hmmm (07bac4b)

Readme

Source
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@/      #@@@@@@@.  %&@@@@@# .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@ (@@@@@@@@&       @@@@@@&  %%&@@@&/   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@  @@@@@@@        @@@@@@ /%%%%%%%   #%#@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@   @@@@.         @@@@@@%%%%%%%   #%%#%#@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@, @@@@         (@@@@#%%%%%%*  (%%%%%%, &@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@ @@@          @@@*%%%%%%  (%%%%%%.  #%@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@* @@         %%%%%  /%%%%%%   #%%#@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@ *@@@@@@@@@@@&       #%%%   %%%%%#  .%%%*  &@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@  ,@@@@@@@@@@@       %%%  %%%%%   %%%.     /@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@(    @@@@@@@&       &&%  %%%%  %%%        *@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@         @@       %&% /%%(  %%          @%@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@                 && &&% %%.          .@,/@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@/             (& && #%           ,@@% @@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@/  #(       & &.         ,@@@@@@@* &@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@& @@,    . #      ,@@@@&@@@@@@(  @@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(  *    @@@@@@%(#/%@@@@  %@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@      @@@@@@@@@&&@@@& .%%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    @&      .,*.   %%%% @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.    @        ,&&&&&, %%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%@@  &    &(   .#&&&%, %@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@   * .              (@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  @            . *  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.@@.        #  &( .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%   / /&  (*/& @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/, /* *,    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ #,    @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@. @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

babel-plugin-es5-function-to-class

Live Demo For Babel-Plugin 💻

IO

Input

function Controller(param1, param2) {
    const name = "hello";
    let age = 21;
  }

  Controller.prototype.name = "hello";

  Controller.prototype.contributeTo = function(param) {
    var foo = "world-k";
  };

  Controller.staticMethod = function(param) {
    var bar = "world-cli";
  };

  Object.defineProperty(Controller.prototype, "hello", {
    get: function() {
      return "world";
    },
    set: function(name) {
      console.log("Do anything with " + name);
    }
  });

  Object.defineProperty(Controller.prototype, "lastname", {
    get: function() {
      return "kiwi";
    }
  });

output

class Controller {
  constructor(param1, param2) {
    const name = "hello";
    let age = 21;
    this.name = "hello"
  }

  contributeTo(param) {
    var foo = "world-k";
  }

  static staticMethod(param) {
    var bar = "world-cli";
  }

  get hello() {
    return "world";
  }

  set hello(name) {
    console.log("Do anything with " + name);
  }

  get lastname() {
    return "kiwi";
  }

}
Features :100:
  • Methods on prototype
  • Static Methods on prototype
  • Variables and Literals on prototype
  • Getters, Setters with defineProperty
  • Block-level Variables

Note : The babel-plugin-es5-function-to-class will only work properly if there is only one function declared in the input file else it will overwrite with the newest declared function. Will resolve this soon :smile:

Keywords

FAQs

Last updated on 13 Jun 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc