diff --git a/classes/index.Option.html b/classes/index.Option.html index 18ffd1a..cd81e48 100644 --- a/classes/index.Option.html +++ b/classes/index.Option.html @@ -1,6 +1,6 @@ Option | @wopjs/tsur - v0.1.6

Class Option<T>

The Option type is an immutable representation of an optional value: every Option is either Some and contains a value, or None and does not.

-

Type Parameters

  • T = any

Properties

Type Parameters

  • T = any

Properties

Methods

[iterator] and andThen @@ -31,99 +31,99 @@ Some unwrapOr

Properties

None: None = ...

The None value.

-

Methods

  • Returns an iterator over the possibly contained value.

    +

Methods

  • Returns an iterator over the possibly contained value.

    The iterator yields one value if the result is Some, otherwise none.

    -

    Returns Generator<T, void, unknown>

  • Type Parameters

    • B

    Parameters

    Returns Option<B>

    None if the Option is None, otherwise returns optionB.

    Arguments passed to and are eagerly evaluated; if you are passing the result of a function call, it is recommended to use andThen, which is lazily evaluated.

    -
  • Type Parameters

    • B

    Parameters

    • getOptionB: (value: T) => Option<B>

      A function that returns an Option

    • OptionalthisArg: any

      If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

    Returns Option<B>

    None if the Option is None, otherwise calls getOptionB with the wrapped value and returns the result.

    -
  • Returns None if the Option is None, otherwise calls predicate with the wrapped value and returns:

    +
  • Returns None if the Option is None, otherwise calls predicate with the wrapped value and returns:

    • Some(t) if predicate returns true (where t is the wrapped value with inferred new type), and
    • None if predicate returns false.

    Type Parameters

    • U

    Parameters

    • predicate: (value: T) => value is U

      A type predicate function that defines type guard by returning true or false.

    • OptionalthisArg: any

      If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      -

    Returns Option<U>

  • Returns None if the Option is None, otherwise calls predicate with the wrapped value and returns:

    +

