Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Fixing select utility methods to work with query selector #39

Merged
merged 3 commits into from
Nov 11, 2016

Conversation

daffl
Copy link
Member

@daffl daffl commented Nov 11, 2016

This is not used anywhere yet so we can change it before using it for the db adapters (see feathersjs-ecosystem/feathers-service-tests#32)

return result.map(selector);
export function select (fields) {
return result => {
if (!(fields && Array.isArray(fields))) {
Copy link
Member

@ekryski ekryski Nov 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm just tired but I'm having tough time following the logic.

Can we switch it to:

if (fields && Array.isArray(fields)) {
  return _.pick(result, ...fields);
}

return result;

@daffl daffl merged commit 0b65d9d into master Nov 11, 2016
@daffl daffl deleted the select-update branch November 11, 2016 03:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants