Skip to content

Repository files navigation

MapRewire

Elixir CICoverage StatusLibraries.io for releases

Bulk rekey your maps. Simple bud. (☞゚ ヮ ゚)☞

Why?

Simply because I am super lazy, and writing out functions to take maps and convert them to different keys was boring (and irritating) me.

Stop writing defp from_x_to_y(data), do: %{ "another_id" => data["id"], "name" => data["title"] }.

TL;DR; Syntax

  1. Macro: content<~>transformation, content is your data, transformation is your rules.
  2. Content: Any map. BYOD.
  3. Transformation: from=>to. Left is the original key, right is the new key.

Getting started

defdepsdo[{:map_rewire,"~> 0.3.0"}]end

Contributors

byjordhalostatue
byjordhalostatue

Releases

Packages

Contributors

Languages