lib/ambush.js
function add(object) {
	if (!_isValidAmbush(object)) {
		return false;
	}

	object.description = _cleanDescription(object.description);

	if (!_belongToAStoredAmbush(object.id)) {
		const newObject = Object.assign({}, object);
		goblin.ambush.push(newObject);
		goblin.ambushEmitter.emit('change', { type: 'add', value: newObject });
	} else {
		logger('AMBUSH_ADD_ERROR');
	}
}
function add(object) {
	if (!_isValidAmbush(object)) {
		return false;
	}

	object.description = _cleanDescription(object.description);

	if (!_belongToAStoredAmbush(object.id)) {
		const newObject = Object.assign({}, object);
		goblin.ambush.push(newObject);
		goblin.ambushEmitter.emit('change', { type: 'add', value: newObject });
	} else {
		logger('AMBUSH_ADD_ERROR');
	}
}
function add ( object ) { if ( ! _isValidAmbush ( object ) ) { return false ; } object . description = _cleanDescription ( object . description ) ; if ( ! _belongToAStoredAmbush ( object . id ) ) { const newObject = Object . assign ( { } , object ) ; goblin . ambush . push ( newObject ) ; goblin . ambushEmitter . emit ( 'change' , { type : 'add' , value : newObject } ) ; } else { logger ( 'AMBUSH_ADD_ERROR' ) ; } }
Store a new ambush function. Validates id doesn't exist already, etc.

@param {Ambush} object Ambush function data.
@returns {void} Nothing.
Store a new ambush function . Validates id doesn t exist already etc .