Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(initialCount: number) {
if (!isNumber(initialCount)) throw new TypeError("Number expected: initialCount.");
if ((initialCount |= 0) < 0) throw new RangeError("Argument out of range: initialCount.");
this._initialCount = initialCount;
this._remainingCount = initialCount;
this._event = new AsyncManualResetEvent(initialCount === 0);
}