sdk/src/F2.js
function (ns, obj, overwrite) {
			var isFunc = typeof obj === 'function';
			var parts = ns ? ns.split('.') : [];
			var parent = this;
			obj = obj || {};
			
			// ignore leading global
			if (parts[0] === 'F2') {
				parts = parts.slice(1);
			}

			// create namespaces
			for (var i = 0, len = parts.length; i < len; i++) {
				if (!parent[parts[i]]) {
					parent[parts[i]] = isFunc && i + 1 == len ? obj : {};
				}
				parent = parent[parts[i]];
			}

			// copy object into namespace
			if (!isFunc) {
				for (var prop in obj) {
					if (typeof parent[prop] === 'undefined' || overwrite) {
						parent[prop] = obj[prop];
					} 
				}
			}

			return parent;
		}
function (ns, obj, overwrite) {
			var isFunc = typeof obj === 'function';
			var parts = ns ? ns.split('.') : [];
			var parent = this;
			obj = obj || {};
			
			// ignore leading global
			if (parts[0] === 'F2') {
				parts = parts.slice(1);
			}

			// create namespaces
			for (var i = 0, len = parts.length; i < len; i++) {
				if (!parent[parts[i]]) {
					parent[parts[i]] = isFunc && i + 1 == len ? obj : {};
				}
				parent = parent[parts[i]];
			}

			// copy object into namespace
			if (!isFunc) {
				for (var prop in obj) {
					if (typeof parent[prop] === 'undefined' || overwrite) {
						parent[prop] = obj[prop];
					} 
				}
			}

			return parent;
		}
function ( ns , obj , overwrite ) { var isFunc = typeof obj === 'function' ; var parts = ns ? ns . split ( '.' ) : [ ] ; var parent = this ; obj = obj || { } ; // ignore leading global if ( parts [ 0 ] === 'F2' ) { parts = parts . slice ( 1 ) ; } // create namespaces for ( var i = 0 , len = parts . length ; i < len ; i ++ ) { if ( ! parent [ parts [ i ] ] ) { parent [ parts [ i ] ] = isFunc && i + 1 == len ? obj : { } ; } parent = parent [ parts [ i ] ] ; } // copy object into namespace if ( ! isFunc ) { for ( var prop in obj ) { if ( typeof parent [ prop ] === 'undefined' || overwrite ) { parent [ prop ] = obj [ prop ] ; } } } return parent ; }
Creates a namespace on F2 and copies the contents of an object into
that namespace optionally overwriting existing properties.
@method extend
@param {string} ns The namespace to create. Pass a falsy value to
add properties to the F2 namespace directly.
@param {object} obj The object to copy into the namespace.
@param {bool} overwrite True if object properties should be overwritten
@return {object} The created object
Creates a namespace on F2 and copies the contents of an object into that namespace optionally overwriting existing properties .