lib/commandCenter/commandCenter.js
function createTimerPromise(commandName, timeout) {
	let timer;

	const promise = new Promise((resolve, reject) => {
		if (timeout) {
			timer = setTimeout(() => reject(new UserCommandExecutionTimeout(commandName)), timeout);
		}
	});

	promise.clear = () => clearTimeout(timer);

	return promise;
}
function createTimerPromise(commandName, timeout) {
	let timer;

	const promise = new Promise((resolve, reject) => {
		if (timeout) {
			timer = setTimeout(() => reject(new UserCommandExecutionTimeout(commandName)), timeout);
		}
	});

	promise.clear = () => clearTimeout(timer);

	return promise;
}
function createTimerPromise ( commandName , timeout ) { let timer ; const promise = new Promise ( ( resolve , reject ) => { if ( timeout ) { timer = setTimeout ( ( ) => reject ( new UserCommandExecutionTimeout ( commandName ) ) , timeout ) ; } } ) ; promise . clear = ( ) => clearTimeout ( timer ) ; return promise ; }
Create a promise timer

Useful when using Promise.race.

@param {number} timeout
Create a promise timer