Skip to content
Isaac Whitfield edited this page Nov 13, 2015 · 4 revisions

Dot Notes is a small library to parse Strings and Objects to/from dot/bracket notation. It was created as a way to flatten Objects painlessly in JavaScript, however it has broadened to work on JSON as a whole. As such, most of the grammar rules from JavaScript apply but it is not designed to be identical to JavaScript. One example of where Dot Notes differs to JavaScript syntax is that your notation can start with bracket notation, whereas in JavaScript it must start with an accessor. This isn't a logical requirement to have when simply parsing JSON, so it does not exist in Dot Notes.

Having said this, the API is pretty intuitive for the most part and there should be few surprises. In the current version, Dot Notes only exports a few functions to the user but allows for very flexible usage, from things such as flattening, to counting leaves in an Array. This library is designed to be general utilities that provide means of creating specific solutions, and as such it will remain very generic. In the 1.x version, the flattening feature was deemed too specific and removed in 2.x, to be replaced with a more generic recurse function which allows you to replicate flattening and many other possibilities.

Dot Notes currently has 100% line/branch coverage and I intend to keep it that way. New features will be added as they're found appropriate, but the current version of the library is pretty solid for the intention. If you spot any errors or improvements which could be made, please leave an issue on this repo so I can take a look.

Last of all, thanks for using Dot Notes!