JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q44311F
  • License MIT

Make My Life Easier - namespace

Package Exports

  • mmle-namespace

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mmle-namespace) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

mmle-namespace

Make My Life Easier when manipulate with namespace

API

var namespace = require('mmle-namespace');

var cats = {};

// setter
var name = namespace(cats, 'yellow.small.happy', 'paul');
// cats => { 'yellow': { 'small': { 'happy': 'paul' } } }
// name => 'paul'


// setter with exisiting value
var name = namespace(cats, 'yellow.small.happy', 'thammin');
// throw error


// overwrite setter with exisiting value
var name = namespace(cats, 'yellow.small.happy', 'thammin', true);
// cats => { 'yellow': { 'small': { 'happy': 'thammin' } } }
// name => 'thammin'


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