Skip to content

Instantly share code, notes, and snippets.

@blambeau
Created May 20, 2014 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blambeau/366bd21ff9704c33b9b1 to your computer and use it in GitHub Desktop.
Save blambeau/366bd21ff9704c33b9b1 to your computer and use it in GitHub Desktop.
Finitio dress/undress
S = Finitio.parse <<-EOF
Uuid = String( ... )
Time = .Date <iso> String( s | ... ) .Finitio.Contract.Time.iso
Physical = {
uuid: String
title: String
at: String
}
Logical = {
uuid: Uuid
title: Title
at: Time
}
EOF
# from the database to the js (parse)
logical = S['Logical'].dress({at: "2015-04-19T16:00"})
# from the logical side to the database (dump)
physical = S['logical'].undress(logical, S['Physical'])
at: Time -> String
iso: String( s | ... )
String( s | ...) -> String
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment