lib/rt-utils.js
function using(ns) {
	let nsParts = ns.split('.');
	let parentObj = global;

	// Build an object tree as necessary for the namespace hierarchy.
	for (let i = 0; i < nsParts.length - 1; i++) {
		let nsObj = parentObj[nsParts[i]];
		if (!nsObj) {
			nsObj = {};
			parentObj[nsParts[i]] = nsObj;
		}
		parentObj = nsObj;
	}

	let lastNsPart = nsParts[nsParts.length - 1];
	let nsPackage = require(uwpRoot + ns.toLowerCase());

	// Merge in any already-loaded sub-namespaces.
	// This allows loading in non-hierarchical order.
	let nsObj = parentObj[lastNsPart];
	if (nsObj) {
		Object.keys(nsObj).forEach(key => {
			nsPackage[key] = nsObj[key];
		})
	}
	parentObj[lastNsPart] = nsPackage;
}
function using(ns) {
	let nsParts = ns.split('.');
	let parentObj = global;

	// Build an object tree as necessary for the namespace hierarchy.
	for (let i = 0; i < nsParts.length - 1; i++) {
		let nsObj = parentObj[nsParts[i]];
		if (!nsObj) {
			nsObj = {};
			parentObj[nsParts[i]] = nsObj;
		}
		parentObj = nsObj;
	}

	let lastNsPart = nsParts[nsParts.length - 1];
	let nsPackage = require(uwpRoot + ns.toLowerCase());

	// Merge in any already-loaded sub-namespaces.
	// This allows loading in non-hierarchical order.
	let nsObj = parentObj[lastNsPart];
	if (nsObj) {
		Object.keys(nsObj).forEach(key => {
			nsPackage[key] = nsObj[key];
		})
	}
	parentObj[lastNsPart] = nsPackage;
}
function using ( ns ) { let nsParts = ns . split ( '.' ) ; let parentObj = global ; // Build an object tree as necessary for the namespace hierarchy. for ( let i = 0 ; i < nsParts . length - 1 ; i ++ ) { let nsObj = parentObj [ nsParts [ i ] ] ; if ( ! nsObj ) { nsObj = { } ; parentObj [ nsParts [ i ] ] = nsObj ; } parentObj = nsObj ; } let lastNsPart = nsParts [ nsParts . length - 1 ] ; let nsPackage = require ( uwpRoot + ns . toLowerCase ( ) ) ; // Merge in any already-loaded sub-namespaces. // This allows loading in non-hierarchical order. let nsObj = parentObj [ lastNsPart ] ; if ( nsObj ) { Object . keys ( nsObj ) . forEach ( key => { nsPackage [ key ] = nsObj [ key ] ; } ) } parentObj [ lastNsPart ] = nsPackage ; }
Require a NodeRt namespace package and load it into the global namespace.
Require a NodeRt namespace package and load it into the global namespace .