browserify / detective

Find all calls to require() no matter how deeply nested using a proper walk of the AST
Other
414 stars 60 forks source link

Support array calls #26

Closed piuccio closed 9 years ago

piuccio commented 11 years ago

Hello, interesting project.

It would be nice if the module could detect arrays

require(["a", "b"], function () {});
detective("code above");   //   []

Useful information can still be obtained from

detective.find("code above");
{
   expressions: [  ' [ 'a', 'b' ] '  ]
}

However the expression has to be parsed again to extract the array values.

zertosh commented 9 years ago

Late by a few years, but you can do detective.find("code above", {nodes: true});, and parse out the array values yourself.