@fuman/fetch 0.0.3 → 0.0.4

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.
@@ -0,0 +1,8 @@
1
+ import { FfetchParser, FfetchTypeProvider } from '../_types.js';
2
+ import type * as v from '@badrap/valita';
3
+ export interface ValitaTypeProvider extends FfetchTypeProvider {
4
+ readonly parsed: this['schema'] extends v.Type<any> ? v.Infer<this['schema']> : never;
5
+ }
6
+ type ParseOptions = NonNullable<Parameters<v.Type<any>['parse']>[1]>;
7
+ export declare function ffetchValitaAdapter(options?: ParseOptions): FfetchParser<ValitaTypeProvider>;
8
+ export {};
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@fuman/fetch",
3
3
  "type": "module",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "description": "tiny wrapper over fetch",
6
6
  "license": "MIT",
7
7
  "dependencies": {
8
- "@fuman/utils": "^0.0.3"
8
+ "@fuman/utils": "^0.0.4"
9
9
  },
10
10
  "peerDependencies": {
11
+ "@badrap/valita": ">=0.4.0",
11
12
  "tough-cookie": "^5.0.0 || ^4.0.0",
12
13
  "valibot": "^0.42.0",
13
14
  "yup": "^1.0.0",
@@ -54,6 +55,16 @@
54
55
  "default": "./yup.cjs"
55
56
  }
56
57
  },
58
+ "./valita": {
59
+ "import": {
60
+ "types": "./valita.d.ts",
61
+ "default": "./valita.js"
62
+ },
63
+ "require": {
64
+ "types": "./valita.d.cts",
65
+ "default": "./valita.cjs"
66
+ }
67
+ },
57
68
  "./tough": {
58
69
  "import": {
59
70
  "types": "./tough.d.ts",
@@ -67,6 +78,9 @@
67
78
  },
68
79
  "sideEffects": false,
69
80
  "peerDependenciesMeta": {
81
+ "@badrap/valita": {
82
+ "optional": true
83
+ },
70
84
  "tough-cookie": {
71
85
  "optional": true
72
86
  },
package/valita.cjs ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ function ffetchValitaAdapter(options) {
4
+ const _provider = null;
5
+ return {
6
+ _provider,
7
+ parse(schema, value) {
8
+ return schema.parse(value, options);
9
+ }
10
+ };
11
+ }
12
+ exports.ffetchValitaAdapter = ffetchValitaAdapter;
package/valita.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./addons/parse/adapters/valita.js"
package/valita.js ADDED
@@ -0,0 +1,12 @@
1
+ function ffetchValitaAdapter(options) {
2
+ const _provider = null;
3
+ return {
4
+ _provider,
5
+ parse(schema, value) {
6
+ return schema.parse(value, options);
7
+ }
8
+ };
9
+ }
10
+ export {
11
+ ffetchValitaAdapter
12
+ };