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

    Function some

    • Creates a Some variant of an Option containing the given value.

      Wraps the provided value in a Some, indicating the presence of a value.

      Type Parameters

      • T

        The type of the value.

      Parameters

      • value: T

        The value to wrap in Some.

      Returns Option<T>

      An Option containing the value as Some.

      const x = some(42);

      expect(x.isSome()).toBe(true);
      expect(x.expect("Not 42")).toBe(42);