innerDecode = (encoded, skip = 0) => {
    switch (encoded.charAt(skip)) {
      case 'v': {
        return null;
      }
      case 'z': {
        return undefined;
      }
      case 'f': {
        return decodeBinary64(encoded, skip);
      }
      case 's': {
        return decodeStringSuffix(getSuffix(encoded, skip + 1));
      }
      case 'b': {
        const substring = getSuffix(encoded, skip + 1);
        if (substring === 'true') {
          return true;
        } else if (substring === 'false') {
          return false;
        }
        throw Fail`expected encoded boolean to be "btrue" or "bfalse": ${substring}`;
      }
      case 'n':
      case 'p': {
        return decodeBigInt(getSuffix(encoded, skip));
      }
      case 'r': {
        return decodeRemotable(getSuffix(encoded, skip), innerDecode);
      }
      case '?': {
        return decodePromise(getSuffix(encoded, skip), innerDecode);
      }
      case '!': {
        return decodeError(getSuffix(encoded, skip), innerDecode);
      }
      case 'y': {
        // Strings and symbols share decoding logic.
        const name = decodeStringSuffix(getSuffix(encoded, skip + 1));
        return passableSymbolForName(name);
      }
      case '[':
      case '^': {
        // @ts-expect-error Type 'unknown[]' is not Passable
        return decodeArray(encoded, innerDecode, skip);
      }
      case '(': {
        return decodeRecord(encoded, decodeArray, innerDecode, skip);
      }
      case ':': {
        return decodeTagged(encoded, decodeArray, innerDecode, skip);
      }
      default: {
        throw Fail`invalid database key: ${getSuffix(encoded, skip)}`;
      }
    }
  }
@type {(encoded: string, skip?: number) => Passable}