@mikuroxina/mini-fn
    Preparing search index...

    Function and

    • Returns None if optA is None, otherwise returns optB. The order of arguments is reversed because of that it is useful for partial applying.

      Type Parameters

      • U

      Parameters

      • optB: Option.Option<U>

        The second optional when used optA is Some.

      Returns <T>(optA: Option.Option<T>) => Option.Option<U>

      optB or a None.

      Examples

      expect(and(none())(none())).toStrictEqual(none());
      expect(and(none())(some(2))).toStrictEqual(none());
      expect(and(some("foo"))(none())).toStrictEqual(none());
      expect(and(some("foo"))(some(2))).toStrictEqual(some("foo"));