functype-react 1.8.0 → 1.9.0
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/forms/Validated.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Left as e,List as t,Right as n}from"functype";function r(e){return n(e)}function i(n){
|
|
1
|
+
import{Left as e,List as t,Right as n}from"functype";function r(e){return n(e)}function i(n){let r=n instanceof Array?t(n):n;return e(r)}export{i as invalid,r as valid};
|
|
2
2
|
//# sourceMappingURL=Validated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Validated.js","names":[],"sources":["../../src/forms/Validated.ts"],"sourcesContent":["import { type Either, Left, List, type List as ListT, Right } from \"functype\"\n\n/**\n * Applicative-error-accumulating result for form validation.\n *\n * Encoded as `Either<List<E>, A>` — the same shape Scala's cats uses for\n * `ValidatedNel`. Multiple field errors accumulate via `List.concat`; on\n * success, the validated value rides in the `Right` channel.\n *\n * functype core already exposes this pattern via `FormValidation<T>` in\n * `packages/functype/src/error/typed/Validation.ts`; this alias just gives\n * the React-facing surface an ergonomic name.\n */\nexport type Validated<E, A> = Either<ListT<E>, A>\n\n/** Construct a `Valid` (Right) result. */\nexport function valid<A>(value: A): Validated<never, A> {\n return Right<ListT<never>, A>(value)\n}\n\n/** Construct an `Invalid` (Left) result from an iterable of errors. */\nexport function invalid<E>(errors: ListT<E> | ReadonlyArray<E>): Validated<E, never> {\n const list = errors instanceof Array ? List<E>(errors) : (errors as ListT<E>)\n return Left<ListT<E>, never>(list)\n}\n"],"mappings":"qDAgBA,SAAgB,EAAS,EAA+B,CACtD,OAAO,EAAuB,CAAK,CACrC,CAGA,SAAgB,EAAW,EAA0D,
|
|
1
|
+
{"version":3,"file":"Validated.js","names":[],"sources":["../../src/forms/Validated.ts"],"sourcesContent":["import { type Either, Left, List, type List as ListT, Right } from \"functype\"\n\n/**\n * Applicative-error-accumulating result for form validation.\n *\n * Encoded as `Either<List<E>, A>` — the same shape Scala's cats uses for\n * `ValidatedNel`. Multiple field errors accumulate via `List.concat`; on\n * success, the validated value rides in the `Right` channel.\n *\n * functype core already exposes this pattern via `FormValidation<T>` in\n * `packages/functype/src/error/typed/Validation.ts`; this alias just gives\n * the React-facing surface an ergonomic name.\n */\nexport type Validated<E, A> = Either<ListT<E>, A>\n\n/** Construct a `Valid` (Right) result. */\nexport function valid<A>(value: A): Validated<never, A> {\n return Right<ListT<never>, A>(value)\n}\n\n/** Construct an `Invalid` (Left) result from an iterable of errors. */\nexport function invalid<E>(errors: ListT<E> | ReadonlyArray<E>): Validated<E, never> {\n const list = errors instanceof Array ? List<E>(errors) : (errors as ListT<E>)\n return Left<ListT<E>, never>(list)\n}\n"],"mappings":"qDAgBA,SAAgB,EAAS,EAA+B,CACtD,OAAO,EAAuB,CAAK,CACrC,CAGA,SAAgB,EAAW,EAA0D,CACnF,IAAM,EAAO,aAAkB,MAAQ,EAAQ,CAAM,EAAK,EAC1D,OAAO,EAAsB,CAAI,CACnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "functype-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "React bindings for functype — ADT-aware hooks and exhaustive pattern matching components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"functype",
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"@testing-library/jest-dom": "^6.10.0",
|
|
46
46
|
"@testing-library/react": "^16.3.2",
|
|
47
47
|
"@types/node": "^24.13.3",
|
|
48
|
-
"@types/react": "^19.2.
|
|
49
|
-
"@types/react-dom": "^19.2.
|
|
48
|
+
"@types/react": "^19.2.18",
|
|
49
|
+
"@types/react-dom": "^19.2.4",
|
|
50
50
|
"fast-check": "^4.9.0",
|
|
51
51
|
"jsdom": "^26.1.0",
|
|
52
52
|
"react": "^19.2.8",
|
|
53
53
|
"react-dom": "^19.2.8",
|
|
54
|
-
"ts-builds": "^3.
|
|
54
|
+
"ts-builds": "^3.4.1",
|
|
55
55
|
"tsdown": "^0.22.14",
|
|
56
|
-
"functype": "^1.
|
|
56
|
+
"functype": "^1.9.0"
|
|
57
57
|
},
|
|
58
58
|
"type": "module",
|
|
59
59
|
"main": "./dist/index.js",
|