@ts-rust/std - v0.0.5
    Preparing search index...

    Function pendingSome

    • Creates a PendingOption<T> that resolves to Some containing the awaited value.

      Takes a value or promise and wraps its resolved result in a Some, ensuring the value type is Awaited to handle any PromiseLike input.

      Type Parameters

      • T

        The type of the input value or promise.

      Parameters

      Returns PendingOption<Awaited<T>>

      A PendingOption resolving to Some with the awaited value.

      const x = pendingSome(42);
      const y = pendingSome(Promise.resolve("hello"));

      expect(await x).toStrictEqual(some(42));
      expect(await y).toStrictEqual(some("hello"));