Returns Option<U>

  • Returns None if the Option is None, otherwise calls predicate with the wrapped value and returns:

    • Some(t) if predicate returns true (where t is the wrapped value), and
    • None if predicate returns false.

    Parameters

    • predicate: (value: T) => boolean

      A function that returns true or false.

    • OptionalthisArg: any

      If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      -

    Returns Option<T>

    • Returns boolean

      true if the Option is a None.

      -
    • Whether this value is the same as the other Option.

      +

    Returns Option<T>

    Returns Result<T, E>

    Returns Option<Exclude<T, Falsy>>

  • Wrap a value in an Option if the value satisfies the predicate.

    Type Parameters

    Parameters

    • source: TSource

      Source value

    • predicate: (source: TSource) => source is T

      A function that returns true if the value satisfies the predicate, otherwise false

    • OptionalthisArg: any

      If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      -

    Returns Option<T>

  • Wrap a value in an Option if the value satisfies the predicate.

    +
  • Returns Option<T>

  • Wrap a value in an Option if the value satisfies the predicate.

    Type Parameters

    Parameters

    • source: TSource

      Source value

    • predicate: (source: TSource) => boolean

      A function that returns true if the value satisfies the predicate, otherwise false

      -
    • OptionalthisArg: any

    Returns Option<T>

  • +
    diff --git a/classes/index.Result.html b/classes/index.Result.html index 25fb713..98d94e9 100644 --- a/classes/index.Result.html +++ b/classes/index.Result.html @@ -1,5 +1,5 @@ Result | @wopjs/tsur - v0.1.6

    Class Result<T, E>

    The Result type is an immutable representation of either success (Ok) or failure (Err).

    -

    Type Parameters

    • T = any
    • E = any

    Methods

    Type Parameters

    • T = any
    • E = any

    Methods

    [iterator] and andThen err @@ -30,89 +30,89 @@ Ok try tryAsync -

    Methods

    • Returns an iterator over the possibly contained value.

      +

    Methods

    • Returns an iterator over the possibly contained value.

      The iterator yields one value if the result is Ok, otherwise none.

      -

      Returns Generator<T, void, unknown>

    • Type Parameters

      • BT
      • BE = any

      Parameters

    • Type Parameters

      • BT
      • BE = any

      Parameters

      • getResultB: (value: T) => Result<BT, BE>

        A function that returns a Result

      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns Result<BT, E | BE>

      Err if the Result is Err, otherwise calls getOptionB with the wrapped value and returns the result.

      -
    • Returns boolean

      true if the Result is an Err.

      -
    • Parameters

      • predicate: (error: E) => boolean
      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

        +
    • Returns boolean

      true if the Result is an Err.

      +
    • Parameters

      • predicate: (error: E) => boolean
      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns boolean

      true if the Result is an Err and and the error inside of it matches a predicate.

      -
    • Returns boolean

      true if the Result is an Ok.

      -
    • Parameters

      • predicate: (value: T) => boolean
      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

        +
    • Returns boolean

      true if the Result is an Ok.

      +
    • Parameters

      • predicate: (value: T) => boolean
      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns boolean

      true if the Result is an Ok and and the value inside of it matches a predicate.

      -
    • Whether this Ok value or Err error is the same as the other Result.

      +
    • Whether this Ok value or Err error is the same as the other Result.

      Parameters

      • other: unknown

        Another Result or any value

      Returns boolean

      true if the other is an Result and the Ok value or Err error is the same as this via Object.is.

      -
    • Maps an Result<T, E> to Result<U, E> by applying a function to a contained Ok value, leaving an Err value untouched.

      +
    • Maps an Result<T, E> to Result<U, E> by applying a function to a contained Ok value, leaving an Err value untouched.

      Type Parameters

      • U

      Parameters

      • fn: (value: T) => U

        A function that maps a value to another value

      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns Result<U, E>

      Err if the Result is Err, otherwise returns Ok(fn(value)).

      -
    • Maps a Result<T, E> to Result<T, F> by applying a function to a contained Err value, leaving an Ok value untouched.

      +
    • Maps a Result<T, E> to Result<T, F> by applying a function to a contained Err value, leaving an Ok value untouched.

      This function can be used to pass through a successful result while handling an error.

      Type Parameters

      • U

      Parameters

      • fn: (error: E) => U

        A function that maps a error to another error

      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns Result<T, U>

      Ok if the Result is Ok, otherwise returns Err(fn(error)).

      -
    • Extract the value from an Result in a way that handles both the Ok and Err cases.

      +
    • Extract the value from an Result in a way that handles both the Ok and Err cases.

      Type Parameters

      • U

      Parameters

      • Ok: (value: T) => U

        A function that returns a value if the Result is a Ok.

      • Err: (error: E) => U

        A function that returns a value if the Result is a Err.

      Returns U

      The value returned by the provided function.

      -
    • Type Parameters

      • BT
      • BE = any

      Parameters

      Returns Result<T | BT, E | BE>

      the Result if it is Ok, otherwise returns resultB.

      Arguments passed to or are eagerly evaluated; if you are passing the result of a function call, it is recommended to use orElse, which is lazily evaluated.

      -
    • Type Parameters

      • BT
      • BE = any

      Parameters

      • getResultB: () => Result<BT, BE>

        A function that returns an Result

      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns Result<T | BT, E | BE>

      the Result if it contains a value, otherwise calls getResultB and returns the result.

      -
    • Parameters

      • message: string = "called `Result.unwrap()` on an `Err`"

        Optional Error message

      Returns T

      the contained Ok value.

      if the value is an Err.

      -
    • Parameters

      • message: string = "called `Result.unwrapErr()` on an `Ok` value"

        Optional Error message

        +
    • Parameters

      • message: string = "called `Result.unwrapErr()` on an `Ok` value"

        Optional Error message

      Returns E

      the contained Err error.

      if the error is an Ok.

      -
    • Returns undefined | E

      the contained Err error or undefined otherwise.

      +

    Returns Result<T, E>

  • OK if the value satisfies the predicate, otherwise Err

    Type Parameters

    • T = any
    • E = any

    Parameters

    • source: T | E

      Source value

    • predicate: (source: T | E) => boolean

      A function that returns true if the value satisfies the predicate, otherwise false

    • OptionalthisArg: any

      If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      -

    Returns Result<T, E>

  • +
    diff --git a/functions/index.Err-1.html b/functions/index.Err-1.html index ecb1a8b..eed6656 100644 --- a/functions/index.Err-1.html +++ b/functions/index.Err-1.html @@ -2,4 +2,4 @@

    Wrap an error into an Result.

    +
    diff --git a/functions/index.Ok-1.html b/functions/index.Ok-1.html index e3a52c2..896ddec 100644 --- a/functions/index.Ok-1.html +++ b/functions/index.Ok-1.html @@ -2,4 +2,4 @@

    Wrap a value into an Result.

    +
    diff --git a/functions/index.Some-1.html b/functions/index.Some-1.html index 80d2b40..5b01e1e 100644 --- a/functions/index.Some-1.html +++ b/functions/index.Some-1.html @@ -2,4 +2,4 @@

    Wrap a value into an Option.

    +
    diff --git a/functions/index.filterMap.html b/functions/index.filterMap.html index 45b65e6..390a5aa 100644 --- a/functions/index.filterMap.html +++ b/functions/index.filterMap.html @@ -4,4 +4,4 @@
  • fn: (value: T, index: number, array: T[]) => Option<U>

    A function that produces an Option.

  • OptionalthisArg: any

    If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

  • Returns U[]

    An array of filtered and mapped values.

    -
    +
    diff --git a/functions/index.first.html b/functions/index.first.html index 9fe85bc..c42218c 100644 --- a/functions/index.first.html +++ b/functions/index.first.html @@ -3,4 +3,4 @@
  • predicate: (value: T, index: number, array: T[]) => boolean = truePredicate

    A predicate function.

  • OptionalthisArg: any

    If provided, it will be used as the this value for each invocation of predicate. If it is not provided, the first element is returned.

  • Returns Option<T>

    The first item that matches the predicate, or None if no item matches.

    -
    +
    diff --git a/functions/index.firstIndex.html b/functions/index.firstIndex.html index 7cd21f2..ee9b21a 100644 --- a/functions/index.firstIndex.html +++ b/functions/index.firstIndex.html @@ -3,4 +3,4 @@
  • predicate: (value: T, index: number, array: T[]) => boolean

    A predicate function.

  • OptionalthisArg: any

    If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

  • Returns Option<number>

    The index of the first item that matches the predicate, or None if no item matches.

    -
    +
    diff --git a/functions/index.firstMap.html b/functions/index.firstMap.html index 94f1e9b..d140c6b 100644 --- a/functions/index.firstMap.html +++ b/functions/index.firstMap.html @@ -4,4 +4,4 @@
  • fn: (value: T, index: number, array: T[]) => Option<U>

    A function that produces an Option.

  • OptionalthisArg: any

    If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

  • Returns Option<U>

    The first non-none result.

    -
    +
    diff --git a/functions/index.last.html b/functions/index.last.html index 6809824..414c0ec 100644 --- a/functions/index.last.html +++ b/functions/index.last.html @@ -3,4 +3,4 @@
  • predicate: (value: T, index: number, array: T[]) => boolean = truePredicate

    A predicate function.

  • OptionalthisArg: any

    If provided, it will be used as the this value for each invocation of predicate. If it is not provided, the last element is returned.

  • Returns Option<T>

    The last item that matches the predicate, or None if no item matches.

    -
    +
    diff --git a/functions/index.lastIndex.html b/functions/index.lastIndex.html index 72642d4..f8c02e2 100644 --- a/functions/index.lastIndex.html +++ b/functions/index.lastIndex.html @@ -3,4 +3,4 @@
  • predicate: (value: T, index: number, array: T[]) => boolean

    lastIndex calls predicate once for each element of the array, in backward order, until it finds one where predicate returns true.

  • OptionalthisArg: any

    If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

  • Returns Option<number>

    The index of the last item that matches the predicate, or None if no item matches.

    -
    +
    diff --git a/functions/index.lastMap.html b/functions/index.lastMap.html index 5ae3d19..84532b0 100644 --- a/functions/index.lastMap.html +++ b/functions/index.lastMap.html @@ -3,4 +3,4 @@
  • fn: (value: T, index: number, array: T[]) => Option<U>

    A function that produces an Option.

  • OptionalthisArg: any

    If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

  • Returns Option<U>

    The last non-none result.

    -
    +
    diff --git a/functions/index.mapWhile.html b/functions/index.mapWhile.html index f364640..fe35469 100644 --- a/functions/index.mapWhile.html +++ b/functions/index.mapWhile.html @@ -3,4 +3,4 @@
  • fn: (value: T, index: number, array: T[]) => Option<U>

    A function that produces an Option.

  • OptionalthisArg: any

    If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

  • Returns U[]

    An array of mapped values.

    -
    +
    diff --git a/functions/index.reduceWhile.html b/functions/index.reduceWhile.html index 193a8ec..ea54b2c 100644 --- a/functions/index.reduceWhile.html +++ b/functions/index.reduceWhile.html @@ -4,4 +4,4 @@
  • initialValue: U

    The initial value.

  • OptionalthisArg: any

    If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

  • Returns U

    The reduced value.

    -
    +
    diff --git a/interfaces/index.ResultMatcher.html b/interfaces/index.ResultMatcher.html index c6004ae..85cf2be 100644 --- a/interfaces/index.ResultMatcher.html +++ b/interfaces/index.ResultMatcher.html @@ -1,3 +1,3 @@ -ResultMatcher | @wopjs/tsur - v0.1.6

    Interface ResultMatcher<T, E, U>

    interface ResultMatcher<T = any, E = any, U = any> {
        Err: (error: E) => U;
        Ok: (value: T) => U;
    }

    Type Parameters

    • T = any
    • E = any
    • U = any

    Properties

    Err +ResultMatcher | @wopjs/tsur - v0.1.6

    Interface ResultMatcher<T, E, U>

    interface ResultMatcher<T = any, E = any, U = any> {
        Err: (error: E) => U;
        Ok: (value: T) => U;
    }

    Type Parameters

    • T = any
    • E = any
    • U = any

    Properties

    Properties

    Err: (error: E) => U
    Ok: (value: T) => U
    +

    Properties

    Err: (error: E) => U
    Ok: (value: T) => U
    diff --git a/interfaces/patches_array.Array.html b/interfaces/patches_array.Array.html index 0748fa0..cbdc37a 100644 --- a/interfaces/patches_array.Array.html +++ b/interfaces/patches_array.Array.html @@ -1,4 +1,4 @@ -Array | @wopjs/tsur - v0.1.6
    interface Array<T> {
        "[unscopables]": {
            "[unscopables]"?: boolean;
            length?: boolean;
            "[iterator]"?: any;
            $filterMap?: any;
            $first?: any;
            $firstIndex?: any;
            $firstMap?: any;
            $last?: any;
            $lastIndex?: any;
            $lastMap?: any;
            $mapWhile?: any;
            $reduceWhile?: any;
            at?: any;
            concat?: any;
            copyWithin?: any;
            entries?: any;
            every?: any;
            fill?: any;
            filter?: any;
            find?: any;
            findIndex?: any;
            findLast?: any;
            findLastIndex?: any;
            flat?: any;
            flatMap?: any;
            forEach?: any;
            includes?: any;
            indexOf?: any;
            join?: any;
            keys?: any;
            lastIndexOf?: any;
            map?: any;
            pop?: any;
            push?: any;
            reduce?: any;
            reduceRight?: any;
            reverse?: any;
            shift?: any;
            slice?: any;
            some?: any;
            sort?: any;
            splice?: any;
            toLocaleString?: any;
            toReversed?: any;
            toSorted?: any;
            toSpliced?: any;
            toString?: any;
            unshift?: any;
            values?: any;
            with?: any;
            [key: number]: undefined | boolean;
        };
        length: number;
        "[iterator]"(): ArrayIterator<T>;
        $filterMap<U>(
            fn: (value: T, index: number, array: T[]) => Option<U>,
            thisArg?: any,
        ): U[];
        $first(
            predicate?: (value: T, index: number, array: T[]) => boolean,
            thisArg?: any,
        ): Option<T>;
        $firstIndex(
            predicate: (value: T, index: number, array: T[]) => boolean,
            thisArg?: any,
        ): Option<number>;
        $firstMap<U>(
            fn: (value: T, index: number, array: T[]) => Option<U>,
            thisArg?: any,
        ): Option<U>;
        $last(
            predicate?: (value: T, index: number, array: T[]) => boolean,
            thisArg?: any,
        ): Option<T>;
        $lastIndex(
            predicate: (value: T, index: number, array: T[]) => boolean,
            thisArg?: any,
        ): Option<number>;
        $lastMap<U>(
            fn: (value: T, index: number, array: T[]) => Option<U>,
            thisArg?: any,
        ): Option<U>;
        $mapWhile<U>(
            fn: (value: T, index: number, array: T[]) => Option<U>,
            thisArg?: any,
        ): U[];
        $reduceWhile<U = T>(
            fn: (
                previousValue: U,
                currentValue: T,
                currentIndex: number,
                array: T[],
            ) => Option<U>,
            initialValue: U,
            thisArg?: any,
        ): U;
        at(index: number): undefined | T;
        concat(...items: ConcatArray<T>[]): T[];
        concat(...items: (T | ConcatArray<T>)[]): T[];
        copyWithin(target: number, start: number, end?: number): this;
        entries(): ArrayIterator<[number, T]>;
        every<S>(
            predicate: (value: T, index: number, array: T[]) => value is S,
            thisArg?: any,
        ): this is S[];
        every(
            predicate: (value: T, index: number, array: T[]) => unknown,
            thisArg?: any,
        ): boolean;
        fill(value: T, start?: number, end?: number): this;
        filter<S>(
            predicate: (value: T, index: number, array: T[]) => value is S,
            thisArg?: any,
        ): S[];
        filter(
            predicate: (value: T, index: number, array: T[]) => unknown,
            thisArg?: any,
        ): T[];
        find<S>(
            predicate: (value: T, index: number, obj: T[]) => value is S,
            thisArg?: any,
        ): undefined | S;
        find(
            predicate: (value: T, index: number, obj: T[]) => unknown,
            thisArg?: any,
        ): undefined | T;
        findIndex(
            predicate: (value: T, index: number, obj: T[]) => unknown,
            thisArg?: any,
        ): number;
        findLast<S>(
            predicate: (value: T, index: number, array: T[]) => value is S,
            thisArg?: any,
        ): undefined | S;
        findLast(
            predicate: (value: T, index: number, array: T[]) => unknown,
            thisArg?: any,
        ): undefined | T;
        findLastIndex(
            predicate: (value: T, index: number, array: T[]) => unknown,
            thisArg?: any,
        ): number;
        flat<A, D extends number = 1>(this: A, depth?: D): FlatArray<A, D>[];
        flatMap<U, This = undefined>(
            callback: (
                this: This,
                value: T,
                index: number,
                array: T[],
            ) => U | readonly U[],
            thisArg?: This,
        ): U[];
        forEach(
            callbackfn: (value: T, index: number, array: T[]) => void,
            thisArg?: any,
        ): void;
        includes(searchElement: T, fromIndex?: number): boolean;
        indexOf(searchElement: T, fromIndex?: number): number;
        join(separator?: string): string;
        keys(): ArrayIterator<number>;
        lastIndexOf(searchElement: T, fromIndex?: number): number;
        map<U>(
            callbackfn: (value: T, index: number, array: T[]) => U,
            thisArg?: any,
        ): U[];
        pop(): undefined | T;
        push(...items: T[]): number;
        reduce(
            callbackfn: (
                previousValue: T,
                currentValue: T,
                currentIndex: number,
                array: T[],
            ) => T,
        ): T;
        reduce(
            callbackfn: (
                previousValue: T,
                currentValue: T,
                currentIndex: number,
                array: T[],
            ) => T,
            initialValue: T,
        ): T;
        reduce<U>(
            callbackfn: (
                previousValue: U,
                currentValue: T,
                currentIndex: number,
                array: T[],
            ) => U,
            initialValue: U,
        ): U;
        reduceRight(
            callbackfn: (
                previousValue: T,
                currentValue: T,
                currentIndex: number,
                array: T[],
            ) => T,
        ): T;
        reduceRight(
            callbackfn: (
                previousValue: T,
                currentValue: T,
                currentIndex: number,
                array: T[],
            ) => T,
            initialValue: T,
        ): T;
        reduceRight<U>(
            callbackfn: (
                previousValue: U,
                currentValue: T,
                currentIndex: number,
                array: T[],
            ) => U,
            initialValue: U,
        ): U;
        reverse(): T[];
        shift(): undefined | T;
        slice(start?: number, end?: number): T[];
        some(
            predicate: (value: T, index: number, array: T[]) => unknown,
            thisArg?: any,
        ): boolean;
        sort(compareFn?: (a: T, b: T) => number): this;
        splice(start: number, deleteCount?: number): T[];
        splice(start: number, deleteCount: number, ...items: T[]): T[];
        toLocaleString(): string;
        toLocaleString(
            locales: string | string[],
            options?: NumberFormatOptions & DateTimeFormatOptions,
        ): string;
        toReversed(): T[];
        toSorted(compareFn?: (a: T, b: T) => number): T[];
        toSpliced(start: number, deleteCount: number, ...items: T[]): T[];
        toSpliced(start: number, deleteCount?: number): T[];
        toString(): string;
        unshift(...items: T[]): number;
        values(): ArrayIterator<T>;
        with(index: number, value: T): T[];
        [n: number]: T;
    }

    Type Parameters

    • T

    Hierarchy

    • RelativeIndexable<T>
      • Array

    Indexable

    • [n: number]: T

    Properties

    [unscopables] +Array | @wopjs/tsur - v0.1.6
    interface Array<T> {
        "[unscopables]": {
            "[unscopables]"?: boolean;
            length?: boolean;
            "[iterator]"?: any;
            $filterMap?: any;
            $first?: any;
            $firstIndex?: any;
            $firstMap?: any;
            $last?: any;
            $lastIndex?: any;
            $lastMap?: any;
            $mapWhile?: any;
            $reduceWhile?: any;
            at?: any;
            concat?: any;
            copyWithin?: any;
            entries?: any;
            every?: any;
            fill?: any;
            filter?: any;
            find?: any;
            findIndex?: any;
            findLast?: any;
            findLastIndex?: any;
            flat?: any;
            flatMap?: any;
            forEach?: any;
            includes?: any;
            indexOf?: any;
            join?: any;
            keys?: any;
            lastIndexOf?: any;
            map?: any;
            pop?: any;
            push?: any;
            reduce?: any;
            reduceRight?: any;
            reverse?: any;
            shift?: any;
            slice?: any;
            some?: any;
            sort?: any;
            splice?: any;
            toLocaleString?: any;
            toReversed?: any;
            toSorted?: any;
            toSpliced?: any;
            toString?: any;
            unshift?: any;
            values?: any;
            with?: any;
            [key: number]: undefined | boolean;
        };
        length: number;
        "[iterator]"(): ArrayIterator<T>;
        $filterMap<U>(
            fn: (value: T, index: number, array: T[]) => Option<U>,
            thisArg?: any,
        ): U[];
        $first(
            predicate?: (value: T, index: number, array: T[]) => boolean,
            thisArg?: any,
        ): Option<T>;
        $firstIndex(
            predicate: (value: T, index: number, array: T[]) => boolean,
            thisArg?: any,
        ): Option<number>;
        $firstMap<U>(
            fn: (value: T, index: number, array: T[]) => Option<U>,
            thisArg?: any,
        ): Option<U>;
        $last(
            predicate?: (value: T, index: number, array: T[]) => boolean,
            thisArg?: any,
        ): Option<T>;
        $lastIndex(
            predicate: (value: T, index: number, array: T[]) => boolean,
            thisArg?: any,
        ): Option<number>;
        $lastMap<U>(
            fn: (value: T, index: number, array: T[]) => Option<U>,
            thisArg?: any,
        ): Option<U>;
        $mapWhile<U>(
            fn: (value: T, index: number, array: T[]) => Option<U>,
            thisArg?: any,
        ): U[];
        $reduceWhile<U = T>(
            fn: (
                previousValue: U,
                currentValue: T,
                currentIndex: number,
                array: T[],
            ) => Option<U>,
            initialValue: U,
            thisArg?: any,
        ): U;
        at(index: number): undefined | T;
        concat(...items: ConcatArray<T>[]): T[];
        concat(...items: (T | ConcatArray<T>)[]): T[];
        copyWithin(target: number, start: number, end?: number): this;
        entries(): ArrayIterator<[number, T]>;
        every<S>(
            predicate: (value: T, index: number, array: T[]) => value is S,
            thisArg?: any,
        ): this is S[];
        every(
            predicate: (value: T, index: number, array: T[]) => unknown,
            thisArg?: any,
        ): boolean;
        fill(value: T, start?: number, end?: number): this;
        filter<S>(
            predicate: (value: T, index: number, array: T[]) => value is S,
            thisArg?: any,
        ): S[];
        filter(
            predicate: (value: T, index: number, array: T[]) => unknown,
            thisArg?: any,
        ): T[];
        find<S>(
            predicate: (value: T, index: number, obj: T[]) => value is S,
            thisArg?: any,
        ): undefined | S;
        find(
            predicate: (value: T, index: number, obj: T[]) => unknown,
            thisArg?: any,
        ): undefined | T;
        findIndex(
            predicate: (value: T, index: number, obj: T[]) => unknown,
            thisArg?: any,
        ): number;
        findLast<S>(
            predicate: (value: T, index: number, array: T[]) => value is S,
            thisArg?: any,
        ): undefined | S;
        findLast(
            predicate: (value: T, index: number, array: T[]) => unknown,
            thisArg?: any,
        ): undefined | T;
        findLastIndex(
            predicate: (value: T, index: number, array: T[]) => unknown,
            thisArg?: any,
        ): number;
        flat<A, D extends number = 1>(this: A, depth?: D): FlatArray<A, D>[];
        flatMap<U, This = undefined>(
            callback: (
                this: This,
                value: T,
                index: number,
                array: T[],
            ) => U | readonly U[],
            thisArg?: This,
        ): U[];
        forEach(
            callbackfn: (value: T, index: number, array: T[]) => void,
            thisArg?: any,
        ): void;
        includes(searchElement: T, fromIndex?: number): boolean;
        indexOf(searchElement: T, fromIndex?: number): number;
        join(separator?: string): string;
        keys(): ArrayIterator<number>;
        lastIndexOf(searchElement: T, fromIndex?: number): number;
        map<U>(
            callbackfn: (value: T, index: number, array: T[]) => U,
            thisArg?: any,
        ): U[];
        pop(): undefined | T;
        push(...items: T[]): number;
        reduce(
            callbackfn: (
                previousValue: T,
                currentValue: T,
                currentIndex: number,
                array: T[],
            ) => T,
        ): T;
        reduce(
            callbackfn: (
                previousValue: T,
                currentValue: T,
                currentIndex: number,
                array: T[],
            ) => T,
            initialValue: T,
        ): T;
        reduce<U>(
            callbackfn: (
                previousValue: U,
                currentValue: T,
                currentIndex: number,
                array: T[],
            ) => U,
            initialValue: U,
        ): U;
        reduceRight(
            callbackfn: (
                previousValue: T,
                currentValue: T,
                currentIndex: number,
                array: T[],
            ) => T,
        ): T;
        reduceRight(
            callbackfn: (
                previousValue: T,
                currentValue: T,
                currentIndex: number,
                array: T[],
            ) => T,
            initialValue: T,
        ): T;
        reduceRight<U>(
            callbackfn: (
                previousValue: U,
                currentValue: T,
                currentIndex: number,
                array: T[],
            ) => U,
            initialValue: U,
        ): U;
        reverse(): T[];
        shift(): undefined | T;
        slice(start?: number, end?: number): T[];
        some(
            predicate: (value: T, index: number, array: T[]) => unknown,
            thisArg?: any,
        ): boolean;
        sort(compareFn?: (a: T, b: T) => number): this;
        splice(start: number, deleteCount?: number): T[];
        splice(start: number, deleteCount: number, ...items: T[]): T[];
        toLocaleString(): string;
        toLocaleString(
            locales: string | string[],
            options?: NumberFormatOptions & DateTimeFormatOptions,
        ): string;
        toReversed(): T[];
        toSorted(compareFn?: (a: T, b: T) => number): T[];
        toSpliced(start: number, deleteCount: number, ...items: T[]): T[];
        toSpliced(start: number, deleteCount?: number): T[];
        toString(): string;
        unshift(...items: T[]): number;
        values(): ArrayIterator<T>;
        with(index: number, value: T): T[];
        [n: number]: T;
    }

    Type Parameters

    • T

    Hierarchy

    • RelativeIndexable<T>
      • Array

    Indexable

    • [n: number]: T

    Properties

    Methods

    [iterator] $filterMap @@ -61,49 +61,49 @@

    Type Parameters

    • U

    Parameters

    • fn: (value: T, index: number, array: T[]) => Option<U>

      A function that produces an Option.

    • OptionalthisArg: any

      If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

    Returns U[]

    An array of filtered and mapped values.

    -
    • From tsur.

      +
    • From tsur.

      first finds the first item that matches a predicate. Returns the first item of array if no predicate is provided.

      Parameters

      • Optionalpredicate: (value: T, index: number, array: T[]) => boolean

        A predicate function.

      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns Option<T>

      The first item that matches the predicate, or None if no item matches.

      -
    • From tsur.

      +
    • From tsur.

      Returns the index of the first element in the array that satisfies the provided testing function. Otherwise None is returned.

      Parameters

      • predicate: (value: T, index: number, array: T[]) => boolean

        A predicate function.

      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns Option<number>

      The index of the first item that matches the predicate, or None if no item matches.

      -
    • From tsur.

      Applies function to the elements of iterator and returns the first non-none result.

      firstMap(fn) is the lighter version of filterMap(fn).first().

      Type Parameters

      • U

      Parameters

      • fn: (value: T, index: number, array: T[]) => Option<U>

        A function that produces an Option.

      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns Option<U>

      The first non-none result.

      -
    • From tsur.

      +
    • From tsur.

      last finds the last item that matches a predicate. Returns the last item of array if no predicate is provided.

      Parameters

      • Optionalpredicate: (value: T, index: number, array: T[]) => boolean

        A predicate function.

      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns Option<T>

      The last item that matches the predicate, or None if no item matches.

      -
    • From tsur.

      +
    • From tsur.

      Returns the index of the last element in the array where predicate is true, and None otherwise.

      Parameters

      • predicate: (value: T, index: number, array: T[]) => boolean

        lastIndex calls predicate once for each element of the array, in backward order, until it finds one where predicate returns true.

      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns Option<number>

      The index of the last item that matches the predicate, or None if no item matches.

      -
    • From tsur.

      lastMap(fn) is the lighter version of filterMap(fn).last().

      Type Parameters

      • U

      Parameters

      • fn: (value: T, index: number, array: T[]) => Option<U>

        A function that produces an Option.

      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns Option<U>

      The last non-none result.

      -
    • From tsur.

      +
    • From tsur.

      mapWhile maps an iterable until the first None is encountered.

      Type Parameters

      • U

      Parameters

      • fn: (value: T, index: number, array: T[]) => Option<U>

        A function that produces an Option.

      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns U[]

      An array of mapped values.

      -
    • From tsur.

      +
    • From tsur.

      reduceWhile reduces an iterable until the first None is encountered.

      Type Parameters

      • U = T

      Parameters

      • fn: (
            previousValue: U,
            currentValue: T,
            currentIndex: number,
            array: T[],
        ) => Option<U>

        A function that produces an Option.

      • initialValue: U

        The initial value.

      • OptionalthisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

      Returns U

      The reduced value.

      -
    • Returns the item located at the specified index.

      +
    • Returns the item located at the specified index.

      Parameters

      • index: number

        The zero-based index of the desired code unit. A negative index will count back from the last item.

      Returns undefined | T

    • Combines two or more arrays. This method returns a new array without modifying any existing arrays.

      diff --git a/types/index.Err.html b/types/index.Err.html index f81d796..2cdff9f 100644 --- a/types/index.Err.html +++ b/types/index.Err.html @@ -1 +1 @@ -Err | @wopjs/tsur - v0.1.6

      Type Alias Err<E>

      Err: Result<any, E>

      Type Parameters

      • E
      +Err | @wopjs/tsur - v0.1.6

      Type Alias Err<E>

      Err: Result<any, E>

      Type Parameters

      • E
      diff --git a/types/index.None.html b/types/index.None.html index 6b6c0df..b9d1129 100644 --- a/types/index.None.html +++ b/types/index.None.html @@ -1 +1 @@ -None | @wopjs/tsur - v0.1.6

      Type Alias None

      None: Option<any>
      +None | @wopjs/tsur - v0.1.6

      Type Alias None

      None: Option<any>
      diff --git a/types/index.Ok.html b/types/index.Ok.html index 5189f17..43a26de 100644 --- a/types/index.Ok.html +++ b/types/index.Ok.html @@ -1 +1 @@ -Ok | @wopjs/tsur - v0.1.6

      Type Alias Ok<T>

      Ok: Result<T, any>

      Type Parameters

      • T
      +Ok | @wopjs/tsur - v0.1.6

      Type Alias Ok<T>

      Ok: Result<T, any>

      Type Parameters

      • T
      diff --git a/types/index.Some.html b/types/index.Some.html index 8b4cf4a..d89d751 100644 --- a/types/index.Some.html +++ b/types/index.Some.html @@ -1 +1 @@ -Some | @wopjs/tsur - v0.1.6

      Type Alias Some<T>

      Some: Option<T>

      Type Parameters

      • T
      +Some | @wopjs/tsur - v0.1.6

      Type Alias Some<T>

      Some: Option<T>

      Type Parameters

      • T
      diff --git a/types/index.UnwrapErr.html b/types/index.UnwrapErr.html index 6faa996..1fa9f73 100644 --- a/types/index.UnwrapErr.html +++ b/types/index.UnwrapErr.html @@ -1 +1 @@ -UnwrapErr | @wopjs/tsur - v0.1.6

      Type Alias UnwrapErr<E, Default>

      UnwrapErr: E extends Result<infer _S, infer U> ? U : Default

      Type Parameters

      • E
      • Default = E
      +UnwrapErr | @wopjs/tsur - v0.1.6

      Type Alias UnwrapErr<E, Default>

      UnwrapErr: E extends Result<infer _S, infer U> ? U : Default

      Type Parameters

      • E
      • Default = E
      diff --git a/types/index.UnwrapOk.html b/types/index.UnwrapOk.html index 14a0573..3357f94 100644 --- a/types/index.UnwrapOk.html +++ b/types/index.UnwrapOk.html @@ -1 +1 @@ -UnwrapOk | @wopjs/tsur - v0.1.6

      Type Alias UnwrapOk<T, Default>

      UnwrapOk: T extends Result<infer U> ? U : Default

      Type Parameters

      • T
      • Default = T
      +UnwrapOk | @wopjs/tsur - v0.1.6

      Type Alias UnwrapOk<T, Default>

      UnwrapOk: T extends Result<infer U> ? U : Default

      Type Parameters

      • T
      • Default = T
      diff --git a/types/index.UnwrapOption.html b/types/index.UnwrapOption.html index 76272e0..a96dcc4 100644 --- a/types/index.UnwrapOption.html +++ b/types/index.UnwrapOption.html @@ -1 +1 @@ -UnwrapOption | @wopjs/tsur - v0.1.6

      Type Alias UnwrapOption<T, Default>

      UnwrapOption: T extends Option<infer U> ? U : Default

      Type Parameters

      • T
      • Default = T
      +UnwrapOption | @wopjs/tsur - v0.1.6

      Type Alias UnwrapOption<T, Default>

      UnwrapOption: T extends Option<infer U> ? U : Default

      Type Parameters

      • T
      • Default = T
      diff --git a/variables/index.None-1.html b/variables/index.None-1.html index 1f42da3..4a18b8e 100644 --- a/variables/index.None-1.html +++ b/variables/index.None-1.html @@ -1,2 +1,2 @@ None | @wopjs/tsur - v0.1.6

      Variable NoneConst

      None: None = ...

      The None value.

      -
      +
    diff --git a/variables/patches_array.Array-1.html b/variables/patches_array.Array-1.html index 8ad5fc3..3607667 100644 --- a/variables/patches_array.Array-1.html +++ b/variables/patches_array.Array-1.html @@ -1 +1 @@ -Array | @wopjs/tsur - v0.1.6
    Array: ArrayConstructor
    +Array | @wopjs/tsur - v0.1.6
    Array: ArrayConstructor