docs: function Semaphore(capacity, isFull, priority) {
      if (isNumeric(capacity)) {
          capacity = parseInt(capacity, 10);
          if (capacity <= 0) {
              capacity = Number.POSITIVE_INFINITY;
          }
      } else if (capacity !== Number.POSITIVE_INFINITY) {
          capacity = 1;
      } else {
          isFull = false;
      }
  
      const _queue = new SortedSet({
          comparator: priorityComparator
      });
  
      this.id = ++globalCounter;
      this._capacity = capacity;
      this._queue = _queue;
      this._numTokens = isFull ? capacity : 0;
      // eslint-disable-next-line no-magic-numbers
      this.priority = isNumeric(priority) ? parseInt(priority, 10) : 15;
  }