Skip to content

For walking through data structures where each value is wrapped in an array.

License

Notifications You must be signed in to change notification settings

miwillhite/ayrayray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ayrayray

For walking through data structures where each value is wrapped in an array.

const assert = require ('assert');
const A = require ('..');

const t = { foo: [{ bar: [{ baz: [1] }]
                  , quux: []
                  }]
          };

// Fetches the value from the specified path
assert.equal (1, A.step (['foo', 'bar', 'baz']) (t));

// Returns null for nonexistant keys
assert.equal (null, A.step (['flub']) (t));

// Returns null for empty values
assert.equal (null, A.step (['foo', 'quux']) (t));

About

For walking through data structures where each value is wrapped in an array.

Resources

License

Stars

Watchers

Forks

Packages

No packages published