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

fix: @feathersjs/express: replace reduce with map #1429

Merged
merged 1 commit into from
Jul 3, 2019

Conversation

vonagam
Copy link
Member

@vonagam vonagam commented Jul 2, 2019

Easier to read and faster 4 times: 500,000 vs 2,000,000 ops/sec.

Also small difference (fix): before if you activateHooks() some method with a nonstandard argument resulted express args getter will throw an error, now it returns valid array with undefined for unknown arguments. (Vanilla feathers supports nonstandard arguments, but there is no test for such case.)

Also makeArguments and defaultMakeArguments can be safely removed before major release, since they have been replaced with new system and not used anywhere. If for some backward compatibility reason you want to keep them, we can replace their internals with same one liner:

return hook.service.methods[hook.method].map((value) => hook[value]);

@daffl daffl merged commit 44542e9 into feathersjs:master Jul 3, 2019
@daffl
Copy link
Member

daffl commented Jul 3, 2019

👍 Looks like it is indeed not used but I think it makes sense to keep it in for backwards compatibility of other libraries that might still use it. Can definitely be removed with the new hook system in v5.

@vonagam vonagam deleted the fix-map-instead-reduce-spread branch September 5, 2019 10:46
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

Successfully merging this pull request may close these issues.

2 participants