Skip to content

paxidently/mkobjp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mkobjp

Like mkdir -p, but for objects!

Install:

npm install mkobjp

Example:

var obj = {
    foo: true,
    bar: {
        baz: 'quux'
    }
};

mkobjp(obj, [ 'bar', 'hoge', 'hogehoge', 'piyo' ]);

assert.deepEqual({
    foo: true,
    bar: {
        baz: 'quux',
        hoge: {
            hogehoge: {
                piyo: {}
            }
        }
    }
});

About

Like `mkdir -p`, but for objects!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published