mini-effect 0.0.1 → 0.0.3
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/dist/mini-effect.d.mts +1 -1
- package/dist/schema.d.mts +3 -1
- package/package.json +2 -2
package/dist/mini-effect.d.mts
CHANGED
|
@@ -31,7 +31,7 @@ type inferInput<T> = T extends PipeableThunk<any, any, infer I> ? I : never;
|
|
|
31
31
|
type inferReturn<T> = T extends WrapEffect<infer R> ? R : T extends Effect<infer R> ? R : T extends PipeableThunk<infer R> ? R : never;
|
|
32
32
|
type inferError<T> = T extends PipeableThunk<any, infer E> ? E : T extends WrapEffect<any, infer E> ? E : T extends Effect<any, infer E> ? E : never;
|
|
33
33
|
type inferExclude<T> = T extends WrapEffect<any, any, infer CE> ? CE : never;
|
|
34
|
-
type Simplify<T> = T extends Effect<infer R, infer E> ? Effect<R, E> :
|
|
34
|
+
type Simplify<T> = T extends Effect<infer R, infer E> ? Effect<R, E> : never;
|
|
35
35
|
type PipeReturn<F extends Pipeable[]> = IsNever<CheckPipe<F>> extends true ? never : Simplify<Effect<inferReturn<CheckPipe<F>> | inferReturn<Extract<F[number], WrapEffect<any, any, any>>>, Exclude<inferError<CheckPipe<F>>, inferExclude<F[number]>>>>;
|
|
36
36
|
type CheckPipe<F extends Pipeable[]> = F extends [Effect, WrapEffect, ...infer R] ? R extends [Pipeable, ...Pipeable[]] ? CheckPipe<R> : F[0] : F extends [Pipeable, Pipeable, ...infer P] ? ExtendsStrict<inferReturn<F[0]>, inferInput<F[1]>> extends true ? P extends Pipeable[] ? CheckPipe<[F[1], ...P]> : never : never : F extends [WrapEffect] ? Effect<inferReturn<F[0]>> : F extends [Pipeable] ? F[0] : never;
|
|
37
37
|
type IsNever<T> = [T] extends [never] ? true : false;
|
package/dist/schema.d.mts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Effect } from "./mini-effect.mjs";
|
|
2
|
+
import { FailureConstructor } from "./tag.mjs";
|
|
2
3
|
import * as v from "valibot";
|
|
3
4
|
export * from "valibot";
|
|
4
5
|
|
|
5
6
|
//#region src/schema.d.ts
|
|
6
7
|
type Schema = v.BaseSchema<unknown, unknown, v.BaseIssue<unknown>> | v.BaseSchemaAsync<unknown, unknown, v.BaseIssue<unknown>>;
|
|
7
|
-
declare const
|
|
8
|
+
declare const FaildToValidateError: FailureConstructor<"FailedToValidate">;
|
|
9
|
+
declare const validate: <const S extends Schema>(schema: S) => (value: unknown) => Effect<v.InferOutput<S>, InstanceType<typeof FaildToValidateError>>;
|
|
8
10
|
//#endregion
|
|
9
11
|
export { Schema, validate };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mini-effect",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.3",
|
|
5
5
|
"description": "A mini-effect library for TypeScript.",
|
|
6
6
|
"author": "Jacob Ebey <jacob.ebey@live.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"url": "https://github.com/jacob-ebey/mini-effect/issues"
|
|
15
15
|
},
|
|
16
16
|
"exports": {
|
|
17
|
+
".": "./dist/mini-effect.mjs",
|
|
17
18
|
"./concurrency": "./dist/concurrency.mjs",
|
|
18
19
|
"./fetch": "./dist/fetch.mjs",
|
|
19
|
-
"./mini-effect": "./dist/mini-effect.mjs",
|
|
20
20
|
"./schema": "./dist/schema.mjs",
|
|
21
21
|
"./tag": "./dist/tag.mjs",
|
|
22
22
|
"./package.json": "./package.json"
|