@grabjs/superapp-sdk
    Preparing search index...

    Function isFound

    • Type guard to check if an SDK response has a 302 status code.

      Type Parameters

      Parameters

      • response: T

        The SDK response to check

      Returns response is Extract<T, { status_code: 302 }>

      true if the response has 302 status code, false otherwise

      const response = await someBridgeMethod();
      if (isFound(response)) {
      // response narrowed to status code `302` variant
      console.log('Redirecting...');
      }