Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out solution to 0 arg methods #3

Closed
Tracked by #1
nathanclevenger opened this issue Nov 30, 2022 · 1 comment
Closed
Tracked by #1

Figure out solution to 0 arg methods #3

nathanclevenger opened this issue Nov 30, 2022 · 1 comment
Assignees

Comments

@nathanclevenger
Copy link
Member

nathanclevenger commented Nov 30, 2022

Can we try to get this: http://lodash.do/values/shuffle/take/10/vehicles.do/random-vins.json

to work this does: http://lodash.do/values/_/shuffle/_/take/10/vehicles.do/random-vins.json

It messes up the current logic that's used, but the first syntax is much more elegant

@AggressivelyMeows
Copy link
Contributor

The solution I came up with was to get the function signature by calling .toString() on the Lodash function itself. Then, using regex, I got the list of arguments and subtracted one, since they always require at least one arg (the list). If the remaining count is 0, then the function takes no arguments we also take only one from the pathSegments array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants