lib/database.js
function deleteFn(point) {
	if (point && typeof(point) === 'string') {
		const tree = point.split('.');
		let source = goblin.db;

		return tree.every((node, i) => {
			if (source[node] === undefined) {
				logger('DB_DELETE_INVALID_POINT', node);
				return false;
			}

			if (i === tree.length - 1) {
				let oldValue = source[node];

				if (Array.isArray(source)) {
					source.splice(node, 1);
					return true;
				}

				if (delete source[node]) {
					goblin.goblinDataEmitter.emit('change', {
						type: 'delete',
						value: undefined,
						oldValue: oldValue
					});

					return true;
				} else {
					return false;
				}
			}

			source = source[node];
			return true;
		});
	}

	logger('DB_DELETE_MISSING_POINT');
	return false;
}
function deleteFn(point) {
	if (point && typeof(point) === 'string') {
		const tree = point.split('.');
		let source = goblin.db;

		return tree.every((node, i) => {
			if (source[node] === undefined) {
				logger('DB_DELETE_INVALID_POINT', node);
				return false;
			}

			if (i === tree.length - 1) {
				let oldValue = source[node];

				if (Array.isArray(source)) {
					source.splice(node, 1);
					return true;
				}

				if (delete source[node]) {
					goblin.goblinDataEmitter.emit('change', {
						type: 'delete',
						value: undefined,
						oldValue: oldValue
					});

					return true;
				} else {
					return false;
				}
			}

			source = source[node];
			return true;
		});
	}

	logger('DB_DELETE_MISSING_POINT');
	return false;
}
function deleteFn ( point ) { if ( point && typeof ( point ) === 'string' ) { const tree = point . split ( '.' ) ; let source = goblin . db ; return tree . every ( ( node , i ) => { if ( source [ node ] === undefined ) { logger ( 'DB_DELETE_INVALID_POINT' , node ) ; return false ; } if ( i === tree . length - 1 ) { let oldValue = source [ node ] ; if ( Array . isArray ( source ) ) { source . splice ( node , 1 ) ; return true ; } if ( delete source [ node ] ) { goblin . goblinDataEmitter . emit ( 'change' , { type : 'delete' , value : undefined , oldValue : oldValue } ) ; return true ; } else { return false ; } } source = source [ node ] ; return true ; } ) ; } logger ( 'DB_DELETE_MISSING_POINT' ) ; return false ; }
Deletes the content stored where point indicates.

@param {string} point The place where the data is stored.
@returns {bool} Success
Deletes the content stored where point indicates .