csv icon indicating copy to clipboard operation
csv copied to clipboard

issue-85: Encode headers as Keyword list

Open michaelchu opened this issue 4 years ago • 1 comments

This PR addresses Encode headers as Keyword list #85

CSV.encode accepts a Keyword list as headers, the keys of that list will be used as the keys for the rows, but the value will be the value used for the header row name in CSV output.

[%{a: "value!"}] |> CSV.encode(headers: [a: "x", b: "y"])
# ["x,y\\r\\n", "value!,\\r\\n"]

Checklist

  • Tests added - Yes
  • Coverage increases or stays the same - Yes
  • Docs updated - updated Readme.md
  • Changelog updated - No release from this PR

michaelchu avatar Oct 25 '20 03:10 michaelchu

Coverage Status

Coverage remained the same at 100.0% when pulling dd1ffad608e8b1642fa05d449c9135c657088342 on michaelchu:keyword-list into ff96571e54cc57fb9ff8523a3c203614c114f4f7 on beatrichartz:master.

coveralls avatar Oct 25 '20 03:10 coveralls

Merged, thanks for this

beatrichartz avatar Sep 17 '22 01:09 beatrichartz