es3-safe-recast

3.0.0 • Public • Published

es3-safe-recast Build Status

Recasts all ECMAScript 3 reserved words to their safe alternatives.

Optionally removes trailing commas in object and array literals (pass { trailingComma: true } as the second argument to compile).

helpers

Before

ajax('/asdf/1').catch(function(reason) {
 
}).finally(function() {
 
});

After

ajax('/asdf/1')['catch'](function(reason) {
 
})['finally'](function() {
 
});

Before

object = {
  catch:   function() {},
  finally: function() {},
  default: function() {}
};

After

object = {
  'catch':   function() {},
  'finally': function() {},
  'default': function() {}
};

Readme

Keywords

none

Package Sidebar

Install

npm i es3-safe-recast

Weekly Downloads

917

Version

3.0.0

License

ISC

Unpacked Size

34.5 kB

Total Files

18

Last publish

Collaborators

  • fivetanley
  • rwjblue
  • stefanpenner