Skip to content

Tools to denormalize, normalize, and combine nested maps.

Notifications You must be signed in to change notification settings

Tavistock/amalgam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Amalgam

Clojars Project

"How do you identify? how do you i.d.?"

  • 'Let's relate' by Of Montreal

Tools to denormalize, normalize, and combine nested maps.

Usage

(ns my-ns.core
  (:require [amalgam.core :refer [norm denorm combine]])
  
(def my-map {:id :a 
             :child {:id :b 
                     :child {:id :c 
                             :value 1}}})

(def normalized (norm my-map)) ;; => makes a map with :results and :entities

(def denormalized (denorm (:entities normalized)
                          (:results normalized)
                          []))

;; => {:id a :child (:amalgam.core/link :b)}

(def denormalized (denorm (:entities normalized)
                          (:results normalized)
                          [[:child [:child]]]))

;; => {:id :a :child {:id :b :child {:id :c :value 1}}}

About

Tools to denormalize, normalize, and combine nested maps.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published