@typed/guard 0.7.3 → 1.0.0-beta.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/src/Guard.ts DELETED
@@ -1,534 +0,0 @@
1
- import type * as Cause from 'effect/Cause'
2
- import type * as Context from 'effect/Context'
3
- import * as Effect from 'effect/Effect'
4
- import type * as Layer from 'effect/Layer'
5
- import * as Option from 'effect/Option'
6
- import * as Pipeable from 'effect/Pipeable'
7
- import type * as Predicate from 'effect/Predicate'
8
- import type * as Runtime from 'effect/Runtime'
9
- import * as Schema from 'effect/Schema'
10
- import { dual } from 'effect/Function'
11
- import type { ParseOptions } from 'effect/SchemaAST'
12
-
13
- export type Guard<I, O = never, E = never, R = never> = (
14
- input: I,
15
- ) => Effect.Effect<Option.Option<O>, E, R>
16
-
17
- export namespace Guard {
18
- export type Input<T> = [T] extends [Guard<infer I, infer _R, infer _E, infer _O>] ? I : never
19
-
20
- export type Output<T> = [T] extends [Guard<infer _I, infer O, infer _E, infer _R>] ? O : never
21
-
22
- export type Error<T> = [T] extends [Guard<infer _I, infer _O, infer E, infer _R>] ? E : never
23
-
24
- export type Context<T> = [T] extends [Guard<infer _I, infer _O, infer _E, infer R>] ? R : never
25
- }
26
-
27
- export const identity: <A>(a: A) => Effect.Effect<Option.Option<A>> = Effect.succeedSome
28
-
29
- export const compose: {
30
- <O, B, E2, R2>(
31
- output: Guard<O, B, E2, R2>,
32
- ): <I, R, E>(input: Guard<I, O, E, R>) => Guard<I, B, E | E2, R | R2>
33
- <I, O, E, R, B, E2, R2>(
34
- input: Guard<I, O, E, R>,
35
- output: Guard<O, B, E2, R2>,
36
- ): Guard<I, B, E | E2, R | R2>
37
- } = dual(2, function flatMap<
38
- I,
39
- O,
40
- E,
41
- R,
42
- B,
43
- E2,
44
- R2,
45
- >(input: Guard<I, O, E, R>, output: Guard<O, B, E2, R2>): Guard<I, B, E | E2, R | R2> {
46
- return (i) =>
47
- Effect.flatMap(
48
- input(i),
49
- Option.match({
50
- onNone: () => Effect.succeedNone,
51
- onSome: output,
52
- }),
53
- )
54
- })
55
-
56
- export const mapEffect: {
57
- <O, B, E2, R2>(
58
- f: (o: O) => Effect.Effect<B, E2, R2>,
59
- ): <I, R, E>(guard: Guard<I, O, E, R>) => Guard<I, B, E | E2, R | R2>
60
- <I, O, E, R, B, E2, R2>(
61
- guard: Guard<I, O, E, R>,
62
- f: (o: O) => Effect.Effect<B, E2, R2>,
63
- ): Guard<I, B, E | E2, R | R2>
64
- } = dual(2, function mapEffect<
65
- I,
66
- O,
67
- E,
68
- R,
69
- B,
70
- E2,
71
- R2,
72
- >(guard: Guard<I, O, E, R>, f: (o: O) => Effect.Effect<B, E2, R2>): Guard<I, B, E | E2, R | R2> {
73
- return compose(guard, (o) => Effect.asSome(f(o)))
74
- })
75
-
76
- export const map: {
77
- <O, B>(f: (o: O) => B): <I, R, E>(guard: Guard<I, O, E, R>) => Guard<I, B, E, R>
78
- <I, O, E, R, B>(guard: Guard<I, O, E, R>, f: (o: O) => B): Guard<I, B, E, R>
79
- } = dual(2, function map<I, O, E, R, B>(guard: Guard<I, O, E, R>, f: (o: O) => B): Guard<
80
- I,
81
- B,
82
- E,
83
- R
84
- > {
85
- return mapEffect(guard, (o) => Effect.sync(() => f(o)))
86
- })
87
-
88
- export const tap: {
89
- <O, B, E2, R2>(
90
- f: (o: O) => Effect.Effect<B, E2, R2>,
91
- ): <I, R, E>(guard: Guard<I, O, E, R>) => Guard<I, O, E | E2, R | R2>
92
- <I, O, E, R, B, E2, R2>(
93
- guard: Guard<I, O, E, R>,
94
- f: (o: O) => Effect.Effect<B, E2, R2>,
95
- ): Guard<I, O, E | E2, R | R2>
96
- } = dual(2, function tap<
97
- I,
98
- O,
99
- E,
100
- R,
101
- B,
102
- E2,
103
- R2,
104
- >(guard: Guard<I, O, E, R>, f: (o: O) => Effect.Effect<B, E2, R2>): Guard<I, O, E | E2, R | R2> {
105
- return compose(guard, (o) => Effect.as(f(o), Option.some(o)))
106
- })
107
-
108
- export const filterMap: {
109
- <O, B>(f: (o: O) => Option.Option<B>): <I, R, E>(guard: Guard<I, O, E, R>) => Guard<I, B, E, R>
110
- <I, O, E, R, B>(guard: Guard<I, O, E, R>, f: (o: O) => Option.Option<B>): Guard<I, B, E, R>
111
- } = dual(
112
- 2,
113
- <I, O, E, R, B>(guard: Guard<I, O, E, R>, f: (o: O) => Option.Option<B>): Guard<I, B, E, R> => {
114
- return (i) => Effect.map(guard(i), Option.filterMap(f))
115
- },
116
- )
117
-
118
- export const filter: {
119
- <O, O2 extends O>(
120
- predicate: (o: O) => o is O2,
121
- ): <I, R, E>(guard: Guard<I, O, E, R>) => Guard<I, O, E, R>
122
- <O>(predicate: (o: O) => boolean): <I, R, E>(guard: Guard<I, O, E, R>) => Guard<I, O, E, R>
123
- <I, O, E, R, O2 extends O>(
124
- guard: Guard<I, O, E, R>,
125
- predicate: (o: O) => o is O2,
126
- ): Guard<I, O, E, R>
127
- <I, O, E, R>(guard: Guard<I, O, E, R>, predicate: (o: O) => boolean): Guard<I, O, E, R>
128
- } = dual(
129
- 2,
130
- <I, O, E, R>(guard: Guard<I, O, E, R>, predicate: (o: O) => boolean): Guard<I, O, E, R> => {
131
- return (i) => Effect.map(guard(i), Option.filter(predicate))
132
- },
133
- )
134
-
135
- export function any<const GS extends Readonly<Record<string, Guard<any, any, any, any>>>>(
136
- guards: GS,
137
- ): Guard<AnyInput<GS>, AnyOutput<GS>, Guard.Error<GS[keyof GS]>, Guard.Context<GS[keyof GS]>> {
138
- return (i: AnyInput<GS>) =>
139
- Effect.gen(function* () {
140
- for (const [_tag, guard] of Object.entries(guards)) {
141
- const match = yield* guard(i)
142
- if (Option.isSome(match)) {
143
- return Option.some({ _tag, value: match.value } as AnyOutput<GS>)
144
- }
145
- }
146
- return Option.none()
147
- })
148
- }
149
-
150
- export type AnyInput<GS extends Readonly<Record<string, Guard<any, any, any, any>>>> = Guard.Input<
151
- GS[keyof GS]
152
- >
153
-
154
- export type AnyOutput<GS extends Readonly<Record<string, Guard<any, any, any, any>>>> = [
155
- {
156
- [K in keyof GS]: { readonly _tag: K; readonly value: Guard.Output<GS[K]> }
157
- }[keyof GS],
158
- ] extends [infer R]
159
- ? R
160
- : never
161
-
162
- export function liftPredicate<A, B extends A>(predicate: Predicate.Refinement<A, B>): Guard<A, B>
163
- export function liftPredicate<A>(predicate: Predicate.Predicate<A>): Guard<A, A>
164
- export function liftPredicate<A>(predicate: Predicate.Predicate<A>): Guard<A, A> {
165
- return (a) => Effect.sync(() => (predicate(a) ? Option.some(a) : Option.none()))
166
- }
167
-
168
- export const catchAllCause: {
169
- <E = never, O2 = never, E2 = never, R2 = never>(
170
- f: (e: Cause.Cause<E>) => Effect.Effect<O2, E2, R2>,
171
- ): <I = never, O = never, R = never>(guard: Guard<I, O, E, R>) => Guard<I, O | O2, E2, R | R2>
172
- <I = never, O = never, E = never, R = never, O2 = never, E2 = never, R2 = never>(
173
- guard: Guard<I, O, E, R>,
174
- f: (e: Cause.Cause<E>) => Effect.Effect<O2, E2, R2>,
175
- ): Guard<I, O | O2, E2, R | R2>
176
- } = dual(2, function catchAllCause<
177
- I,
178
- O,
179
- E,
180
- R,
181
- O2,
182
- E2,
183
- R2,
184
- >(guard: Guard<I, O, E, R>, f: (e: Cause.Cause<E>) => Effect.Effect<O2, E2, R2>): Guard<
185
- I,
186
- O | O2,
187
- E2,
188
- R | R2
189
- > {
190
- return (i) => Effect.catchAllCause(guard(i), (a) => Effect.asSome(f(a)))
191
- })
192
-
193
- export const catchAll: {
194
- <E = never, O2 = never, E2 = never, R2 = never>(
195
- f: (e: E) => Effect.Effect<O2, E2, R2>,
196
- ): <I = never, O = never, R = never>(guard: Guard<I, O, E, R>) => Guard<I, O | O2, E2, R | R2>
197
- <I = never, O = never, E = never, R = never, O2 = never, E2 = never, R2 = never>(
198
- guard: Guard<I, O, E, R>,
199
- f: (e: E) => Effect.Effect<O2, E2, R2>,
200
- ): Guard<I, O | O2, E2, R | R2>
201
- } = dual(2, function catchAll<
202
- I,
203
- O,
204
- E,
205
- R,
206
- O2,
207
- E2,
208
- R2,
209
- >(guard: Guard<I, O, E, R>, f: (e: E) => Effect.Effect<O2, E2, R2>): Guard<I, O | O2, E2, R | R2> {
210
- return (i) => Effect.catchAll(guard(i), (a) => Effect.asSome(f(a)))
211
- })
212
-
213
- export const catchTag: {
214
- <
215
- E = never,
216
- K extends E extends { _tag: string } ? E['_tag'] : never = never,
217
- O2 = never,
218
- E2 = never,
219
- R2 = never,
220
- >(
221
- tag: K,
222
- f: (e: Extract<E, { _tag: K }>) => Effect.Effect<O2, E2, R2>,
223
- ): <I = never, O = never, R = never>(
224
- guard: Guard<I, O, E, R>,
225
- ) => Guard<I, O | O2, E2 | Exclude<E, { _tag: K }>, R | R2>
226
-
227
- <
228
- I = never,
229
- O = never,
230
- E = never,
231
- R = never,
232
- K extends E extends { _tag: string } ? E['_tag'] : never = never,
233
- O2 = never,
234
- E2 = never,
235
- R2 = never,
236
- >(
237
- guard: Guard<I, O, E, R>,
238
- tag: K,
239
- f: (e: Extract<E, { _tag: K }>) => Effect.Effect<O2, E2, R2>,
240
- ): Guard<I, O | O2, E2 | Exclude<E, { _tag: K }>, R | R2>
241
- } = dual(3, function catchTag<
242
- I,
243
- O,
244
- E,
245
- R,
246
- K extends E extends { _tag: string } ? E['_tag'] : never,
247
- O2,
248
- E2,
249
- R2,
250
- >(guard: Guard<I, O, E, R>, tag: K, f: (e: Extract<E, { _tag: K }>) => Effect.Effect<O2, E2, R2>): Guard<
251
- I,
252
- O | O2,
253
- Exclude<E, { _tag: K }> | E2,
254
- R | R2
255
- > {
256
- return (i) => Effect.catchTag(guard(i), tag, (e) => Effect.asSome(f(e)))
257
- })
258
-
259
- export const provide: {
260
- <R2>(
261
- provided: Context.Context<R2>,
262
- ): <I, O, E, R>(guard: Guard<I, O, E, R>) => Guard<I, O, E, Exclude<R, R2>>
263
- <R2>(
264
- provided: Runtime.Runtime<R2>,
265
- ): <I, O, E, R>(guard: Guard<I, O, E, R>) => Guard<I, O, E, Exclude<R, R2>>
266
- <R2, E2, R3>(
267
- provided: Layer.Layer<R2, E2, R3>,
268
- ): <I, O, E, R>(guard: Guard<I, O, E, R>) => Guard<I, O, E | E2, Exclude<R, R2> | R3>
269
-
270
- <I, O, E, R, R2>(
271
- guard: Guard<I, O, E, R>,
272
- provided: Context.Context<R2>,
273
- ): Guard<I, O, E, Exclude<R, R2>>
274
- <I, O, E, R, R2>(
275
- guard: Guard<I, O, E, R>,
276
- provided: Runtime.Runtime<R2>,
277
- ): Guard<I, O, E, Exclude<R, R2>>
278
- <I, O, E, R, R2, E2, R3>(
279
- guard: Guard<I, O, E, R>,
280
- provided: Layer.Layer<R2, E2, R3>,
281
- ): Guard<I, O, E | E2, Exclude<R, R2> | R3>
282
- } = dual(2, function provide<
283
- I,
284
- O,
285
- E,
286
- R,
287
- R2,
288
- >(guard: Guard<I, O, E, R>, provided: Context.Context<R2>): Guard<I, O, E, Exclude<R, R2>> {
289
- return (i) => Effect.provide(guard(i), provided)
290
- })
291
-
292
- export const provideService: {
293
- <Id, S>(
294
- tag: Context.Tag<Id, S>,
295
- service: S,
296
- ): <I, O, E, R>(guard: Guard<I, O, E, R>) => Guard<I, O, E, Exclude<R, Id>>
297
- <I, O, E, R, Id, S>(
298
- guard: Guard<I, O, E, R>,
299
- tag: Context.Tag<Id, S>,
300
- service: S,
301
- ): Guard<I, O, E, Exclude<R, Id>>
302
- } = dual(3, function provideService<
303
- I,
304
- O,
305
- E,
306
- R,
307
- Id,
308
- S,
309
- >(guard: Guard<I, O, E, R>, tag: Context.Tag<Id, S>, service: S): Guard<I, O, E, Exclude<R, Id>> {
310
- return (i) => Effect.provideService(guard(i), tag, service)
311
- })
312
-
313
- export const provideServiceEffect: {
314
- <Id, S, E2, R2>(
315
- tag: Context.Tag<Id, S>,
316
- service: Effect.Effect<S, E2, R2>,
317
- ): <I, O, E, R>(guard: Guard<I, O, E, R>) => Guard<I, O, E | E2, Exclude<R, Id> | R2>
318
- <I, O, E, R, Id, S, E2, R2>(
319
- guard: Guard<I, O, E, R>,
320
- tag: Context.Tag<Id, S>,
321
- service: Effect.Effect<S, E2, R2>,
322
- ): Guard<I, O, E | E2, Exclude<R, Id> | R2>
323
- } = dual(3, function provideServiceEffect<
324
- I,
325
- O,
326
- E,
327
- R,
328
- Id,
329
- S,
330
- E2,
331
- R2,
332
- >(guard: Guard<I, O, E, R>, tag: Context.Tag<Id, S>, service: Effect.Effect<S, E2, R2>): Guard<
333
- I,
334
- O,
335
- E | E2,
336
- Exclude<R, Id> | R2
337
- > {
338
- return (i) => Effect.provideServiceEffect(guard(i), tag, service)
339
- })
340
-
341
- const parseOptions: ParseOptions = { errors: 'all', onExcessProperty: 'ignore' }
342
-
343
- export function fromSchemaDecode<A, I, R>(schema: Schema.Schema<A, I, R>): Guard<I, A, never, R> {
344
- const decode_ = Schema.decode(schema)
345
- return (i: I) =>
346
- decode_(i, parseOptions).pipe(
347
- Effect.asSome,
348
- Effect.catchTag('ParseError', (e) => Effect.succeedNone),
349
- )
350
- }
351
-
352
- export function fromSchemaDecodeUnknown<A, I, R>(
353
- schema: Schema.Schema<A, I, R>,
354
- ): Guard<unknown, A, never, R> {
355
- const decode_ = Schema.decodeUnknown(schema)
356
- return (i: unknown) =>
357
- decode_(i, parseOptions).pipe(
358
- Effect.asSome,
359
- Effect.catchTag('ParseError', () => Effect.succeedNone),
360
- )
361
- }
362
-
363
- export function fromSchemaEncode<A, I, R>(schema: Schema.Schema<A, I, R>): Guard<A, I, never, R> {
364
- const encode_ = Schema.encode(schema)
365
- return (a: A) =>
366
- encode_(a, parseOptions).pipe(
367
- Effect.asSome,
368
- Effect.catchTag('ParseError', () => Effect.succeedNone),
369
- )
370
- }
371
-
372
- export const decode: {
373
- <A, O, R2>(
374
- schema: Schema.Schema<A, O, R2>,
375
- ): <I, E = never, R = never>(guard: Guard<I, O, E, R>) => Guard<I, A, E, R | R2>
376
-
377
- <I, O, E, R, A, R2>(
378
- guard: Guard<I, O, E, R>,
379
- schema: Schema.Schema<A, O, R2>,
380
- ): Guard<I, A, E, R | R2>
381
- } = dual(2, function decode<
382
- I,
383
- O,
384
- E,
385
- R,
386
- A,
387
- R2,
388
- >(guard: Guard<I, O, E, R>, schema: Schema.Schema<A, O, R2>): Guard<I, A, E, R | R2> {
389
- return compose(guard, fromSchemaDecode(schema))
390
- })
391
-
392
- export const encode: {
393
- <O, A, R2>(
394
- schema: Schema.Schema<O, A, R2>,
395
- ): <I, E = never, R = never>(guard: Guard<I, O, E, R>) => Guard<I, A, E, R | R2>
396
-
397
- <I, O, E, R, A, R2>(
398
- guard: Guard<I, O, E, R>,
399
- schema: Schema.Schema<O, A, R2>,
400
- ): Guard<I, A, E, R | R2>
401
- } = dual(2, function encode<
402
- I,
403
- O,
404
- E,
405
- R,
406
- A,
407
- R2,
408
- >(guard: Guard<I, O, E, R>, schema: Schema.Schema<O, A, R2>): Guard<I, A, E, R | R2> {
409
- return compose(guard, fromSchemaEncode(schema))
410
- })
411
-
412
- const let_: {
413
- <O, K extends PropertyKey, B>(
414
- key: K,
415
- value: (o: O) => B,
416
- ): <I, E = never, R = never>(guard: Guard<I, O, E, R>) => Guard<I, O & { [k in K]: B }, E, R>
417
-
418
- <I, O, E, R, K extends PropertyKey, B>(
419
- guard: Guard<I, O, E, R>,
420
- key: K,
421
- value: (o: O) => B,
422
- ): Guard<I, O & { [k in K]: B }, E, R>
423
- } = dual(3, function let_<
424
- I,
425
- O,
426
- E,
427
- R,
428
- K extends PropertyKey,
429
- B,
430
- >(guard: Guard<I, O, E, R>, key: K, value: (o: O) => B): Guard<I, O & { [k in K]: B }, E, R> {
431
- return map(guard, (a) => ({ ...a, [key]: value(a) }) as O & { [k in K]: B })
432
- })
433
-
434
- export { let_ as let }
435
-
436
- export const attachProperty: {
437
- <K extends PropertyKey, B>(
438
- key: K,
439
- value: B,
440
- ): <I, O, E, R>(guard: Guard<I, O, E, R>) => Guard<I, O & { readonly [k in K]: B }, E, R>
441
-
442
- <I, O, E, R, K extends PropertyKey, B>(
443
- guard: Guard<I, O, E, R>,
444
- key: K,
445
- value: B,
446
- ): Guard<I, O & { readonly [k in K]: B }, E, R>
447
- } = dual(3, function attachProperty<
448
- I,
449
- O,
450
- E,
451
- R,
452
- K extends PropertyKey,
453
- B,
454
- >(guard: Guard<I, O, E, R>, key: K, value: B): Guard<I, O & { readonly [k in K]: B }, E, R> {
455
- return map(guard, (a) => ({ ...a, [key]: value }) as O & { readonly [k in K]: B })
456
- })
457
-
458
- export const addTag: {
459
- <B>(
460
- value: B,
461
- ): <I, O, E = never, R = never>(
462
- guard: Guard<I, O, E, R>,
463
- ) => Guard<I, O & { readonly _tag: B }, E, R>
464
-
465
- <I, O, E, R, B>(guard: Guard<I, O, E, R>, value: B): Guard<I, O & { readonly _tag: B }, E, R>
466
- } = dual(2, function addTag<I, O, E, R, B>(guard: Guard<I, O, E, R>, value: B): Guard<
467
- I,
468
- O & { readonly _tag: B },
469
- E,
470
- R
471
- > {
472
- return map(guard, (a) => ({ ...a, _tag: value }) as O & { readonly _tag: B })
473
- })
474
-
475
- export const bindTo: {
476
- <K extends PropertyKey>(
477
- key: K,
478
- ): <I, O, E, R>(guard: Guard<I, O, E, R>) => Guard<I, { [k in K]: O }, E, R>
479
- <I, O, E, R, K extends PropertyKey>(
480
- guard: Guard<I, O, E, R>,
481
- key: K,
482
- ): Guard<I, { [k in K]: O }, E, R>
483
- } = dual(
484
- 2,
485
- <I, O, E, R, K extends PropertyKey>(
486
- guard: Guard<I, O, E, R>,
487
- key: K,
488
- ): Guard<I, { [k in K]: O }, E, R> => map(guard, (a) => ({ [key]: a }) as { [k in K]: O }),
489
- )
490
-
491
- export const bind: {
492
- <I, O, E, R, K extends PropertyKey, B, E2, R2>(
493
- key: K,
494
- f: Guard<O, B, E2, R2>,
495
- ): (guard: Guard<I, O, E, R>) => Guard<I, O & { [k in K]: B }, E | E2, R | R2>
496
-
497
- <I, O, E, R, K extends PropertyKey, B, E2, R2>(
498
- guard: Guard<I, O, E, R>,
499
- key: K,
500
- f: Guard<O, B, E2, R2>,
501
- ): Guard<I, O & { [k in K]: B }, E | E2, R | R2>
502
- } = dual(3, function bind<
503
- I,
504
- O,
505
- E,
506
- R,
507
- K extends PropertyKey,
508
- B,
509
- E2,
510
- R2,
511
- >(guard: Guard<I, O, E, R>, key: K, f: Guard<O, B, E2, R2>): Guard<
512
- I,
513
- O & { [k in K]: B },
514
- E | E2,
515
- R | R2
516
- > {
517
- const f_ = bindTo(f, key)
518
-
519
- return compose(guard, (o) =>
520
- Effect.map(
521
- f_(o),
522
- Option.map((b) => ({ ...o, ...b })),
523
- ),
524
- )
525
- })
526
-
527
- declare global {
528
- interface Function extends Pipeable.Pipeable {}
529
- }
530
-
531
- Function.prototype.pipe = function pipe() {
532
- // biome-ignore lint/style/noArguments: This is a pipeable function
533
- return Pipeable.pipeArguments(this, arguments)
534
- }
@@ -1,18 +0,0 @@
1
- import { describe, expect, it } from '@effect/vitest'
2
- import { Effect, Option } from 'effect'
3
- import { Guardable, GUARDABLE } from './Guardable.js'
4
-
5
- describe('Guardable', () => {
6
- it('should be a Guard function', async () => {
7
- class Test extends Guardable<number, number> {
8
- constructor(readonly multiplier: number) {
9
- super()
10
- }
11
-
12
- [GUARDABLE] = (input: number) => Effect.succeedSome(input * this.multiplier)
13
- }
14
- const test = new Test(3)
15
-
16
- expect(await Effect.runPromise(test(1))).toEqual(Option.some(3))
17
- })
18
- })
package/src/Guardable.ts DELETED
@@ -1,22 +0,0 @@
1
- import * as Pipeable from 'effect/Pipeable'
2
- import { ExtensibleFunction } from './ExtensibleFunction.js'
3
- import type { Guard } from './Guard.js'
4
-
5
- export const GUARDABLE = Symbol.for('@typed/guard/Guardable')
6
- export type GUARDABLE = typeof GUARDABLE
7
-
8
- export abstract class Guardable<I, O, E = never, R = never>
9
- extends ExtensibleFunction<Guard<I, O, E, R>>
10
- implements Pipeable.Pipeable
11
- {
12
- constructor() {
13
- super((input) => this[GUARDABLE](input))
14
- }
15
-
16
- abstract readonly [GUARDABLE]: Guard<I, O, E, R>
17
-
18
- pipe() {
19
- // biome-ignore lint/style/noArguments: This is a pipeable function
20
- return Pipeable.pipeArguments(this, arguments)
21
- }
22
- }
package/tsconfig.json DELETED
@@ -1,27 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "ESNext",
5
- "moduleResolution": "bundler",
6
- "lib": [
7
- "ES2022",
8
- "DOM"
9
- ],
10
- "strict": true,
11
- "esModuleInterop": true,
12
- "skipLibCheck": true,
13
- "forceConsistentCasingInFileNames": true,
14
- "declaration": true,
15
- "sourceMap": true,
16
- "outDir": "dist",
17
- "rootDir": "src"
18
- },
19
- "include": [
20
- "src/**/*"
21
- ],
22
- "exclude": [
23
- "node_modules",
24
- "dist",
25
- "**/*.test.ts"
26
- ]
27
- }