FuncType - v0.8.85
    Preparing search index...

    Variable Option

    Option: <T extends unknown>(value: undefined | null | T) => Option<T> & {
        from: <T>(value: T) => Option<T>;
        fromBinary: <T>(binary: string) => Option<T>;
        fromJSON: <T>(json: string) => Option<T>;
        fromYAML: <T>(yaml: string) => Option<T>;
        none: <T>() => Option<T>;
    }

    Type declaration

      • <T extends unknown>(value: undefined | null | T): Option<T>
      • Safely wraps a value that might be null or undefined in an Option. Creates Some if the value is defined, None otherwise.

        Type Parameters

        • T extends unknown

          The type of the value

        Parameters

        • value: undefined | null | T

          The value to wrap (might be null/undefined)

        Returns Option<T>

        Some(value) if value is defined, None otherwise

    • from: <T>(value: T) => Option<T>

      Creates an Option from any value. Alias for Option function.

    • fromBinary: <T>(binary: string) => Option<T>

      Creates an Option from binary string

    • fromJSON: <T>(json: string) => Option<T>

      Creates an Option from JSON string

    • fromYAML: <T>(yaml: string) => Option<T>

      Creates an Option from YAML string

    • none: <T>() => Option<T>

      Returns a None instance. Alias for None function.