lib/database.js
function get(point) {
	if (point && typeof(point) === 'string') {
		const tree = point.split(goblin.config.pointerSymbol);
		let parent = goblin.db;

		for (let i = 0; i < tree.length; i++) {
			if(i !== tree.length-1) {
				if(typeof parent[tree[i]] === 'undefined') {
					// If there is no child here, won't be deeper. Return undefined
					return undefined;
				}
				parent = parent[tree[i]];
			} else {
				return parent[tree[i]];
			}
		}
	} else {
		return goblin.db;
	}
}
function get(point) {
	if (point && typeof(point) === 'string') {
		const tree = point.split(goblin.config.pointerSymbol);
		let parent = goblin.db;

		for (let i = 0; i < tree.length; i++) {
			if(i !== tree.length-1) {
				if(typeof parent[tree[i]] === 'undefined') {
					// If there is no child here, won't be deeper. Return undefined
					return undefined;
				}
				parent = parent[tree[i]];
			} else {
				return parent[tree[i]];
			}
		}
	} else {
		return goblin.db;
	}
}
function get ( point ) { if ( point && typeof ( point ) === 'string' ) { const tree = point . split ( goblin . config . pointerSymbol ) ; let parent = goblin . db ; for ( let i = 0 ; i < tree . length ; i ++ ) { if ( i !== tree . length - 1 ) { if ( typeof parent [ tree [ i ] ] === 'undefined' ) { // If there is no child here, won't be deeper. Return undefined return undefined ; } parent = parent [ tree [ i ] ] ; } else { return parent [ tree [ i ] ] ; } } } else { return goblin . db ; } }
Gets the data from a point in the nested tree. If you don't set a point then all db
will be returned.

@param {string} point The place where the data is stored. If there is no such place
in the nested tree then it'll return undefined.
@returns {any} The stored data.
Gets the data from a point in the nested tree . If you don t set a point then all db will be returned .