mona-dish
    Preparing search index...

    Function saveResolve

    • helper function to safely resolve anything this is not an elvis operator, it resolves a value without exception in a tree and if it is not resolvable then an optional of a default value is restored or Optional.empty if none is given

      usage let var: Optiona = saveResolve(() => a.b.c.d.e, "foobaz")

      Type Parameters

      • T

      Parameters

      • resolverProducer: () => T

        a lambda which can produce the value

      • defaultValue: T | null = null

        an optional default value if the producer fails to produce anything

      Returns Optional<T>

      an Optional of the produced value