UNPKG

ember-app-scheduler

Version:

Ember addon to schedule work at different phases of app life cycle.

20 lines (15 loc) 393 B
var forEach = require('../array/forEach'); /** * Create nested object if non-existent */ function namespace(obj, path){ if (!path) return obj; forEach(path.split('.'), function(key){ if (!obj[key]) { obj[key] = {}; } obj = obj[key]; }); return obj; } module.exports = namespace;