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

Feature/super fields (for feature request #78) #79

Merged
merged 5 commits into from Oct 8, 2015

Conversation

azhang
Copy link
Collaborator

@azhang azhang commented Oct 8, 2015

#78

Allow params.fields to have more options. Supports label and path. path can be a string path like before, or a function(row) to return a derived value.

Should be mostly, if not completely, backwards compatible, as it passes all tests.

azhang and others added 3 commits October 7, 2015 15:45
{
  fields: [
    // Support label -> simple path
    {
      label: 'some label',
      value: 'path.to.something'
    },
    // Support label -> derived value
    {
      label: 'some label', // Supporting duplicate labels
      value: function(row) {
        return row.path1 + row.path2;
      }
    },
    // Support pathname -> pathvalue (label optional, keeps backwards compatibility)
    'simplepath'
    'path.to.value'
  ]
}
@azhang
Copy link
Collaborator Author

azhang commented Oct 8, 2015

@knownasilya
Copy link
Collaborator

I can merge once there is some documentation explaining this new feature 😄

@azhang
Copy link
Collaborator Author

azhang commented Oct 8, 2015

Added! ^_^ Feel to make changes if you think something can be clearer. Also, does this require a major version update? Everything should be backwards compatible.

@knownasilya
Copy link
Collaborator

I'm going to be doing a major bump any way, so this will make it into that.

knownasilya pushed a commit that referenced this pull request Oct 8, 2015
Feature/super fields (for feature request #78)
@knownasilya knownasilya merged commit cd4a687 into zemirco:master Oct 8, 2015
@azhang azhang deleted the feature/superFields branch October 9, 2015 04:13
@azhang
Copy link
Collaborator Author

azhang commented Oct 9, 2015

Woot! Thanks!

@knownasilya
Copy link
Collaborator

@zemirco can we add @azhang as a contributor?

@zemirco
Copy link
Owner

zemirco commented Oct 12, 2015

Sure. Do you have enough rights to do it or shall i do it? @azhang What's your npm username?

@knownasilya
Copy link
Collaborator

No, I don't have enough rights.

@azhang
Copy link
Collaborator Author

azhang commented Oct 12, 2015

Npm username is azhang. Thanks a lot!

@zemirco
Copy link
Owner

zemirco commented Oct 13, 2015

$ npm owner ls json2csv
azhang <azhang@bottlenose.com>
knownasilya <ilya@burstcreations.com>
zemirco <mirco.zeiss@gmail.com>

done. also added you to Collaborators.

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.

None yet

3 participants