Skip to content

killerangel13/name-parameters

Repository files navigation

Used in .

Unit test: http://alt-o.net/testing-suite/?grep=Parameter Names

USAGE

   
   var get = require("get_es6_parameter_names");

   function example (a = "hello", b = "world") {

      return true;
   }
   get(example.toString()); // ["a", "b"]
   
   var get = require("get_es6_parameter_names");

   function example ({a}, {b}) {

      return true;
   }
   get(example.toString()); // ["a", "b"]
   
   var get = require("get_es6_parameter_names");

   function example ({A: a}, {B: b}) {

      return true;
   }
   get(example.toString()); // ["a", "b"]
   
   var get = require("get_es6_parameter_names");

   function example (a, ...b) {

      return true;
   }
   get(example.toString()); // ["a", "...b"]
   

About

Get the names of a function's parameters.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published