Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

mmle-namespace

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mmle-namespace

Make My Life Easier - namespace

latest
Source
npmnpm
Version
3.0.0
Version published
Weekly downloads
13
333.33%
Maintainers
1
Weekly downloads
 
Created
Source

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 = namespace(cats, 'yellow.small.happy', 'paul');
console.log(cats); // { 'yellow': { 'small': { 'happy': 'paul' } } }
console.log(name); // 'paul'


// when the namespace is already existed
var name = namespace(cats, 'yellow.small.happy', 'thammin');
// throw error


// overwrite the existing namespace
var name = namespace(cats, 'yellow.small.happy', 'thammin', true);
console.log(cats); // { 'yellow': { 'small': { 'happy': 'thammin' } } }
console.log(name); // 'thammin'

namespace(obj, path)

Getter.

var cats = {
  yellow: {
    small: {
      happy: 'thammin'
    }
  }
};

var name = namespace(cats, 'yellow.small.happy');
console.log(name); // 'thammin'

Keywords

thammin

FAQs

Package last updated on 08 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts