functype 0.8.47 → 0.8.49

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.
Files changed (140) hide show
  1. package/dist/index.d.ts +302 -8
  2. package/dist/index.mjs +2 -1
  3. package/dist/index.mjs.map +1 -0
  4. package/package.json +17 -16
  5. package/dist/chunk-2I2NKDFN.mjs +0 -1
  6. package/dist/chunk-2ML63TYF.mjs +0 -0
  7. package/dist/chunk-2U34DUZU.js +0 -1
  8. package/dist/chunk-377WQNCB.mjs +0 -1
  9. package/dist/chunk-3VJERXBP.js +0 -1
  10. package/dist/chunk-44WWBXBL.js +0 -1
  11. package/dist/chunk-4H62YQ42.mjs +0 -0
  12. package/dist/chunk-5GE5W3Y5.mjs +0 -1
  13. package/dist/chunk-5VTXJIR3.js +0 -1
  14. package/dist/chunk-AKJ5AKY4.js +0 -1
  15. package/dist/chunk-E6RS47F7.js +0 -1
  16. package/dist/chunk-HA5XD5KC.mjs +0 -1
  17. package/dist/chunk-HD6YYUHO.mjs +0 -1
  18. package/dist/chunk-K3EKBPQE.js +0 -1
  19. package/dist/chunk-OXLZ6UIZ.js +0 -1
  20. package/dist/chunk-UAFRIAJN.js +0 -1
  21. package/dist/chunk-V2J3R5IU.mjs +0 -0
  22. package/dist/chunk-VK5GL6NM.mjs +0 -1
  23. package/dist/chunk-WTWWDZY6.js +0 -1
  24. package/dist/chunk-XORABVON.js +0 -1
  25. package/dist/chunk-YXECCMSX.mjs +0 -1
  26. package/dist/chunk-Z6YAH4SC.mjs +0 -1
  27. package/dist/collections/index.d.mts +0 -8
  28. package/dist/collections/index.d.ts +0 -8
  29. package/dist/collections/index.js +0 -1
  30. package/dist/collections/index.mjs +0 -0
  31. package/dist/core/base/Base.d.mts +0 -12
  32. package/dist/core/base/Base.d.ts +0 -12
  33. package/dist/core/base/Base.js +0 -1
  34. package/dist/core/base/Base.mjs +0 -1
  35. package/dist/core/error/Throwable.d.mts +0 -12
  36. package/dist/core/error/Throwable.d.ts +0 -12
  37. package/dist/core/error/Throwable.js +0 -1
  38. package/dist/core/error/Throwable.mjs +0 -1
  39. package/dist/core/task/Task.d.mts +0 -8
  40. package/dist/core/task/Task.d.ts +0 -8
  41. package/dist/core/task/Task.js +0 -1
  42. package/dist/core/task/Task.mjs +0 -1
  43. package/dist/either/Either.d.mts +0 -8
  44. package/dist/either/Either.d.ts +0 -8
  45. package/dist/either/Either.js +0 -1
  46. package/dist/either/Either.mjs +0 -1
  47. package/dist/error/ParseError.d.mts +0 -8
  48. package/dist/error/ParseError.d.ts +0 -8
  49. package/dist/error/ParseError.js +0 -1
  50. package/dist/error/ParseError.mjs +0 -1
  51. package/dist/functor/index.d.mts +0 -20
  52. package/dist/functor/index.d.ts +0 -20
  53. package/dist/functor/index.js +0 -1
  54. package/dist/functor/index.mjs +0 -1
  55. package/dist/identity/Identity.d.mts +0 -6
  56. package/dist/identity/Identity.d.ts +0 -6
  57. package/dist/identity/Identity.js +0 -1
  58. package/dist/identity/Identity.mjs +0 -1
  59. package/dist/index-BSGv2rsm.d.mts +0 -240
  60. package/dist/index-Cb-cundW.d.ts +0 -240
  61. package/dist/index.d.mts +0 -8
  62. package/dist/index.js +0 -1
  63. package/dist/iterable/index.d.mts +0 -8
  64. package/dist/iterable/index.d.ts +0 -8
  65. package/dist/iterable/index.js +0 -1
  66. package/dist/iterable/index.mjs +0 -1
  67. package/dist/list/List.d.mts +0 -8
  68. package/dist/list/List.d.ts +0 -8
  69. package/dist/list/List.js +0 -1
  70. package/dist/list/List.mjs +0 -1
  71. package/dist/map/Map.d.mts +0 -8
  72. package/dist/map/Map.d.ts +0 -8
  73. package/dist/map/Map.js +0 -1
  74. package/dist/map/Map.mjs +0 -1
  75. package/dist/map/shim.d.mts +0 -4
  76. package/dist/map/shim.d.ts +0 -4
  77. package/dist/map/shim.js +0 -1
  78. package/dist/map/shim.mjs +0 -1
  79. package/dist/option/Option.d.mts +0 -8
  80. package/dist/option/Option.d.ts +0 -8
  81. package/dist/option/Option.js +0 -1
  82. package/dist/option/Option.mjs +0 -1
  83. package/dist/serializable/Serializable.d.mts +0 -16
  84. package/dist/serializable/Serializable.d.ts +0 -16
  85. package/dist/serializable/Serializable.js +0 -3
  86. package/dist/serializable/Serializable.mjs +0 -3
  87. package/dist/set/Set.d.mts +0 -8
  88. package/dist/set/Set.d.ts +0 -8
  89. package/dist/set/Set.js +0 -1
  90. package/dist/set/Set.mjs +0 -1
  91. package/dist/set/shim.d.mts +0 -4
  92. package/dist/set/shim.d.ts +0 -4
  93. package/dist/set/shim.js +0 -1
  94. package/dist/set/shim.mjs +0 -1
  95. package/dist/try/Try.d.mts +0 -8
  96. package/dist/try/Try.d.ts +0 -8
  97. package/dist/try/Try.js +0 -1
  98. package/dist/try/Try.mjs +0 -1
  99. package/dist/tuple/Tuple.d.mts +0 -12
  100. package/dist/tuple/Tuple.d.ts +0 -12
  101. package/dist/tuple/Tuple.js +0 -1
  102. package/dist/tuple/Tuple.mjs +0 -1
  103. package/dist/typeable/Typeable.d.mts +0 -8
  104. package/dist/typeable/Typeable.d.ts +0 -8
  105. package/dist/typeable/Typeable.js +0 -1
  106. package/dist/typeable/Typeable.mjs +0 -1
  107. package/dist/util/index.d.mts +0 -13
  108. package/dist/util/index.d.ts +0 -13
  109. package/dist/util/index.js +0 -1
  110. package/dist/util/index.mjs +0 -1
  111. package/dist/util/isIterable.d.mts +0 -3
  112. package/dist/util/isIterable.d.ts +0 -3
  113. package/dist/util/isIterable.js +0 -1
  114. package/dist/util/isIterable.mjs +0 -1
  115. package/dist/valuable/Valuable.d.mts +0 -6
  116. package/dist/valuable/Valuable.d.ts +0 -6
  117. package/dist/valuable/Valuable.js +0 -1
  118. package/dist/valuable/Valuable.mjs +0 -1
  119. package/lib/TaskPromise.d.ts +0 -3
  120. package/lib/collections/index.d.ts +0 -8
  121. package/lib/either/Either.d.ts +0 -52
  122. package/lib/either/EitherT.d.ts +0 -9
  123. package/lib/error/ParseError.d.ts +0 -6
  124. package/lib/functor/index.d.ts +0 -15
  125. package/lib/identity/Identity.d.ts +0 -4
  126. package/lib/index.d.ts +0 -21
  127. package/lib/iterable/Seq.d.ts +0 -31
  128. package/lib/iterable/index.d.ts +0 -22
  129. package/lib/list/List.d.ts +0 -26
  130. package/lib/map/Map.d.ts +0 -17
  131. package/lib/map/shim.d.ts +0 -2
  132. package/lib/option/Option.d.ts +0 -30
  133. package/lib/serializable/Serializable.d.ts +0 -15
  134. package/lib/set/Set.d.ts +0 -15
  135. package/lib/set/shim.d.ts +0 -2
  136. package/lib/try/Try.d.ts +0 -18
  137. package/lib/tuple/Tuple.d.ts +0 -9
  138. package/lib/typeable/Typeable.d.ts +0 -4
  139. package/lib/util/index.d.ts +0 -3
  140. package/lib/util/isIterable.d.ts +0 -1
@@ -1,240 +0,0 @@
1
- import { Type, Functor, AsyncFunctor } from './functor/index.js';
2
- import './core/base/Base.js';
3
- import { Throwable } from './core/error/Throwable.js';
4
- import './identity/Identity.js';
5
- import { Tuple } from './tuple/Tuple.js';
6
- import { Typeable, ExtractTag } from './typeable/Typeable.js';
7
- import { Valuable } from './valuable/Valuable.js';
8
-
9
- declare const Some: <T extends Type>(value: T) => Option<T>;
10
- declare const None: <T extends Type>() => Option<T>;
11
- type Option<T extends Type> = {
12
- readonly _tag: "Some" | "None";
13
- readonly value: T | undefined;
14
- isEmpty: boolean;
15
- get(): T;
16
- getOrElse(defaultValue: T): T;
17
- getOrThrow(error: Error): T;
18
- orElse(alternative: Option<T>): Option<T>;
19
- orNull(): T | null;
20
- map<U extends Type>(f: (value: T) => U): Option<U>;
21
- filter(predicate: (value: T) => boolean): Option<T>;
22
- flatMap<U extends Type>(f: (value: T) => Option<U>): Option<U>;
23
- flatMapAsync<U extends Type>(f: (value: T) => Promise<Option<U>>): Promise<Option<U>>;
24
- reduce<U>(f: (acc: U, value: T) => U): U;
25
- reduceRight<U>(f: (acc: U, value: T) => U): U;
26
- fold<U>(onNone: () => U, onSome: (value: T) => U): U;
27
- foldLeft<B>(z: B): (op: (b: B, a: T) => B) => B;
28
- foldRight<B>(z: B): (op: (a: T, b: B) => B) => B;
29
- toList(): List<T>;
30
- contains(value: T): boolean;
31
- size: number;
32
- toEither<E>(left: E): Either<E, T>;
33
- toString(): string;
34
- toValue(): {
35
- _tag: "Some" | "None";
36
- value: T;
37
- };
38
- } & (Traversable<T> & Functor<T> & Typeable<"Some" | "None"> & Valuable<T> & AsyncFunctor<T>);
39
- declare const Option: {
40
- <T extends Type>(value: T | null | undefined): Option<T>;
41
- from<T>(value: T): Option<T>;
42
- none<T>(): Option<T>;
43
- };
44
-
45
- type IterableType<A extends Type> = {
46
- count(p: (x: A) => boolean): number;
47
- find(p: (a: A) => boolean): Option<A>;
48
- forEach(f: (a: A) => void): void;
49
- drop(n: number): IterableType<A>;
50
- dropRight(n: number): IterableType<A>;
51
- dropWhile(p: (a: A) => boolean): IterableType<A>;
52
- exists(p: (a: A) => boolean): boolean;
53
- filter(p: (a: A) => boolean): IterableType<A>;
54
- filterNot(p: (a: A) => boolean): IterableType<A>;
55
- flatten<B>(): IterableType<B>;
56
- reduce(f: (b: A, a: A) => A): A;
57
- reduceRight(f: (b: A, a: A) => A): A;
58
- foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
59
- foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
60
- get head(): A;
61
- get headOption(): Option<A>;
62
- get isEmpty(): boolean;
63
- map<B extends Type>(f: (a: A) => B): IterableType<B>;
64
- flatMap<B extends Type>(f: (a: A) => IterableType<B>): IterableType<B>;
65
- get size(): number;
66
- toArray<B = A>(): readonly B[];
67
- toValue: () => {
68
- _tag: string;
69
- value: A[];
70
- };
71
- } & Iterable<A> & Functor<A> & AsyncFunctor<A>;
72
-
73
- type Converters<A> = {
74
- toList(): List<A>;
75
- toSet(): Set<A>;
76
- toString(): string;
77
- };
78
- type Collection<A> = Converters<A>;
79
-
80
- type Set<A> = {
81
- add: (value: A) => Set<A>;
82
- remove: (value: A) => Set<A>;
83
- contains: (value: A) => boolean;
84
- has: (value: A) => boolean;
85
- map: <B>(f: (a: A) => B) => Set<B>;
86
- flatMap: <B>(f: (a: A) => IterableType<B>) => Set<B>;
87
- toList: () => List<A>;
88
- toSet: () => Set<A>;
89
- toString: () => string;
90
- } & IterableType<A> & Collection<A>;
91
- declare const Set: <A>(iterable?: Iterable<A> | IterableType<A>) => Set<A>;
92
-
93
- type List<A> = {
94
- readonly length: number;
95
- readonly [Symbol.iterator]: () => Iterator<A>;
96
- map: <B>(f: (a: A) => B) => List<B>;
97
- flatMap: <B>(f: (a: A) => IterableType<B>) => List<B>;
98
- flatMapAsync: <B>(f: (a: A) => PromiseLike<IterableType<B>>) => PromiseLike<List<B>>;
99
- forEach: (f: (a: A) => void) => void;
100
- count: (p: (x: A) => boolean) => number;
101
- exists: (p: (a: A) => boolean) => boolean;
102
- filter<S extends A>(predicate: (a: A) => a is S): List<S>;
103
- filter(predicate: (a: A) => unknown): List<A>;
104
- filterNot: (p: (a: A) => boolean) => List<A>;
105
- filterType: <T extends Typeable<string, unknown>>(tag: string) => List<T & A>;
106
- find: <T extends A = A>(predicate: (a: A) => boolean, tag?: ExtractTag<T>) => Option<T>;
107
- readonly head: A;
108
- readonly headOption: Option<A>;
109
- readonly isEmpty: boolean;
110
- toArray: <B = A>() => B[];
111
- reduce: (f: (prev: A, curr: A) => A) => A;
112
- reduceRight: (f: (prev: A, curr: A) => A) => A;
113
- foldLeft: <B>(z: B) => (op: (b: B, a: A) => B) => B;
114
- foldRight: <B>(z: B) => (op: (a: A, b: B) => B) => B;
115
- remove: (value: A) => List<A>;
116
- removeAt: (index: number) => List<A>;
117
- add: (item: A) => List<A>;
118
- get: (index: number) => Option<A>;
119
- concat: (other: List<A>) => List<A>;
120
- toList: () => List<A>;
121
- toSet: () => Set<A>;
122
- toString: () => string;
123
- toValue: () => {
124
- _tag: string;
125
- value: A[];
126
- };
127
- } & IterableType<A> & Typeable<"List"> & AsyncFunctor<A>;
128
- declare const List: <A>(values?: Iterable<A>) => List<A>;
129
-
130
- type TestEither<L extends Type, R extends Type> = Either<L, R> & Functor<R> & AsyncFunctor<R>;
131
- declare const Right: <L extends Type, R extends Type>(value: R) => Either<L, R>;
132
- declare const Left: <L extends Type, R extends Type>(value: L) => Either<L, R>;
133
- declare const isRight: <L extends Type, R extends Type>(either: Either<L, R>) => either is Either<L, R> & {
134
- value: R;
135
- };
136
- declare const isLeft: <L extends Type, R extends Type>(either: Either<L, R>) => either is Either<L, R> & {
137
- value: L;
138
- };
139
- declare const tryCatch: <L extends Type, R extends Type>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
140
- declare const TypeCheckRight: <L extends Type, R extends Type>(value: R) => TestEither<L, R>;
141
- declare const TypeCheckLeft: <L extends Type, R extends Type>(value: L) => TestEither<L, R>;
142
- declare const tryCatchAsync: <L extends Type, R extends Type>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
143
- type Either<L extends Type, R extends Type> = {
144
- readonly _tag: "Left" | "Right";
145
- value: L | R;
146
- isLeft: () => boolean;
147
- isRight: () => boolean;
148
- getOrElse: (defaultValue: R) => R;
149
- getOrThrow: () => R;
150
- map: <U extends Type>(f: (value: R) => U) => Either<L, U>;
151
- merge: <L1 extends Type, R1 extends Type>(other: Either<L1, R1>) => Either<L | L1, [R, R1]>;
152
- mapAsync: <U extends Type>(f: (value: R) => Promise<U>) => Promise<Either<L, U>>;
153
- flatMap: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U>;
154
- flatMapAsync: <U extends Type>(f: (value: R) => Promise<Either<L, U>>) => Promise<Either<L, U>>;
155
- toOption: () => Option<R>;
156
- toList: () => List<R>;
157
- toString: () => string;
158
- [Symbol.iterator]: () => Iterator<R>;
159
- yield: () => Generator<R, void, unknown>;
160
- traverse: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U[]>;
161
- lazyMap: <U extends Type>(f: (value: R) => U) => Generator<Either<L, U>, void, unknown>;
162
- tap: (f: (value: R) => void) => Either<L, R>;
163
- tapLeft: (f: (value: L) => void) => Either<L, R>;
164
- mapLeft: <L2 extends Type>(f: (value: L) => L2) => Either<L2, R>;
165
- bimap: <L2 extends Type, R2 extends Type>(fl: (value: L) => L2, fr: (value: R) => R2) => Either<L2, R2>;
166
- fold: <T extends Type>(onLeft: (value: L) => T, onRight: (value: R) => T) => T;
167
- swap: () => Either<R, L>;
168
- } & Typeable<"Left" | "Right"> & PromiseLike<R> & AsyncFunctor<R>;
169
- declare const Either: {
170
- sequence: <L extends Type, R extends Type>(eithers: Either<L, R>[]) => Either<L, R[]>;
171
- traverse: <L extends Type, R extends Type, U extends Type>(arr: R[], f: (value: R) => Either<L, U>) => Either<L, U[]>;
172
- fromNullable: <L extends Type, R extends Type>(value: R | null | undefined, leftValue: L) => Either<L, R>;
173
- fromPredicate: <L extends Type, R extends Type>(value: R, predicate: (value: R) => boolean, leftValue: L) => Either<L, R>;
174
- ap: <L extends Type, R extends Type, U extends Type>(eitherF: Either<L, (value: R) => U>, eitherV: Either<L, R>) => Either<L, U>;
175
- fromPromise: <L, R>(promise: Promise<R>, onRejected: (reason: unknown) => L) => Promise<Either<L, R>>;
176
- };
177
-
178
- type AppException<T> = Either<Throwable, T>;
179
- /**
180
- * AppException factory function
181
- * @param error
182
- * @param data
183
- * @constructor
184
- */
185
- declare const AppException: <T>(error: unknown, data?: unknown) => AppException<T>;
186
- type AppResult<T> = Either<Throwable, T>;
187
- declare const AppResult: <T>(data: T) => AppResult<T>;
188
- type Task<T> = Either<Throwable, T>;
189
- declare function Task<T>(t: () => T, e?: (error: unknown) => unknown, f?: () => void): Task<T>;
190
- declare namespace Task {
191
- var success: <T>(data: T) => AppResult<T>;
192
- var fail: <T>(error: unknown) => AppException<T>;
193
- }
194
- type AsyncTask<T> = Promise<Task<T>>;
195
- declare function AsyncTask<T>(t: () => T, e?: (error: unknown) => unknown, f?: () => Promise<void> | void): AsyncTask<T>;
196
- declare namespace AsyncTask {
197
- var success: <T>(data: T) => AppResult<T>;
198
- var fail: <T>(error: unknown) => AppException<T>;
199
- }
200
-
201
- type SafeTraversable<K, V> = Omit<Traversable<Tuple<[K, V]>>, "map" | "flatMap">;
202
- type Map<K, V> = {
203
- add(item: Tuple<[K, V]>): Map<K, V>;
204
- remove(value: K): Map<K, V>;
205
- map<U>(f: (value: V) => U): Map<K, U>;
206
- flatMap<K2, V2>(f: (entry: Tuple<[K, V]>) => IterableType<[K2, V2]>): Map<K2, V2>;
207
- get(key: K): Option<V>;
208
- getOrElse(key: K, defaultValue: V): V;
209
- orElse(key: K, alternative: Option<V>): Option<V>;
210
- } & SafeTraversable<K, V> & Collection<Tuple<[K, V]>>;
211
- declare const Map: <K, V>(entries?: readonly (readonly [K, V])[] | IterableIterator<[K, V]> | null) => Map<K, V>;
212
-
213
- type Try<T> = {
214
- readonly _tag: "Success" | "Failure";
215
- readonly value: T | undefined;
216
- readonly error: Error | undefined;
217
- isSuccess: () => boolean;
218
- isFailure: () => boolean;
219
- get: () => T;
220
- getOrElse: (defaultValue: T) => T;
221
- orElse: (alternative: Try<T>) => Try<T>;
222
- orThrow: (error: Error) => T;
223
- toEither: () => Either<Error, T>;
224
- map: <U>(f: (value: T) => U) => Try<U>;
225
- flatMap: <U>(f: (value: T) => Try<U>) => Try<U>;
226
- toString: () => string;
227
- } & Typeable<"Success" | "Failure">;
228
- declare const Try: <T>(f: () => T) => Try<T>;
229
-
230
- type Traversable<A extends Type> = Functor<A> & {
231
- get size(): number;
232
- get isEmpty(): boolean;
233
- contains(value: A): boolean;
234
- reduce(f: (b: A, a: A) => A): A;
235
- reduceRight(f: (b: A, a: A) => A): A;
236
- foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
237
- foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
238
- };
239
-
240
- export { AppException as A, type Converters as C, Either as E, type IterableType as I, List as L, Map as M, None as N, Option as O, Right as R, Some as S, type TestEither as T, type Collection as a, Set as b, Left as c, isLeft as d, TypeCheckRight as e, TypeCheckLeft as f, tryCatchAsync as g, AppResult as h, isRight as i, Task as j, AsyncTask as k, Try as l, type Traversable as m, tryCatch as t };
package/dist/index.d.mts DELETED
@@ -1,8 +0,0 @@
1
- export { AbstractFunctor, ArrayFunctor, ArrayType, AsyncFunctor, Functor, SingleType, Type } from './functor/index.mjs';
2
- export { Base } from './core/base/Base.mjs';
3
- export { Throwable } from './core/error/Throwable.mjs';
4
- export { A as AppException, h as AppResult, k as AsyncTask, E as Either, I as IterableType, c as Left, L as List, M as Map, N as None, O as Option, R as Right, b as Set, S as Some, j as Task, T as TestEither, m as Traversable, l as Try, f as TypeCheckLeft, e as TypeCheckRight, d as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from './index-BSGv2rsm.mjs';
5
- export { Identity } from './identity/Identity.mjs';
6
- export { Tuple } from './tuple/Tuple.mjs';
7
- export { ExtractTag, Typeable, isTypeable } from './typeable/Typeable.mjs';
8
- import './valuable/Valuable.mjs';
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkUAFRIAJNjs = require('./chunk-UAFRIAJN.js');var _chunk2U34DUZUjs = require('./chunk-2U34DUZU.js');var _chunk44WWBXBLjs = require('./chunk-44WWBXBL.js');var _chunkAKJ5AKY4js = require('./chunk-AKJ5AKY4.js');require('./chunk-5VTXJIR3.js');require('./chunk-3VJERXBP.js');var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');require('./chunk-K3EKBPQE.js');require('./chunk-XORABVON.js');require('./chunk-WTWWDZY6.js');exports.AppException = _chunkUAFRIAJNjs.o; exports.AppResult = _chunkUAFRIAJNjs.p; exports.AsyncTask = _chunkUAFRIAJNjs.r; exports.Base = _chunk44WWBXBLjs.a; exports.Either = _chunkUAFRIAJNjs.n; exports.Left = _chunkUAFRIAJNjs.g; exports.List = _chunkUAFRIAJNjs.e; exports.Map = _chunkUAFRIAJNjs.s; exports.None = _chunkUAFRIAJNjs.b; exports.Option = _chunkUAFRIAJNjs.c; exports.Right = _chunkUAFRIAJNjs.f; exports.Set = _chunkUAFRIAJNjs.d; exports.Some = _chunkUAFRIAJNjs.a; exports.Task = _chunkUAFRIAJNjs.q; exports.Throwable = _chunk2U34DUZUjs.a; exports.Try = _chunkUAFRIAJNjs.t; exports.Tuple = _chunkOXLZ6UIZjs.a; exports.TypeCheckLeft = _chunkUAFRIAJNjs.l; exports.TypeCheckRight = _chunkUAFRIAJNjs.k; exports.Typeable = _chunkAKJ5AKY4js.a; exports.isLeft = _chunkUAFRIAJNjs.i; exports.isRight = _chunkUAFRIAJNjs.h; exports.isTypeable = _chunkAKJ5AKY4js.b; exports.tryCatch = _chunkUAFRIAJNjs.j; exports.tryCatchAsync = _chunkUAFRIAJNjs.m;
@@ -1,8 +0,0 @@
1
- import '../functor/index.mjs';
2
- export { I as IterableType } from '../index-BSGv2rsm.mjs';
3
- import '../core/base/Base.mjs';
4
- import '../core/error/Throwable.mjs';
5
- import '../typeable/Typeable.mjs';
6
- import '../identity/Identity.mjs';
7
- import '../tuple/Tuple.mjs';
8
- import '../valuable/Valuable.mjs';
@@ -1,8 +0,0 @@
1
- import '../functor/index.js';
2
- export { I as IterableType } from '../index-Cb-cundW.js';
3
- import '../core/base/Base.js';
4
- import '../core/error/Throwable.js';
5
- import '../typeable/Typeable.js';
6
- import '../identity/Identity.js';
7
- import '../tuple/Tuple.js';
8
- import '../valuable/Valuable.js';
@@ -1 +0,0 @@
1
- "use strict";require('../chunk-WTWWDZY6.js');
@@ -1 +0,0 @@
1
- import"../chunk-4H62YQ42.mjs";
@@ -1,8 +0,0 @@
1
- import '../functor/index.mjs';
2
- export { L as List } from '../index-BSGv2rsm.mjs';
3
- import '../typeable/Typeable.mjs';
4
- import '../core/base/Base.mjs';
5
- import '../core/error/Throwable.mjs';
6
- import '../identity/Identity.mjs';
7
- import '../tuple/Tuple.mjs';
8
- import '../valuable/Valuable.mjs';
@@ -1,8 +0,0 @@
1
- import '../functor/index.js';
2
- export { L as List } from '../index-Cb-cundW.js';
3
- import '../typeable/Typeable.js';
4
- import '../core/base/Base.js';
5
- import '../core/error/Throwable.js';
6
- import '../identity/Identity.js';
7
- import '../tuple/Tuple.js';
8
- import '../valuable/Valuable.js';
package/dist/list/List.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkUAFRIAJNjs = require('../chunk-UAFRIAJN.js');require('../chunk-2U34DUZU.js');require('../chunk-44WWBXBL.js');require('../chunk-AKJ5AKY4.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-K3EKBPQE.js');require('../chunk-XORABVON.js');require('../chunk-WTWWDZY6.js');exports.List = _chunkUAFRIAJNjs.e;
@@ -1 +0,0 @@
1
- import{e as a}from"../chunk-YXECCMSX.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-Z6YAH4SC.mjs";import"../chunk-5GE5W3Y5.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-4H62YQ42.mjs";export{a as List};
@@ -1,8 +0,0 @@
1
- export { M as Map } from '../index-BSGv2rsm.mjs';
2
- import '../tuple/Tuple.mjs';
3
- import '../functor/index.mjs';
4
- import '../core/base/Base.mjs';
5
- import '../core/error/Throwable.mjs';
6
- import '../typeable/Typeable.mjs';
7
- import '../identity/Identity.mjs';
8
- import '../valuable/Valuable.mjs';
package/dist/map/Map.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export { M as Map } from '../index-Cb-cundW.js';
2
- import '../tuple/Tuple.js';
3
- import '../functor/index.js';
4
- import '../core/base/Base.js';
5
- import '../core/error/Throwable.js';
6
- import '../typeable/Typeable.js';
7
- import '../identity/Identity.js';
8
- import '../valuable/Valuable.js';
package/dist/map/Map.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkUAFRIAJNjs = require('../chunk-UAFRIAJN.js');require('../chunk-2U34DUZU.js');require('../chunk-44WWBXBL.js');require('../chunk-AKJ5AKY4.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-K3EKBPQE.js');require('../chunk-XORABVON.js');require('../chunk-WTWWDZY6.js');exports.Map = _chunkUAFRIAJNjs.s;
package/dist/map/Map.mjs DELETED
@@ -1 +0,0 @@
1
- import{s as a}from"../chunk-YXECCMSX.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-Z6YAH4SC.mjs";import"../chunk-5GE5W3Y5.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-4H62YQ42.mjs";export{a as Map};
@@ -1,4 +0,0 @@
1
- type IESMap<K, V> = Map<K, V>;
2
- declare const ESMap: MapConstructor;
3
-
4
- export { ESMap, type IESMap };
@@ -1,4 +0,0 @@
1
- type IESMap<K, V> = Map<K, V>;
2
- declare const ESMap: MapConstructor;
3
-
4
- export { ESMap, type IESMap };
package/dist/map/shim.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5VTXJIR3js = require('../chunk-5VTXJIR3.js');exports.ESMap = _chunk5VTXJIR3js.a;
package/dist/map/shim.mjs DELETED
@@ -1 +0,0 @@
1
- import{a}from"../chunk-377WQNCB.mjs";export{a as ESMap};
@@ -1,8 +0,0 @@
1
- import '../functor/index.mjs';
2
- export { N as None, O as Option, S as Some } from '../index-BSGv2rsm.mjs';
3
- import '../typeable/Typeable.mjs';
4
- import '../valuable/Valuable.mjs';
5
- import '../core/base/Base.mjs';
6
- import '../core/error/Throwable.mjs';
7
- import '../identity/Identity.mjs';
8
- import '../tuple/Tuple.mjs';
@@ -1,8 +0,0 @@
1
- import '../functor/index.js';
2
- export { N as None, O as Option, S as Some } from '../index-Cb-cundW.js';
3
- import '../typeable/Typeable.js';
4
- import '../valuable/Valuable.js';
5
- import '../core/base/Base.js';
6
- import '../core/error/Throwable.js';
7
- import '../identity/Identity.js';
8
- import '../tuple/Tuple.js';
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkUAFRIAJNjs = require('../chunk-UAFRIAJN.js');require('../chunk-2U34DUZU.js');require('../chunk-44WWBXBL.js');require('../chunk-AKJ5AKY4.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-K3EKBPQE.js');require('../chunk-XORABVON.js');require('../chunk-WTWWDZY6.js');exports.None = _chunkUAFRIAJNjs.b; exports.Option = _chunkUAFRIAJNjs.c; exports.Some = _chunkUAFRIAJNjs.a;
@@ -1 +0,0 @@
1
- import{a,b,c}from"../chunk-YXECCMSX.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-Z6YAH4SC.mjs";import"../chunk-5GE5W3Y5.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-4H62YQ42.mjs";export{b as None,c as Option,a as Some};
@@ -1,16 +0,0 @@
1
- type SerializableTypes = "json" | "yaml";
2
- type SerializationMethods<T> = {
3
- json: {
4
- toJSON(): string;
5
- fromJSON(json: string): T;
6
- };
7
- yaml: {
8
- toYAML(): string;
9
- fromYAML(yaml: string): T;
10
- };
11
- };
12
- type Serializable<STypes extends SerializableTypes[], T> = T & (STypes extends [] ? NonNullable<unknown> : STypes extends [infer First, ...infer Rest] ? First extends keyof SerializationMethods<T> ? SerializationMethods<T>[First] & Serializable<Rest extends SerializableTypes[] ? Rest : [], T> : never : never);
13
- type SupportedSerializationTypes<T> = T extends Serializable<infer Types, never> ? Types : never;
14
- declare function createSerializable<STypes extends SerializableTypes[], T>(obj: T, serializationMethods: Pick<SerializationMethods<T>, STypes[number]>): Serializable<STypes, T>;
15
-
16
- export { type Serializable, type SerializableTypes, type SupportedSerializationTypes, createSerializable };
@@ -1,16 +0,0 @@
1
- type SerializableTypes = "json" | "yaml";
2
- type SerializationMethods<T> = {
3
- json: {
4
- toJSON(): string;
5
- fromJSON(json: string): T;
6
- };
7
- yaml: {
8
- toYAML(): string;
9
- fromYAML(yaml: string): T;
10
- };
11
- };
12
- type Serializable<STypes extends SerializableTypes[], T> = T & (STypes extends [] ? NonNullable<unknown> : STypes extends [infer First, ...infer Rest] ? First extends keyof SerializationMethods<T> ? SerializationMethods<T>[First] & Serializable<Rest extends SerializableTypes[] ? Rest : [], T> : never : never);
13
- type SupportedSerializationTypes<T> = T extends Serializable<infer Types, never> ? Types : never;
14
- declare function createSerializable<STypes extends SerializableTypes[], T>(obj: T, serializationMethods: Pick<SerializationMethods<T>, STypes[number]>): Serializable<STypes, T>;
15
-
16
- export { type Serializable, type SerializableTypes, type SupportedSerializationTypes, createSerializable };
@@ -1,3 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _safestablestringify = require('safe-stable-stringify'); var _safestablestringify2 = _interopRequireDefault(_safestablestringify);function a(e,t){return{...e,...t}}var i=a({name:"John",age:30},{json:{toJSON(){return _safestablestringify2.default.call(void 0, this)},fromJSON(e){return JSON.parse(e)}},yaml:{toYAML(){return Object.entries(this).map(([e,t])=>`${e}: ${t}`).join(`
2
- `)},fromYAML(e){return Object.fromEntries(e.split(`
3
- `).map(t=>t.split(": ")))}}});console.log(i.toJSON());console.log(i.toYAML());exports.createSerializable = a;
@@ -1,3 +0,0 @@
1
- import r from"safe-stable-stringify";function a(e,t){return{...e,...t}}var i=a({name:"John",age:30},{json:{toJSON(){return r(this)},fromJSON(e){return JSON.parse(e)}},yaml:{toYAML(){return Object.entries(this).map(([e,t])=>`${e}: ${t}`).join(`
2
- `)},fromYAML(e){return Object.fromEntries(e.split(`
3
- `).map(t=>t.split(": ")))}}});console.log(i.toJSON());console.log(i.toYAML());export{a as createSerializable};
@@ -1,8 +0,0 @@
1
- export { b as Set } from '../index-BSGv2rsm.mjs';
2
- import '../functor/index.mjs';
3
- import '../core/base/Base.mjs';
4
- import '../core/error/Throwable.mjs';
5
- import '../typeable/Typeable.mjs';
6
- import '../identity/Identity.mjs';
7
- import '../tuple/Tuple.mjs';
8
- import '../valuable/Valuable.mjs';
package/dist/set/Set.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export { b as Set } from '../index-Cb-cundW.js';
2
- import '../functor/index.js';
3
- import '../core/base/Base.js';
4
- import '../core/error/Throwable.js';
5
- import '../typeable/Typeable.js';
6
- import '../identity/Identity.js';
7
- import '../tuple/Tuple.js';
8
- import '../valuable/Valuable.js';
package/dist/set/Set.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkUAFRIAJNjs = require('../chunk-UAFRIAJN.js');require('../chunk-2U34DUZU.js');require('../chunk-44WWBXBL.js');require('../chunk-AKJ5AKY4.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-K3EKBPQE.js');require('../chunk-XORABVON.js');require('../chunk-WTWWDZY6.js');exports.Set = _chunkUAFRIAJNjs.d;
package/dist/set/Set.mjs DELETED
@@ -1 +0,0 @@
1
- import{d as a}from"../chunk-YXECCMSX.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-Z6YAH4SC.mjs";import"../chunk-5GE5W3Y5.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-4H62YQ42.mjs";export{a as Set};
@@ -1,4 +0,0 @@
1
- type IESSet<T> = Set<T>;
2
- declare const ESSet: SetConstructor;
3
-
4
- export { ESSet, type IESSet };
@@ -1,4 +0,0 @@
1
- type IESSet<T> = Set<T>;
2
- declare const ESSet: SetConstructor;
3
-
4
- export { ESSet, type IESSet };
package/dist/set/shim.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3VJERXBPjs = require('../chunk-3VJERXBP.js');exports.ESSet = _chunk3VJERXBPjs.a;
package/dist/set/shim.mjs DELETED
@@ -1 +0,0 @@
1
- import{a}from"../chunk-HA5XD5KC.mjs";export{a as ESSet};
@@ -1,8 +0,0 @@
1
- export { l as Try } from '../index-BSGv2rsm.mjs';
2
- import '../typeable/Typeable.mjs';
3
- import '../functor/index.mjs';
4
- import '../core/base/Base.mjs';
5
- import '../core/error/Throwable.mjs';
6
- import '../identity/Identity.mjs';
7
- import '../tuple/Tuple.mjs';
8
- import '../valuable/Valuable.mjs';
package/dist/try/Try.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export { l as Try } from '../index-Cb-cundW.js';
2
- import '../typeable/Typeable.js';
3
- import '../functor/index.js';
4
- import '../core/base/Base.js';
5
- import '../core/error/Throwable.js';
6
- import '../identity/Identity.js';
7
- import '../tuple/Tuple.js';
8
- import '../valuable/Valuable.js';
package/dist/try/Try.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkUAFRIAJNjs = require('../chunk-UAFRIAJN.js');require('../chunk-2U34DUZU.js');require('../chunk-44WWBXBL.js');require('../chunk-AKJ5AKY4.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-K3EKBPQE.js');require('../chunk-XORABVON.js');require('../chunk-WTWWDZY6.js');exports.Try = _chunkUAFRIAJNjs.t;
package/dist/try/Try.mjs DELETED
@@ -1 +0,0 @@
1
- import{t as a}from"../chunk-YXECCMSX.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-Z6YAH4SC.mjs";import"../chunk-5GE5W3Y5.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-4H62YQ42.mjs";export{a as Try};
@@ -1,12 +0,0 @@
1
- import { ArrayType, ArrayFunctor } from '../functor/index.mjs';
2
-
3
- type Tuple<T extends ArrayType> = {
4
- get<K extends number>(index: K): T[K];
5
- map<U extends ArrayType>(f: (value: T) => U): Tuple<U>;
6
- flatMap<U extends ArrayType>(f: (value: T) => Tuple<U>): Tuple<U>;
7
- toArray(): T;
8
- [Symbol.iterator](): Iterator<T[number]>;
9
- } & ArrayFunctor<T>;
10
- declare const Tuple: <T extends ArrayType>(values: T) => Tuple<T>;
11
-
12
- export { Tuple };
@@ -1,12 +0,0 @@
1
- import { ArrayType, ArrayFunctor } from '../functor/index.js';
2
-
3
- type Tuple<T extends ArrayType> = {
4
- get<K extends number>(index: K): T[K];
5
- map<U extends ArrayType>(f: (value: T) => U): Tuple<U>;
6
- flatMap<U extends ArrayType>(f: (value: T) => Tuple<U>): Tuple<U>;
7
- toArray(): T;
8
- [Symbol.iterator](): Iterator<T[number]>;
9
- } & ArrayFunctor<T>;
10
- declare const Tuple: <T extends ArrayType>(values: T) => Tuple<T>;
11
-
12
- export { Tuple };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOXLZ6UIZjs = require('../chunk-OXLZ6UIZ.js');exports.Tuple = _chunkOXLZ6UIZjs.a;
@@ -1 +0,0 @@
1
- import{a}from"../chunk-2I2NKDFN.mjs";export{a as Tuple};
@@ -1,8 +0,0 @@
1
- type ExtractTag<T> = T extends Typeable<infer Tag, unknown> ? Tag : never;
2
- type Typeable<Tag extends string, T = object> = T & {
3
- readonly _tag: Tag;
4
- };
5
- declare function Typeable<Tag extends string, T>(tag: Tag, data: T): Typeable<Tag, T>;
6
- declare function isTypeable<T>(value: unknown, tag: string): value is T;
7
-
8
- export { type ExtractTag, Typeable, isTypeable };
@@ -1,8 +0,0 @@
1
- type ExtractTag<T> = T extends Typeable<infer Tag, unknown> ? Tag : never;
2
- type Typeable<Tag extends string, T = object> = T & {
3
- readonly _tag: Tag;
4
- };
5
- declare function Typeable<Tag extends string, T>(tag: Tag, data: T): Typeable<Tag, T>;
6
- declare function isTypeable<T>(value: unknown, tag: string): value is T;
7
-
8
- export { type ExtractTag, Typeable, isTypeable };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAKJ5AKY4js = require('../chunk-AKJ5AKY4.js');exports.Typeable = _chunkAKJ5AKY4js.a; exports.isTypeable = _chunkAKJ5AKY4js.b;
@@ -1 +0,0 @@
1
- import{a,b}from"../chunk-5GE5W3Y5.mjs";export{a as Typeable,b as isTypeable};
@@ -1,13 +0,0 @@
1
- import { E as Either } from '../index-BSGv2rsm.mjs';
2
- import { ParseError } from '../error/ParseError.mjs';
3
- import '../functor/index.mjs';
4
- import '../core/base/Base.mjs';
5
- import '../core/error/Throwable.mjs';
6
- import '../typeable/Typeable.mjs';
7
- import '../identity/Identity.mjs';
8
- import '../tuple/Tuple.mjs';
9
- import '../valuable/Valuable.mjs';
10
-
11
- declare const parseNumber: (input: string) => Either<ParseError, number>;
12
-
13
- export { parseNumber };
@@ -1,13 +0,0 @@
1
- import { E as Either } from '../index-Cb-cundW.js';
2
- import { ParseError } from '../error/ParseError.js';
3
- import '../functor/index.js';
4
- import '../core/base/Base.js';
5
- import '../core/error/Throwable.js';
6
- import '../typeable/Typeable.js';
7
- import '../identity/Identity.js';
8
- import '../tuple/Tuple.js';
9
- import '../valuable/Valuable.js';
10
-
11
- declare const parseNumber: (input: string) => Either<ParseError, number>;
12
-
13
- export { parseNumber };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE6RS47F7js = require('../chunk-E6RS47F7.js');var _chunkUAFRIAJNjs = require('../chunk-UAFRIAJN.js');require('../chunk-2U34DUZU.js');require('../chunk-44WWBXBL.js');require('../chunk-AKJ5AKY4.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-K3EKBPQE.js');require('../chunk-XORABVON.js');require('../chunk-WTWWDZY6.js');var a=o=>{let r=parseInt(o,10);return isNaN(r)?_chunkUAFRIAJNjs.g.call(void 0, _chunkE6RS47F7js.a.call(void 0, `${r}`)):_chunkUAFRIAJNjs.f.call(void 0, r)};exports.parseNumber = a;
@@ -1 +0,0 @@
1
- import{a as s}from"../chunk-VK5GL6NM.mjs";import{f as e,g as t}from"../chunk-YXECCMSX.mjs";import"../chunk-HD6YYUHO.mjs";import"../chunk-Z6YAH4SC.mjs";import"../chunk-5GE5W3Y5.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-4H62YQ42.mjs";var a=o=>{let r=parseInt(o,10);return isNaN(r)?t(s(`${r}`)):e(r)};export{a as parseNumber};
@@ -1,3 +0,0 @@
1
- declare const isIterable: <T>(value: unknown) => value is Iterable<T>;
2
-
3
- export { isIterable };
@@ -1,3 +0,0 @@
1
- declare const isIterable: <T>(value: unknown) => value is Iterable<T>;
2
-
3
- export { isIterable };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var e=t=>t!=null&&typeof t[Symbol.iterator]=="function";exports.isIterable = e;
@@ -1 +0,0 @@
1
- var e=t=>t!=null&&typeof t[Symbol.iterator]=="function";export{e as isIterable};