mmle-namespace
Make My Life Easier when manipulate with namespace
Usage
Node
npm install mmle-namespace --save-dev
Browser
└── dist
└── mmle-namespace.js
API
namespace(obj, path, value, [allowOverwrite])
Setter.
var cats = {}; var name = ;console; // { 'yellow': { 'small': { 'happy': 'paul' } } }console; // 'paul' // when the namespace is already existedvar name = ;// throw error // overwrite the existing namespacevar name = ;console; // { 'yellow': { 'small': { 'happy': 'thammin' } } }console; // 'thammin'
namespace(obj, path)
Getter.
var cats = yellow: small: happy: 'thammin' ; var name = ;console; // 'thammin'