Socket
Socket
Sign inDemoInstall

es6-rest-params

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es6-rest-params

Convert ES6 rest params to ES3:


Version published
Maintainers
2
Created
Source

Convert ES6 rest params to ES3:

var join = function(joinStr, ...items) {
  return items.join(joinStr);
};

becomes:

var join = function(joinStr) {
  var items = [].slice.call(arguments, 1);
  return items.join(joinStr);
};

Usage

var compile = require('es6-rest-params').compile;

var output = compile(mySource);  // outputs { code: "..." }

// or, for source maps:
var output = compile(mySource, {
  sourceFileName: 'foo.js',
  sourceMapName: 'foo.js.map'
});  // outputs { code: "...", map: {...} }

Resources

Source map example

Thanks to Facebook's jstransform for the implementation strategy :)

FAQs

Package last updated on 31 Dec 2014

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