super-graph/jsn
Vikram 6102f1d66e fix: infinite loop on missing allow.list issue 2020-05-30 23:36:44 -07:00
..
corpus Add database seeding capability 2019-09-20 00:19:11 -04:00
README.md Add insert mutation with bulk insert 2019-09-05 00:09:56 -04:00
bench.0 Fix various json parsing and sql generation bugs 2020-01-19 03:12:51 -05:00
clear.go fix: infinite loop on missing allow.list issue 2020-05-30 23:36:44 -07:00
filter.go Refactor Super Graph into a library #26 2020-04-10 02:27:43 -04:00
fuzz.go fix: improve fuzzing coverage for jsn package 2020-05-29 00:08:37 -04:00
fuzz_test.go fix: infinite loop on missing allow.list issue 2020-05-30 23:36:44 -07:00
get.go Refactor Super Graph into a library #26 2020-04-10 02:27:43 -04:00
intstack.go feat: remove data from variables saved to allow.list 2020-05-07 10:27:40 -04:00
json_test.go fix: improve fuzzing coverage for jsn package 2020-05-29 00:08:37 -04:00
keys.go feat: remove data from variables saved to allow.list 2020-05-07 10:27:40 -04:00
replace.go fix: infinite loop on missing allow.list issue 2020-05-30 23:36:44 -07:00
sistack.go feat: remove data from variables saved to allow.list 2020-05-07 10:27:40 -04:00
strip.go Refactor Super Graph into a library #26 2020-04-10 02:27:43 -04:00
test7.json Fix bugs with escape char handling 2020-03-30 10:03:47 -04:00
test8.json Fix bugs with escape char handling 2020-03-30 10:03:47 -04:00
tree.go Add nested mutations 2019-12-25 01:24:30 -05:00
validate.go Refactor Super Graph into a library #26 2020-04-10 02:27:43 -04:00

README.md

JSN - Fast low allocation JSON library

Design

This libary is designed as a set of seperate functions to extract data and mutate JSON. All functions are focused on keeping allocations to a minimum and be as fast as possible. The functions don't validate the JSON a seperate Validate function does that.

The JSON parsing algo processes each object {} or array [] in a bottom up way where once the end of the array or object is found only then the keys within it are parsed from the top down.

{"id":1,"posts": [{"title":"PT1-1","description":"PD1-1"}], "full_name":"FN1","email":"E1" }

id: 1

posts: [{"title":"PT1-1","description":"PD1-1"}]

[{"title":"PT1-1","description":"PD1-1"}]

{"title":"PT1-1","description":"PD1-1"}

title: "PT1-1"

description: "PD1-1

full_name: "FN1"

email: "E1"

Functions

  • Strip: Strip a path from the root to a child node and return the rest
  • Replace: Replace values by key
  • Get: Get all keys
  • Filter: Extract specific keys from an object
  • Tree: Fetch unique keys from an array or object