functype 0.4.2 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/chunk-2I2NKDFN.mjs +1 -0
- package/dist/chunk-6GSI27WU.js +1 -0
- package/dist/chunk-AB3QRD66.js +1 -0
- package/dist/chunk-BSQMHA7A.js +1 -0
- package/dist/chunk-E6RS47F7.js +1 -0
- package/dist/chunk-I7TGEFK5.mjs +1 -0
- package/dist/chunk-JQ7HMWOT.mjs +1 -0
- package/dist/chunk-N3GTVYCO.js +1 -0
- package/dist/chunk-O7DO2OKU.mjs +1 -0
- package/dist/chunk-OWW7KOUW.mjs +1 -0
- package/dist/chunk-OXLZ6UIZ.js +1 -0
- package/dist/chunk-PJIXAQSQ.mjs +1 -0
- package/dist/chunk-Q65ZRGZH.js +1 -0
- package/dist/chunk-VK5GL6NM.mjs +1 -0
- package/dist/collections/index.d.mts +2 -2
- package/dist/collections/index.d.ts +2 -2
- package/dist/either/Either.d.mts +2 -2
- package/dist/either/Either.d.ts +2 -2
- package/dist/either/Either.js +1 -1
- package/dist/either/Either.mjs +1 -1
- package/dist/error/ParseError.d.mts +6 -2
- package/dist/error/ParseError.d.ts +6 -2
- package/dist/error/ParseError.js +1 -1
- package/dist/error/ParseError.mjs +1 -1
- package/dist/functor/index.d.mts +11 -11
- package/dist/functor/index.d.ts +11 -11
- package/dist/index-5xp8zYMn.d.mts +183 -0
- package/dist/index-8YakfACG.d.ts +183 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/iterable/Seq.d.mts +2 -2
- package/dist/iterable/Seq.d.ts +2 -2
- package/dist/iterable/Seq.js +1 -1
- package/dist/iterable/Seq.mjs +1 -1
- package/dist/iterable/index.d.mts +2 -2
- package/dist/iterable/index.d.ts +2 -2
- package/dist/iterable/index.js +1 -1
- package/dist/iterable/index.mjs +1 -1
- package/dist/list/List.d.mts +2 -2
- package/dist/list/List.d.ts +2 -2
- package/dist/list/List.js +1 -1
- package/dist/list/List.mjs +1 -1
- package/dist/map/Map.d.mts +2 -2
- package/dist/map/Map.d.ts +2 -2
- package/dist/map/Map.js +1 -1
- package/dist/map/Map.mjs +1 -1
- package/dist/map/shim.js +1 -1
- package/dist/map/shim.mjs +1 -1
- package/dist/option/Option.d.mts +2 -2
- package/dist/option/Option.d.ts +2 -2
- package/dist/option/Option.js +1 -1
- package/dist/option/Option.mjs +1 -1
- package/dist/set/Set.d.mts +2 -2
- package/dist/set/Set.d.ts +2 -2
- package/dist/set/Set.js +1 -1
- package/dist/set/Set.mjs +1 -1
- package/dist/set/shim.js +1 -1
- package/dist/set/shim.mjs +1 -1
- package/dist/try/Try.d.mts +2 -2
- package/dist/try/Try.d.ts +2 -2
- package/dist/try/Try.js +1 -1
- package/dist/try/Try.mjs +1 -1
- package/dist/tuple/Tuple.d.mts +7 -15
- package/dist/tuple/Tuple.d.ts +7 -15
- package/dist/tuple/Tuple.js +1 -1
- package/dist/tuple/Tuple.mjs +1 -1
- package/dist/typeable/Typeable.d.mts +6 -0
- package/dist/typeable/Typeable.d.ts +6 -0
- package/dist/{chunk-ZTL76QDL.js → typeable/Typeable.js} +1 -1
- package/dist/typeable/Typeable.mjs +1 -0
- package/dist/util/index.d.mts +2 -2
- package/dist/util/index.d.ts +2 -2
- package/dist/util/index.js +1 -1
- package/dist/util/index.mjs +1 -1
- package/dist/util/isIterable.d.mts +1 -1
- package/dist/util/isIterable.d.ts +1 -1
- package/dist/util/isIterable.js +1 -1
- package/dist/util/isIterable.mjs +1 -1
- package/lib/collections/index.d.ts +6 -6
- package/lib/either/Either.d.ts +25 -29
- package/lib/either/index.d.ts +1 -1
- package/lib/error/ParseError.d.ts +6 -2
- package/lib/functor/index.d.ts +10 -10
- package/lib/index.d.ts +9 -9
- package/lib/iterable/Seq.d.ts +27 -24
- package/lib/iterable/index.d.ts +7 -7
- package/lib/list/List.d.ts +20 -22
- package/lib/list/index.d.ts +4 -3
- package/lib/map/Map.d.ts +15 -35
- package/lib/map/index.d.ts +1 -1
- package/lib/option/Option.d.ts +25 -40
- package/lib/option/index.d.ts +6 -5
- package/lib/set/Set.d.ts +15 -18
- package/lib/set/index.d.ts +1 -1
- package/lib/try/Try.d.ts +21 -19
- package/lib/try/index.d.ts +1 -1
- package/lib/tuple/Tuple.d.ts +6 -13
- package/lib/tuple/index.d.ts +5 -1
- package/lib/typeable/Typeable.d.ts +4 -0
- package/lib/util/index.d.ts +1 -1
- package/lib/util/isIterable.d.ts +1 -1
- package/package.json +9 -9
- package/dist/chunk-2XH6TPQK.mjs +0 -1
- package/dist/chunk-35UIDXTO.js +0 -1
- package/dist/chunk-3APFKSCC.js +0 -1
- package/dist/chunk-3EH27NX2.js +0 -1
- package/dist/chunk-3OHJLCSR.mjs +0 -0
- package/dist/chunk-6BEXQNLZ.js +0 -1
- package/dist/chunk-74TKYQJS.mjs +0 -0
- package/dist/chunk-BYDMB2VV.js +0 -1
- package/dist/chunk-CFYIJKWF.mjs +0 -1
- package/dist/chunk-GTO34VMN.mjs +0 -1
- package/dist/chunk-HC3O3O2B.mjs +0 -1
- package/dist/chunk-HOO2EPER.mjs +0 -1
- package/dist/chunk-IC6AOOR5.mjs +0 -1
- package/dist/chunk-JR557W27.mjs +0 -1
- package/dist/chunk-KY3WKBLM.mjs +0 -1
- package/dist/chunk-O2XFH626.js +0 -1
- package/dist/chunk-Q4H3PCBH.mjs +0 -0
- package/dist/chunk-QQAQYRPV.js +0 -1
- package/dist/chunk-RM3O3IPT.js +0 -1
- package/dist/chunk-SKJIJETA.js +0 -1
- package/dist/chunk-T7AA7TJX.mjs +0 -1
- package/dist/chunk-TYHKMGLC.mjs +0 -1
- package/dist/chunk-V5UFW2E4.js +0 -1
- package/dist/chunk-XVHCBGUW.js +0 -1
- package/dist/chunk-ZOH672YH.js +0 -1
- package/dist/either/index.d.mts +0 -4
- package/dist/either/index.d.ts +0 -4
- package/dist/either/index.js +0 -1
- package/dist/either/index.mjs +0 -1
- package/dist/index-Dbjb4MUT.d.ts +0 -232
- package/dist/index-UMWeD2QH.d.mts +0 -232
- package/dist/list/index.d.mts +0 -4
- package/dist/list/index.d.ts +0 -4
- package/dist/list/index.js +0 -1
- package/dist/list/index.mjs +0 -1
- package/dist/map/index.d.mts +0 -4
- package/dist/map/index.d.ts +0 -4
- package/dist/map/index.js +0 -1
- package/dist/map/index.mjs +0 -1
- package/dist/option/index.d.mts +0 -4
- package/dist/option/index.d.ts +0 -4
- package/dist/option/index.js +0 -1
- package/dist/option/index.mjs +0 -1
- package/dist/set/index.d.mts +0 -4
- package/dist/set/index.d.ts +0 -4
- package/dist/set/index.js +0 -1
- package/dist/set/index.mjs +0 -1
- package/dist/try/index.d.mts +0 -4
- package/dist/try/index.d.ts +0 -4
- package/dist/try/index.js +0 -1
- package/dist/try/index.mjs +0 -1
- package/dist/tuple/index.d.mts +0 -8
- package/dist/tuple/index.d.ts +0 -8
- package/dist/tuple/index.js +0 -1
- package/dist/tuple/index.mjs +0 -1
package/lib/list/List.d.ts
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
+
import { Collection } from "../collections";
|
|
1
2
|
import { _Iterable_ } from "../iterable";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
toSet(): Set<A>;
|
|
22
|
-
toString(): string;
|
|
23
|
-
}
|
|
3
|
+
import { Option } from "../option/Option";
|
|
4
|
+
import { Set } from "../set/Set";
|
|
5
|
+
export type List<A> = {
|
|
6
|
+
add: (item: A) => List<A>;
|
|
7
|
+
map: <B>(f: (a: A) => B) => List<B>;
|
|
8
|
+
flatMap: <B>(f: (a: A) => _Iterable_<B>) => List<B>;
|
|
9
|
+
remove: (value: A) => List<A>;
|
|
10
|
+
contains: (value: A) => boolean;
|
|
11
|
+
removeAt: (index: number) => List<A>;
|
|
12
|
+
get: (index: number) => Option<A>;
|
|
13
|
+
concat: (other: List<A>) => List<A>;
|
|
14
|
+
toList: () => List<A>;
|
|
15
|
+
toSet: () => Set<A>;
|
|
16
|
+
toString: () => string;
|
|
17
|
+
valueOf: () => {
|
|
18
|
+
values: A[];
|
|
19
|
+
};
|
|
20
|
+
} & ArrayLike<A> & _Iterable_<A> & Collection<A>;
|
|
21
|
+
export declare const List: <A>(values?: Iterable<A> | _Iterable_<A>) => List<A>;
|
package/lib/list/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Type } from "../functor";
|
|
2
|
+
import { List } from "./List";
|
|
3
|
+
declare const list: <T extends Type>(items: T[] | undefined) => List<T>;
|
|
4
|
+
export { list, List };
|
package/lib/map/Map.d.ts
CHANGED
|
@@ -1,37 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { Collection } from "../collections";
|
|
2
|
+
import { Traversable } from "../index";
|
|
3
|
+
import { _Iterable_ } from "../iterable";
|
|
4
|
+
import { Option } from "../option/Option";
|
|
5
|
+
import { Tuple } from "../tuple/Tuple";
|
|
6
|
+
type SafeTraversable<K, V> = Omit<Traversable<Tuple<[K, V]>>, "map" | "flatMap">;
|
|
7
|
+
export type Map<K, V> = {
|
|
8
|
+
add(item: Tuple<[K, V]>): Map<K, V>;
|
|
9
|
+
remove(value: K): Map<K, V>;
|
|
10
|
+
map<U>(f: (value: V) => U): Map<K, U>;
|
|
11
|
+
flatMap<K2, V2>(f: (entry: Tuple<[K, V]>) => _Iterable_<[K2, V2]>): Map<K2, V2>;
|
|
12
|
+
get(key: K): Option<V>;
|
|
12
13
|
getOrElse(key: K, defaultValue: V): V;
|
|
13
|
-
orElse(key: K, alternative:
|
|
14
|
-
} & SafeTraversable<K, V> &
|
|
15
|
-
export declare
|
|
16
|
-
private values;
|
|
17
|
-
private get entries();
|
|
18
|
-
constructor(entries?: readonly (readonly [K, V])[] | IterableIterator<[K, V]> | null);
|
|
19
|
-
add(item: _Tuple_<[K, V]>): Map<K, V>;
|
|
20
|
-
remove(value: _Tuple_<[K, V]>): Map<K, V>;
|
|
21
|
-
contains(value: _Tuple_<[K, V]>): boolean;
|
|
22
|
-
get size(): number;
|
|
23
|
-
map<U>(f: (value: V) => U): _Map_<K, U>;
|
|
24
|
-
flatMap<U>(f: (value: V) => _Map_<K, U>): _Map_<K, U>;
|
|
25
|
-
reduce(f: (acc: Tuple<[K, V]>, value: Tuple<[K, V]>) => Tuple<[K, V]>): Tuple<[K, V]>;
|
|
26
|
-
reduceRight(f: (acc: Tuple<[K, V]>, value: Tuple<[K, V]>) => Tuple<[K, V]>): Tuple<[K, V]>;
|
|
27
|
-
foldLeft<B>(z: B): (op: (b: B, a: _Tuple_<[K, V]>) => B) => B;
|
|
28
|
-
foldRight<B>(z: B): (op: (a: _Tuple_<[K, V]>, b: B) => B) => B;
|
|
29
|
-
get(key: K): _Option_<V>;
|
|
30
|
-
getOrElse(key: K, defaultValue: V): V;
|
|
31
|
-
get isEmpty(): boolean;
|
|
32
|
-
orElse(key: K, alternative: _Option_<V>): _Option_<V>;
|
|
33
|
-
toList(): _List_<Tuple<[K, V]>>;
|
|
34
|
-
toSet(): _Set_<Tuple<[K, V]>>;
|
|
35
|
-
toString(): string;
|
|
36
|
-
}
|
|
14
|
+
orElse(key: K, alternative: Option<V>): Option<V>;
|
|
15
|
+
} & SafeTraversable<K, V> & Collection<Tuple<[K, V]>>;
|
|
16
|
+
export declare const Map: <K, V>(entries?: readonly (readonly [K, V])[] | IterableIterator<[K, V]> | null) => Map<K, V>;
|
|
37
17
|
export {};
|
package/lib/map/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Map
|
|
1
|
+
export { Map } from "./Map";
|
package/lib/option/Option.d.ts
CHANGED
|
@@ -1,44 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Functor, Type } from "../functor";
|
|
2
|
+
import { Traversable } from "../index";
|
|
3
3
|
import { _Iterable_ } from "../iterable";
|
|
4
|
-
|
|
4
|
+
import { Typeable } from "../typeable/Typeable";
|
|
5
|
+
export type Option<T extends Type> = {
|
|
6
|
+
readonly _tag: "Some" | "None";
|
|
7
|
+
readonly value: T | undefined;
|
|
8
|
+
isEmpty: boolean;
|
|
5
9
|
get(): T;
|
|
6
10
|
getOrElse(defaultValue: T): T;
|
|
7
|
-
orElse(alternative:
|
|
8
|
-
map<U extends Type>(f: (value: T) => U):
|
|
9
|
-
flatMap<U extends Type>(f: (value: T) =>
|
|
11
|
+
orElse(alternative: Option<T>): Option<T>;
|
|
12
|
+
map<U extends Type>(f: (value: T) => U): Option<U>;
|
|
13
|
+
flatMap<U extends Type>(f: (value: T) => Option<U>): Option<U>;
|
|
14
|
+
reduce<U>(f: (acc: U, value: T) => U): U;
|
|
15
|
+
reduceRight<U>(f: (acc: U, value: T) => U): U;
|
|
16
|
+
foldLeft<B>(z: B): (op: (b: B, a: T) => B) => B;
|
|
17
|
+
foldRight<B>(z: B): (op: (a: T, b: B) => B) => B;
|
|
10
18
|
toList(): _Iterable_<T>;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
reduce<U>(f: (acc: U, value: A) => U): U;
|
|
23
|
-
reduceRight<U>(f: (acc: U, value: A) => U): U;
|
|
24
|
-
foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
|
|
25
|
-
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
26
|
-
toList(): _Iterable_<A>;
|
|
27
|
-
contains(value: A): boolean;
|
|
28
|
-
get size(): number;
|
|
29
|
-
}
|
|
30
|
-
export declare class None<A extends Type> implements _Option_<A> {
|
|
31
|
-
get isEmpty(): boolean;
|
|
32
|
-
get(): A;
|
|
33
|
-
getOrElse(defaultValue: A): A;
|
|
34
|
-
orElse(alternative: _Option_<A>): _Option_<A>;
|
|
35
|
-
map<U extends Type>(f: (value: A) => U): _Option_<U>;
|
|
36
|
-
flatMap<U extends Type>(f: (value: A) => _Option_<U>): _Option_<U>;
|
|
37
|
-
reduce(f: (acc: A, value: A) => A): A;
|
|
38
|
-
reduceRight(f: (b: A, a: A) => A): A;
|
|
39
|
-
foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
|
|
40
|
-
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
41
|
-
toList(): _Iterable_<A>;
|
|
42
|
-
contains(value: A): boolean;
|
|
43
|
-
get size(): number;
|
|
44
|
-
}
|
|
19
|
+
contains(value: T): boolean;
|
|
20
|
+
size: number;
|
|
21
|
+
valueOf(): {
|
|
22
|
+
_tag: "Some" | "None";
|
|
23
|
+
value?: T;
|
|
24
|
+
};
|
|
25
|
+
toString(): string;
|
|
26
|
+
} & Traversable<T> & Functor<T> & Typeable<"Some" | "None">;
|
|
27
|
+
export declare const Some: <T extends Type>(value: T) => Option<T>;
|
|
28
|
+
export declare const None: <T extends Type>() => Option<T>;
|
|
29
|
+
export declare const Option: <T extends Type>(value: T | null | undefined) => Option<T>;
|
package/lib/option/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export
|
|
1
|
+
import { Type } from "../functor";
|
|
2
|
+
import { None, Option, Some } from "./Option";
|
|
3
|
+
export declare const option: <T extends Type>(value?: T) => Option<T>;
|
|
4
|
+
export declare const some: <T extends Type>(value: T) => Option<T>;
|
|
5
|
+
export declare const none: <T extends Type>() => Option<T>;
|
|
6
|
+
export { None, Option, Some };
|
package/lib/set/Set.d.ts
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
toSet(): _Set_<A>;
|
|
17
|
-
toString(): string;
|
|
18
|
-
}
|
|
1
|
+
import { Collection } from "../collections";
|
|
2
|
+
import { _Iterable_ } from "../iterable";
|
|
3
|
+
import { List } from "../list/List";
|
|
4
|
+
export type Set<A> = {
|
|
5
|
+
add: (value: A) => Set<A>;
|
|
6
|
+
remove: (value: A) => Set<A>;
|
|
7
|
+
contains: (value: A) => boolean;
|
|
8
|
+
has: (value: A) => boolean;
|
|
9
|
+
map: <B>(f: (a: A) => B) => Set<B>;
|
|
10
|
+
flatMap: <B>(f: (a: A) => _Iterable_<B>) => Set<B>;
|
|
11
|
+
toList: () => List<A>;
|
|
12
|
+
toSet: () => Set<A>;
|
|
13
|
+
toString: () => string;
|
|
14
|
+
} & _Iterable_<A> & Collection<A>;
|
|
15
|
+
export declare const Set: <A>(iterable?: Iterable<A> | _Iterable_<A>) => Set<A>;
|
package/lib/set/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Set
|
|
1
|
+
export { Set } from "./Set";
|
package/lib/try/Try.d.ts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { Either } from "../either";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { Either } from "../either/Either";
|
|
2
|
+
import { Typeable } from "../typeable/Typeable";
|
|
3
|
+
export type Try<T> = {
|
|
4
|
+
readonly _tag: "Success" | "Failure";
|
|
5
|
+
readonly value: T | undefined;
|
|
6
|
+
readonly error: Error | undefined;
|
|
7
|
+
isSuccess: () => boolean;
|
|
8
|
+
isFailure: () => boolean;
|
|
9
|
+
getOrElse: (defaultValue: T) => T;
|
|
10
|
+
orElse: (alternative: Try<T>) => Try<T>;
|
|
11
|
+
toEither: () => Either<Error, T>;
|
|
12
|
+
map: <U>(f: (value: T) => U) => Try<U>;
|
|
13
|
+
flatMap: <U>(f: (value: T) => Try<U>) => Try<U>;
|
|
14
|
+
valueOf: () => {
|
|
15
|
+
_tag: "Success" | "Failure";
|
|
16
|
+
value?: T;
|
|
17
|
+
error?: Error;
|
|
18
|
+
};
|
|
19
|
+
toString: () => string;
|
|
20
|
+
} & Typeable<"Success" | "Failure">;
|
|
21
|
+
export declare const Try: <T>(f: () => T) => Try<T>;
|
package/lib/try/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Try } from "./Try";
|
package/lib/tuple/Tuple.d.ts
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type
|
|
3
|
-
get(index:
|
|
4
|
-
getAs<U>(index: number, f?: (item: T) => boolean): U;
|
|
5
|
-
map<U extends any[]>(f: (value: T) => U): _Tuple_<U>;
|
|
6
|
-
flatMap<U extends any[]>(f: (value: T) => _Tuple_<U>): _Tuple_<U>;
|
|
7
|
-
};
|
|
8
|
-
export declare class Tuple<T extends ArrayType> implements _Tuple_<T> {
|
|
9
|
-
private readonly values;
|
|
10
|
-
constructor(values: T);
|
|
1
|
+
import { ArrayFunctor, ArrayType } from "../functor";
|
|
2
|
+
export type Tuple<T extends ArrayType> = {
|
|
3
|
+
get<K extends number>(index: K): T[K];
|
|
11
4
|
map<U extends ArrayType>(f: (value: T) => U): Tuple<U>;
|
|
12
5
|
flatMap<U extends ArrayType>(f: (value: T) => Tuple<U>): Tuple<U>;
|
|
13
|
-
get(index: number): T[number];
|
|
14
|
-
getAs<U>(index: number, f?: (item: T) => boolean): U;
|
|
15
6
|
toArray(): T;
|
|
16
|
-
|
|
7
|
+
[Symbol.iterator](): Iterator<T[number]>;
|
|
8
|
+
} & ArrayFunctor<T>;
|
|
9
|
+
export declare const Tuple: <T extends ArrayType>(values: T) => Tuple<T>;
|
package/lib/tuple/index.d.ts
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { ArrayType } from "../functor";
|
|
2
|
+
import { Tuple } from "./Tuple";
|
|
3
|
+
export { Tuple } from "./Tuple";
|
|
4
|
+
export declare const t: <T extends ArrayType>(values: T) => Tuple<T>;
|
|
5
|
+
export declare const tuple: <T extends ArrayType>(values: T) => Tuple<T>;
|
package/lib/util/index.d.ts
CHANGED
package/lib/util/isIterable.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const isIterable: <T>(value:
|
|
1
|
+
export declare const isIterable: <T>(value: unknown) => value is Iterable<T>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "functype",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "A smallish functional library for TypeScript",
|
|
5
5
|
"author": "jordan.burke@gmail.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
"@types/node": "^20.14.15",
|
|
10
10
|
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
|
11
11
|
"@typescript-eslint/parser": "^7.5.0",
|
|
12
|
-
"@types/jest": "29.5.
|
|
12
|
+
"@types/jest": "29.5.13",
|
|
13
13
|
"cross-env": "^7.0.3",
|
|
14
|
-
"eslint": "^
|
|
14
|
+
"eslint": "^8.57.0",
|
|
15
15
|
"eslint-config-prettier": "^9.1.0",
|
|
16
|
-
"eslint-plugin-import": "^2.
|
|
16
|
+
"eslint-plugin-import": "^2.30.0",
|
|
17
17
|
"eslint-plugin-prettier": "^5.2.1",
|
|
18
18
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
19
19
|
"jest": "^29.7.0",
|
|
20
20
|
"prettier": "^3.3.3",
|
|
21
21
|
"rimraf": "^6.0.1",
|
|
22
22
|
"tsup": "^8.2.4",
|
|
23
|
-
"ts-jest": "^29.2.
|
|
23
|
+
"ts-jest": "^29.2.5",
|
|
24
24
|
"ts-node": "^10.9.2",
|
|
25
|
-
"typescript": "^5.
|
|
25
|
+
"typescript": "^5.6.2"
|
|
26
26
|
},
|
|
27
27
|
"main": "./dist/index.js",
|
|
28
28
|
"module": "./dist/index.mjs",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"lint:fix": "eslint ./src --ext .ts,.tsx --quiet --fix --ignore-path ./.gitignore",
|
|
48
48
|
"lint:format": "prettier --loglevel warn --write \"./**/*.{ts,tsx,css,md,json}\" ",
|
|
49
49
|
"lint": "pnpm lint:format && pnpm lint:fix ",
|
|
50
|
-
"test": "jest",
|
|
51
|
-
"test:watch": "jest --watch",
|
|
52
|
-
"test:cov": "jest --coverage"
|
|
50
|
+
"test": "tsc && jest",
|
|
51
|
+
"test:watch": "tsc && jest --watch",
|
|
52
|
+
"test:cov": "tsc && jest --coverage"
|
|
53
53
|
}
|
|
54
54
|
}
|
package/dist/chunk-2XH6TPQK.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var a=class u{constructor(e){this.values=e}map(e){let r=e(this.values);return new u(r)}flatMap(e){return e(this.values)}get(e){return this.values[e]}getAs(e,r){let t=this.values[e];if(r){if(r(this.values))return t;throw new Error("Cannot cast tuple value")}else return t}toArray(){return this.values}};export{a};
|
package/dist/chunk-35UIDXTO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkV5UFW2E4js = require('./chunk-V5UFW2E4.js');var _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _chunkRM3O3IPTjs = require('./chunk-RM3O3IPT.js');var _chunk3APFKSCCjs = require('./chunk-3APFKSCC.js');var _chunkO2XFH626js = require('./chunk-O2XFH626.js');var i=class r{constructor(e){_chunkO2XFH626js.a.call(void 0, this,"values");this.values=new (0, _chunk5VTXJIR3js.a)(e)}get entries(){return Array.from(this.values.entries()).map(([e,t])=>new (0, _chunkV5UFW2E4js.a)([e,t]))}add(e){return new r(this.values.set(e.toArray()[0],e.toArray()[1]).entries())}remove(e){let t=new r([...this.values.entries()]);return t.values.delete(e[0])?t:this}contains(e){return this.values.get(e[0])===e[1]}get size(){return this.values.size}map(e){return new r(Array.from(this.values.entries()).map(t=>[t[0],e(t[1])]))}flatMap(e){let t=[];for(let[a,V]of this.values.entries()){let l=e(V);if(l instanceof r)for(let[f,m]of l.values.entries())t.push([f,m])}return new r(t)}reduce(e){return new (0, _chunk3APFKSCCjs.f)(this.entries).reduce(e)}reduceRight(e){return new (0, _chunk3APFKSCCjs.f)(this.entries).reduceRight(e)}foldLeft(e){let t=new (0, _chunk3APFKSCCjs.f)(this.entries);return a=>t.foldLeft(e)(a)}foldRight(e){let t=new (0, _chunk3APFKSCCjs.f)(this.entries);return a=>t.foldRight(e)(a)}get(e){return _chunk3APFKSCCjs.c.call(void 0, this.values.get(e))}getOrElse(e,t){return _chunk3APFKSCCjs.c.call(void 0, this.values.get(e)).getOrElse(t)}get isEmpty(){return this.values.size===0}orElse(e,t){let a=_chunk3APFKSCCjs.c.call(void 0, this.values.get(e));return t}toList(){return new (0, _chunkRM3O3IPTjs.b)(this.entries)}toSet(){return new (0, _chunkRM3O3IPTjs.a)(this.entries)}toString(){return`Map(${this.entries.toString()})`}},U=new i([["a",1],["b",2],["c",3]]);exports.a = i;
|
package/dist/chunk-3APFKSCC.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var _chunkO2XFH626js = require('./chunk-O2XFH626.js');var s=t=>t?_(t):l(),_= exports.d =t=>new o(t),l= exports.e =()=>new i;var n=class t{constructor(e){_chunkO2XFH626js.a.call(void 0, this,"values");_chunkBNNK42JCjs.a.call(void 0, e)?this.values=e:e instanceof t?this.values=e.toArray():e||(this.values=[])}get length(){return this.toArray().length}map(e){return new t(this.toArray().map(e))}flatMap(e){let r=[];for(let u of this.values){let a=e(u);a instanceof t&&r.push(...a.values)}return new t(r)}forEach(e){this.toArray().forEach(e)}count(e){return 0}exists(e){return!this.find(e).isEmpty}filter(e){return new t(this.toArray().filter(e))}filterNot(e){return new t(this.toArray().filter(r=>!e(r)))}find(e){let r=this.toArray().find(e);return s(r)}get head(){return this.values[0]}get headOption(){return this.isEmpty?s(this.head):l()}get isEmpty(){return this.toArray().length===0}get size(){return 0}toArray(){return Array.from(this.values)}reduce(e){return this.toArray().reduce(e)}reduceRight(e){return this.toArray().reduceRight(e)}foldLeft(e){return r=>this.toArray().reduce(r,e)}foldRight(e){return r=>this.toArray().reduceRight((u,a)=>r(a,u),e)}};var o=class t{constructor(e){this.value=e}get isEmpty(){return!1}get(){return this.value}getOrElse(e){return this.value}orElse(e){return this}map(e){return new t(e(this.value))}flatMap(e){return e(this.value)}reduce(e){return e(void 0,this.value)}reduceRight(e){return e(void 0,this.value)}foldLeft(e){return r=>r(e,this.value)}foldRight(e){return r=>r(this.value,e)}toList(){return new n([this.value])}contains(e){return!1}get size(){return 0}},i= exports.b =class t{get isEmpty(){return!0}get(){throw new Error("Cannot call get() on a None")}getOrElse(e){return e}orElse(e){return e}map(e){return new t}flatMap(e){return new t}reduce(e){return e(void 0,void 0)}reduceRight(e){return e(void 0,void 0)}foldLeft(e){return r=>e}foldRight(e){return r=>e}toList(){return new n}contains(e){return!1}get size(){return 0}};exports.a = o; exports.b = i; exports.c = s; exports.d = _; exports.e = l; exports.f = n;
|
package/dist/chunk-3EH27NX2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkRM3O3IPTjs = require('./chunk-RM3O3IPT.js');var _chunk3APFKSCCjs = require('./chunk-3APFKSCC.js');var u=class e{constructor(t){this.value=t}isLeft(){return!1}isRight(){return!0}map(t){return new e(t(this.value))}flatMap(t){return t(this.value)}toOption(){return _chunk3APFKSCCjs.d.call(void 0, this.value)}toList(){return new (0, _chunkRM3O3IPTjs.b)([this.value])}},n= exports.b =class e{constructor(t){this.value=t}isLeft(){return!0}isRight(){return!1}map(t){return new e(this.value)}flatMap(t){return new e(this.value)}toOption(){return _chunk3APFKSCCjs.e.call(void 0, )}toList(){return new _chunkRM3O3IPTjs.b}};exports.a = u; exports.b = n;
|
package/dist/chunk-3OHJLCSR.mjs
DELETED
|
File without changes
|
package/dist/chunk-6BEXQNLZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/dist/chunk-74TKYQJS.mjs
DELETED
|
File without changes
|
package/dist/chunk-BYDMB2VV.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3EH27NX2js = require('./chunk-3EH27NX2.js');var o=t=>new (0, _chunk3EH27NX2js.b)(t),i= exports.b =t=>new (0, _chunk3EH27NX2js.a)(t);exports.a = o; exports.b = i;
|
package/dist/chunk-CFYIJKWF.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=class extends Error{};export{e as a};
|
package/dist/chunk-GTO34VMN.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as i}from"./chunk-KY3WKBLM.mjs";import{d as r,e as s}from"./chunk-TYHKMGLC.mjs";var u=class e{constructor(t){this.value=t}isLeft(){return!1}isRight(){return!0}map(t){return new e(t(this.value))}flatMap(t){return t(this.value)}toOption(){return r(this.value)}toList(){return new i([this.value])}},n=class e{constructor(t){this.value=t}isLeft(){return!0}isRight(){return!1}map(t){return new e(this.value)}flatMap(t){return new e(this.value)}toOption(){return s()}toList(){return new i}};export{u as a,n as b};
|
package/dist/chunk-HC3O3O2B.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,b as r}from"./chunk-GTO34VMN.mjs";var o=t=>new r(t),i=t=>new e(t);export{o as a,i as b};
|
package/dist/chunk-HOO2EPER.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-2XH6TPQK.mjs";var t=r=>new e(r),o=r=>new e(r);export{t as a,o as b};
|
package/dist/chunk-IC6AOOR5.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as K}from"./chunk-2XH6TPQK.mjs";import{a as _}from"./chunk-377WQNCB.mjs";import{a as u,b as o}from"./chunk-KY3WKBLM.mjs";import{c as s,f as n}from"./chunk-TYHKMGLC.mjs";import{a as p}from"./chunk-JR557W27.mjs";var i=class r{constructor(e){p(this,"values");this.values=new _(e)}get entries(){return Array.from(this.values.entries()).map(([e,t])=>new K([e,t]))}add(e){return new r(this.values.set(e.toArray()[0],e.toArray()[1]).entries())}remove(e){let t=new r([...this.values.entries()]);return t.values.delete(e[0])?t:this}contains(e){return this.values.get(e[0])===e[1]}get size(){return this.values.size}map(e){return new r(Array.from(this.values.entries()).map(t=>[t[0],e(t[1])]))}flatMap(e){let t=[];for(let[a,V]of this.values.entries()){let l=e(V);if(l instanceof r)for(let[f,m]of l.values.entries())t.push([f,m])}return new r(t)}reduce(e){return new n(this.entries).reduce(e)}reduceRight(e){return new n(this.entries).reduceRight(e)}foldLeft(e){let t=new n(this.entries);return a=>t.foldLeft(e)(a)}foldRight(e){let t=new n(this.entries);return a=>t.foldRight(e)(a)}get(e){return s(this.values.get(e))}getOrElse(e,t){return s(this.values.get(e)).getOrElse(t)}get isEmpty(){return this.values.size===0}orElse(e,t){let a=s(this.values.get(e));return t}toList(){return new o(this.entries)}toSet(){return new u(this.entries)}toString(){return`Map(${this.entries.toString()})`}},U=new i([["a",1],["b",2],["c",3]]);export{i as a};
|
package/dist/chunk-JR557W27.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var d=Object.defineProperty;var e=(b,a,c)=>a in b?d(b,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):b[a]=c;var f=(b,a,c)=>e(b,typeof a!="symbol"?a+"":a,c);export{f as a};
|
package/dist/chunk-KY3WKBLM.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as A,f as s}from"./chunk-TYHKMGLC.mjs";import{a as m}from"./chunk-RRAIFS3D.mjs";import{a}from"./chunk-HA5XD5KC.mjs";var o=class e extends s{constructor(t){super(t)}map(t){return new e(super.map(t))}flatMap(t){return new e(super.flatMap(t))}remove(t){let i=new e().toArray().indexOf(t);return this.removeAt(i)}contains(t){return this.toArray().indexOf(t)!==-1}add(t){let i=[...this.toArray(),t];return new e(i)}removeAt(t){if(t<0||t>=this.toArray().length)return this;let r=[...this.toArray().slice(0,t),...this.toArray().slice(t+1)];return new e(r)}get(t){return A(this.toArray()[t])}concat(t){return new e([...this.toArray(),...t.toArray()])}toList(){return this}toSet(){return new n(this.toArray())}toString(){return`List(${this.toArray().toString()})`}};var w=e=>new o(e);var n=class e extends s{constructor(t){m(t)?super(new a(t)):super(t?.toArray())}add(t){return new e([...this.values,t])}remove(t){let r=new a;return r.delete(t)?new e(r):this}contains(t){return this.has(t)}has(t){return this.values.has(t)}map(t){return new e(super.map(t))}flatMap(t){return new e(super.flatMap(t))}toList(){return new o(this)}toSet(){return this}toString(){return`Set(${this.toArray().toString()})`}};export{n as a,o as b,w as c};
|
package/dist/chunk-O2XFH626.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var d=Object.defineProperty;var e=(b,a,c)=>a in b?d(b,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):b[a]=c;var f=(b,a,c)=>e(b,typeof a!="symbol"?a+"":a,c);exports.a = f;
|
package/dist/chunk-Q4H3PCBH.mjs
DELETED
|
File without changes
|
package/dist/chunk-QQAQYRPV.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3EH27NX2js = require('./chunk-3EH27NX2.js');var i=class t{constructor(r,e){this.value=r;this.error=e}static of(r){try{return new t(r(),null)}catch(e){return new t(null,e instanceof Error?e:new Error(String(e)))}}isSuccess(){return this.error===null}isFailure(){return this.error!==null}getOrElse(r){return this.isSuccess()?this.value:r}orElse(r){return this.isSuccess()?this:r}toEither(){return this.isSuccess()?new (0, _chunk3EH27NX2js.a)(this.value):new (0, _chunk3EH27NX2js.b)(this.error)}};exports.a = i;
|
package/dist/chunk-RM3O3IPT.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk3APFKSCCjs = require('./chunk-3APFKSCC.js');var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var _chunk3VJERXBPjs = require('./chunk-3VJERXBP.js');var o=class e extends _chunk3APFKSCCjs.f{constructor(t){super(t)}map(t){return new e(super.map(t))}flatMap(t){return new e(super.flatMap(t))}remove(t){let i=new e().toArray().indexOf(t);return this.removeAt(i)}contains(t){return this.toArray().indexOf(t)!==-1}add(t){let i=[...this.toArray(),t];return new e(i)}removeAt(t){if(t<0||t>=this.toArray().length)return this;let r=[...this.toArray().slice(0,t),...this.toArray().slice(t+1)];return new e(r)}get(t){return _chunk3APFKSCCjs.c.call(void 0, this.toArray()[t])}concat(t){return new e([...this.toArray(),...t.toArray()])}toList(){return this}toSet(){return new n(this.toArray())}toString(){return`List(${this.toArray().toString()})`}};var w=e=>new o(e);var n=class e extends _chunk3APFKSCCjs.f{constructor(t){_chunkBNNK42JCjs.a.call(void 0, t)?super(new (0, _chunk3VJERXBPjs.a)(t)):super(_optionalChain([t, 'optionalAccess', _ => _.toArray, 'call', _2 => _2()]))}add(t){return new e([...this.values,t])}remove(t){let r=new _chunk3VJERXBPjs.a;return r.delete(t)?new e(r):this}contains(t){return this.has(t)}has(t){return this.values.has(t)}map(t){return new e(super.map(t))}flatMap(t){return new e(super.flatMap(t))}toList(){return new o(this)}toSet(){return this}toString(){return`Set(${this.toArray().toString()})`}};exports.a = n; exports.b = o; exports.c = w;
|
package/dist/chunk-SKJIJETA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkV5UFW2E4js = require('./chunk-V5UFW2E4.js');var t=r=>new (0, _chunkV5UFW2E4js.a)(r),o= exports.b =r=>new (0, _chunkV5UFW2E4js.a)(r);exports.a = t; exports.b = o;
|
package/dist/chunk-T7AA7TJX.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as s,b as o}from"./chunk-GTO34VMN.mjs";var i=class t{constructor(r,e){this.value=r;this.error=e}static of(r){try{return new t(r(),null)}catch(e){return new t(null,e instanceof Error?e:new Error(String(e)))}}isSuccess(){return this.error===null}isFailure(){return this.error!==null}getOrElse(r){return this.isSuccess()?this.value:r}orElse(r){return this.isSuccess()?this:r}toEither(){return this.isSuccess()?new s(this.value):new o(this.error)}};export{i as a};
|
package/dist/chunk-TYHKMGLC.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as A}from"./chunk-RRAIFS3D.mjs";import{a as p}from"./chunk-JR557W27.mjs";var s=t=>t?_(t):l(),_=t=>new o(t),l=()=>new i;var n=class t{constructor(e){p(this,"values");A(e)?this.values=e:e instanceof t?this.values=e.toArray():e||(this.values=[])}get length(){return this.toArray().length}map(e){return new t(this.toArray().map(e))}flatMap(e){let r=[];for(let u of this.values){let a=e(u);a instanceof t&&r.push(...a.values)}return new t(r)}forEach(e){this.toArray().forEach(e)}count(e){return 0}exists(e){return!this.find(e).isEmpty}filter(e){return new t(this.toArray().filter(e))}filterNot(e){return new t(this.toArray().filter(r=>!e(r)))}find(e){let r=this.toArray().find(e);return s(r)}get head(){return this.values[0]}get headOption(){return this.isEmpty?s(this.head):l()}get isEmpty(){return this.toArray().length===0}get size(){return 0}toArray(){return Array.from(this.values)}reduce(e){return this.toArray().reduce(e)}reduceRight(e){return this.toArray().reduceRight(e)}foldLeft(e){return r=>this.toArray().reduce(r,e)}foldRight(e){return r=>this.toArray().reduceRight((u,a)=>r(a,u),e)}};var o=class t{constructor(e){this.value=e}get isEmpty(){return!1}get(){return this.value}getOrElse(e){return this.value}orElse(e){return this}map(e){return new t(e(this.value))}flatMap(e){return e(this.value)}reduce(e){return e(void 0,this.value)}reduceRight(e){return e(void 0,this.value)}foldLeft(e){return r=>r(e,this.value)}foldRight(e){return r=>r(this.value,e)}toList(){return new n([this.value])}contains(e){return!1}get size(){return 0}},i=class t{get isEmpty(){return!0}get(){throw new Error("Cannot call get() on a None")}getOrElse(e){return e}orElse(e){return e}map(e){return new t}flatMap(e){return new t}reduce(e){return e(void 0,void 0)}reduceRight(e){return e(void 0,void 0)}foldLeft(e){return r=>e}foldRight(e){return r=>e}toList(){return new n}contains(e){return!1}get size(){return 0}};export{o as a,i as b,s as c,_ as d,l as e,n as f};
|
package/dist/chunk-V5UFW2E4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var a=class u{constructor(e){this.values=e}map(e){let r=e(this.values);return new u(r)}flatMap(e){return e(this.values)}get(e){return this.values[e]}getAs(e,r){let t=this.values[e];if(r){if(r(this.values))return t;throw new Error("Cannot cast tuple value")}else return t}toArray(){return this.values}};exports.a = a;
|
package/dist/chunk-XVHCBGUW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/dist/chunk-ZOH672YH.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/dist/either/index.d.mts
DELETED
package/dist/either/index.d.ts
DELETED
package/dist/either/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBYDMB2VVjs = require('../chunk-BYDMB2VV.js');var _chunk3EH27NX2js = require('../chunk-3EH27NX2.js');require('../chunk-RM3O3IPT.js');require('../chunk-XVHCBGUW.js');require('../chunk-3APFKSCC.js');require('../chunk-BNNK42JC.js');require('../chunk-3VJERXBP.js');require('../chunk-O2XFH626.js');exports.Left = _chunk3EH27NX2js.b; exports.Right = _chunk3EH27NX2js.a; exports.left = _chunkBYDMB2VVjs.a; exports.right = _chunkBYDMB2VVjs.b;
|
package/dist/either/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as c,b as d}from"../chunk-HC3O3O2B.mjs";import{a,b}from"../chunk-GTO34VMN.mjs";import"../chunk-KY3WKBLM.mjs";import"../chunk-74TKYQJS.mjs";import"../chunk-TYHKMGLC.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-JR557W27.mjs";export{b as Left,a as Right,c as left,d as right};
|