diff --git a/assets/search.js b/assets/search.js index e763981..14ca837 100644 --- a/assets/search.js +++ b/assets/search.js @@ -1 +1 @@ -window.searchData = "eJy9nEtz2zgSx78Lc2Uc4Q35Nocc9jCbqs3uzkHlSnFsZs3Ss0g5j3X5u2+BpMRuNkC1xOyc5DLR/UeDPzSANuTXrN5/b7L71Wu2rnZP2b3Ms12xLbP7rNo9lT+yPHupN9l9tt0/vWzK5kP727vn43aT5dnjpmiassnus+wtpx4OxfHxuWw+FHVd/CSe+qdf2qfTHhdLJ8zg91+773Vx+HQ4Vvvd2e3x5+HcPdgg4jnPDkVd7o7nIAcpIf1ZZiTQO+glbnEuF3rw/nm/LS/7ftd0zSYE+uYwiIXUZ52/73ccnV3X7CodFM/Xer9l6PTNbtepGu57eVc1+1PTOXqfC9abqpqm2Jbv5Sy1l47cmqHXNd3X79Xc+HgkVs0tLI60mDRWzWweu7h+2z2xQyvatn8ZKbO0ClZccyMqdk//fC45U63YPR27lrer7TnUt43maHzcNJx3tK/LruHtWj9YAf2YGdF/qwNDpWs1S+WP6vjMU/retZyTBXlRndrNWLU2xfHIInxoOUOt2hxLDhTnhrdrbQvOCHatblc51sWuOexZUwq2nTGD16zVcb+emynWn9i5Yv0LskW3nLPX/b96l/FL9JjjedKcPabbcMRgzYKu3Yx5sP98rKvdfzjTYN+cmt6ut6qOZV0c9/UDZ7/Rt71W0er4aeXry+4xND1phYfvxbVnIXymQwLwLBceXOdayfjh51tRV8WfwyE2PJzbbSQAux0ezHPdH2LXUyfc9a+Q+FjXExof6/pKEWPPAv8om5fN8ff2pD+IVLtjWX8tHs9KqNmVB3Z41gWDxdB4t19fmBG4+2BiGKOGIL98CaN2pfLZiK1/92mdihu+QY58WV/KBf+3yMu6viH0EGC8SNO1SyTB7uGMIg0AKun53X598dDf9zKhAl9fWqas65k6EyUaKMQo0UzrHOufDJmu1SyV35qfu0eeVNE3vV2varisvaua+tR0jt5EOQGrsQpPl9RYrFcNM2mmdXi0Vw03SU1FlC7/jIO6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eUBcYM1Son/lvC6NMxDMYp2J6jO04gGAs5EC/nTfM907tP2nO20BeEtA971IEDyQkDzOh687AjfgdUpmqCTfAb54WOFQBAhFnEaJl1FoQAIEJE67LV76HP3bE+ATuGR56i7CUOiBI88bKbouKJDTNS+rdE62p29zAV9gvdO8ER8vA9BDP2NOn7zODbfmQL9AdlD9QuWY7oY7voBy0EvZT3DL9YdQUCDnaF42Hr7EAkYNBGh4A3+6gwuiAiuD7Jd3y8sm4OYpiA3O4/5g4njAo1ulIEy4E+JleXJLFHgD5Dve9Omv9eLkDDYc6prhookPHr6ucYQGCRDVD7rsPy0PMHx3GfQOjJda9O+TC1v7DxqALwCs5DHxY5TlAQuCN+yjPggQj+ANzfmfWgAvYLwlYzQe8uxQHcpNtSuz+9XD29v/AHqUHEI="; \ No newline at end of file +window.searchData = "eJy9nEuP2zgSx7+LclU65pvu2xz6sIfZAJvdnYPRGGi7lY3QfkFy57GNfPcF9bCqVKRctoI5OWix6s+ifiwWaTpvWX341mT3m7fspdo/Z/cyz/bFrszus2r/XH7P8uy13mb32e7w/Lotmw/tX+++nHbbLM+etkXTlE12n2U/c+rhWJyevpTNh6Kuix/EU//0z/bpvMfV2gkz+v3X/ltdHD8eT9Vhf3Z7+nE8dw82iHjOs2NRl/vTOchRSkh/lpkI9A56iVucy5UevX867MrLvt81XbMZgb45DGIl9Vnn74c9R2ffNbtKB8XzuT7sGDp9s9t1qob7Xt5VzWFoukTvU8F6U1XTFLvyvVyk9tqRWzP0uqaH+r1aGh+PxKq5hcWJFpPGqlnMYxfXb/tndmhF2/YvI2WRVsGKa2lExf75n19KzlQr9s+nruXtagcO9W2jJRoP24bzjg512TW8Xes7K6DvCyP6X3VkqHStFqn8UZ2+8JS+dS2XZEFeVEO7BavWtjidWISPLReoVdtTyYHi3PB2rV3BGcGu1e0qp7rYN8cDa0rBtgtm8AtrdTy8LM0ULx/ZueLlF2SLbjlnr/t/dZXxS/SY4zloLh7TXdhisGZB127BPDh8OtXV/r+caXB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85vvozKEjARxJvqNJTMYANzwgzpdTwAiDzsj+NdoVz1t7k3F0BYCwPQ+8bpERWo2eeF3p77OBFw7AMbwxHi+OATdguhjeOx9+VAjmHBhiIZhOwtUU0A/gwvBdTKMBBBvebBp/3Dq6cWAuMZ0MFzZBX8A71rwZOdy1G52AWe07I6H6nLbqPw3X9QG7FqB/ggvh+fedwA8AUTBBPN8XANkWAKD6GB0PyO5bSJA3ANOeNzzBBU1jIDLPoyn4mWYxkDU8D6eJBwmolv0CaXlzZLjZBrAESdXyXteuOH7rvnAHbtYgKh49/SUYEBfwoUT/ynldmmYgEFS/Mqs+QyvekONspIA/3fdMDyPff7qhBOAtAd0P6UDwQELyXXRXloAbQJdkhkryHeCLhzkORYBQRD/shlcQ0YAECEj01ZXhpc/J/5MBfAKXLE/dDRICvQEp03M9TdcFBVYXzRvuzslu+PkP8AUynebNwukyAD30M2b45KXO8boZ6BcYKNXXXI4XK7gcCygHvZRDCc71h1BQYEXVvPky/voDuAGpS/NQHy6vgqgACbJf3i0vFYArm6BTcB6ve3+8qYOuYwI4wGR0PL7I9UrgDdZVvOnT34fFyRksy+qasaeJD26+rnGEBgmg0A+6HAafBxi+9At6B1hVfblnuQG3v+gHvsCMlLyx/z7J8uDtCV4vJn0QIB7B4/L8vyAAL2C8JYPJxzw7VsdyW+3L7H7z+PPn/wFfJ4Xy"; \ No newline at end of file diff --git a/classes/index.Option.html b/classes/index.Option.html index 52a56dc..d4cef1f 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 f9056d8..b09f2ed 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 @@ -32,87 +32,87 @@ tryAsync

    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

    Parameters

    Returns Result<T, E>

  • +
    diff --git a/functions/index.Err-1.html b/functions/index.Err-1.html index 116ea2a..7edba77 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 74d4cdd..c1607c2 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 95d2558..64e50aa 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 dc37742..4da6564 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 414cd8f..a12c9ac 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 6dce714..7cf14c7 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 2ab64c5..2e79610 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 80b6d66..33b249c 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 b9022c8..f4a578c 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 a4d0d33..d26de66 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 9b2c705..02b3192 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 2d92ae4..265931d 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/index.html b/index.html index 5d781b7..a713e3b 100644 --- a/index.html +++ b/index.html @@ -1,11 +1,11 @@ -@wopjs/tsur - v0.1.6

    @wopjs/tsur - v0.1.6

    tsur

    +@wopjs/tsur - v0.1.6

    @wopjs/tsur - v0.1.6

    tsur

    -

    Docs -Build Status -npm-version -Coverage Status -minified-size

    +

    Docs +Build Status +npm-version +Coverage Status +minified-size

    TypeScript goodies inspired by Rust.

    This project draws inspiration from Rust, but is designed to be more ergonomic and tailored to TypeScript's features and syntax.

    npm add @wopjs/tsur
    @@ -28,6 +28,6 @@
     
    import "@wopjs/tsur/patches/array";

    const arr = [1, 2, 3, 4, 5];

    const result = arr.filterMap(x => (x % 2 === 0 ? Some(x * 2) : None));

    console.log(result); // [4, 8]
    -

    See docs for more details.

    -

    MIT @ CRIMX

    +

    See docs for more details.

    +

    MIT @ CRIMX

    diff --git a/interfaces/index.ResultMatcher.html b/interfaces/index.ResultMatcher.html index b0d4ed3..5b6bf16 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 e1218f7..40c84e5 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 @@ -50,9 +50,9 @@ with

    Properties

    "[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;
    }

    Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.

    -

    Type declaration

    • [key: number]: undefined | boolean
    • Optional Readonly[unscopables]?: boolean

      Is an object whose properties have the value 'true' +

      Type declaration

      • [key: number]: undefined | boolean
      • Optional Readonly[unscopables]?: boolean

        Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.

        -
      • Optionallength?: boolean

        Gets or sets the length of the array. This is a number one higher than the highest index in the array.

        +
      • Optionallength?: boolean

        Gets or sets the length of the array. This is a number one higher than the highest index in the array.

    length: number

    Gets or sets the length of the array. This is a number one higher than the highest index in the array.

    Methods

    • Iterator

      Returns ArrayIterator<T>

    • From tsur.

      @@ -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 8a4e8da..6eeda31 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 c3bbb9b..b0576db 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 873ab91..54cc2e4 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 3976720..9234441 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 c701c74..130e62e 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 0023034..1e45870 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 12a3f31..abf0c95 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 353f1f4..ac943b5 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 178fdac..4a19cee 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