@fuman/fetch 0.0.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.
Files changed (59) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +13 -0
  3. package/_types.d.ts +8 -0
  4. package/addons/_utils.cjs +54 -0
  5. package/addons/_utils.d.ts +3 -0
  6. package/addons/_utils.js +54 -0
  7. package/addons/bundle.cjs +18 -0
  8. package/addons/bundle.d.ts +7 -0
  9. package/addons/bundle.js +18 -0
  10. package/addons/form.cjs +23 -0
  11. package/addons/form.d.ts +22 -0
  12. package/addons/form.js +23 -0
  13. package/addons/index.d.ts +3 -0
  14. package/addons/multipart.cjs +35 -0
  15. package/addons/multipart.d.ts +22 -0
  16. package/addons/multipart.js +35 -0
  17. package/addons/parse/_types.d.ts +11 -0
  18. package/addons/parse/adapters/valibot.d.ts +8 -0
  19. package/addons/parse/adapters/yup.d.ts +13 -0
  20. package/addons/parse/adapters/zod.d.ts +6 -0
  21. package/addons/parse/addon.cjs +12 -0
  22. package/addons/parse/addon.d.ts +6 -0
  23. package/addons/parse/addon.js +12 -0
  24. package/addons/query.cjs +22 -0
  25. package/addons/query.d.ts +17 -0
  26. package/addons/query.js +22 -0
  27. package/addons/rate-limit.cjs +65 -0
  28. package/addons/rate-limit.d.ts +62 -0
  29. package/addons/rate-limit.js +65 -0
  30. package/addons/retry.cjs +74 -0
  31. package/addons/retry.d.ts +58 -0
  32. package/addons/retry.js +74 -0
  33. package/addons/timeout.cjs +54 -0
  34. package/addons/timeout.d.ts +25 -0
  35. package/addons/timeout.js +54 -0
  36. package/addons/tough-cookie.d.ts +7 -0
  37. package/addons/types.d.ts +30 -0
  38. package/default.cjs +18 -0
  39. package/default.d.ts +30 -0
  40. package/default.js +18 -0
  41. package/ffetch.cjs +200 -0
  42. package/ffetch.d.ts +101 -0
  43. package/ffetch.js +200 -0
  44. package/index.cjs +10 -0
  45. package/index.d.ts +4 -0
  46. package/index.js +10 -0
  47. package/package.json +89 -0
  48. package/tough.cjs +24 -0
  49. package/tough.d.ts +1 -0
  50. package/tough.js +24 -0
  51. package/valibot.cjs +16 -0
  52. package/valibot.d.ts +1 -0
  53. package/valibot.js +16 -0
  54. package/yup.cjs +18 -0
  55. package/yup.d.ts +1 -0
  56. package/yup.js +18 -0
  57. package/zod.cjs +15 -0
  58. package/zod.d.ts +1 -0
  59. package/zod.js +15 -0
package/valibot.js ADDED
@@ -0,0 +1,16 @@
1
+ import { parseAsync, parse } from "valibot";
2
+ function ffetchValibotAdapter({ async, ...rest } = {}) {
3
+ const _provider = null;
4
+ const parser = async ? async function(schema, value) {
5
+ return parseAsync(schema, value, rest);
6
+ } : function(schema, value) {
7
+ return parse(schema, value, rest);
8
+ };
9
+ return {
10
+ _provider,
11
+ parse: parser
12
+ };
13
+ }
14
+ export {
15
+ ffetchValibotAdapter
16
+ };
package/yup.cjs ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ function ffetchYupAdapter({
4
+ action,
5
+ options
6
+ } = { action: "validate" }) {
7
+ const _provider = null;
8
+ const parse = action === "cast" ? async function(schema, value) {
9
+ return schema.cast(value, options);
10
+ } : function(schema, value) {
11
+ return schema.validate(value, options);
12
+ };
13
+ return {
14
+ _provider,
15
+ parse
16
+ };
17
+ }
18
+ exports.ffetchYupAdapter = ffetchYupAdapter;
package/yup.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./addons/parse/adapters/yup.js"
package/yup.js ADDED
@@ -0,0 +1,18 @@
1
+ function ffetchYupAdapter({
2
+ action,
3
+ options
4
+ } = { action: "validate" }) {
5
+ const _provider = null;
6
+ const parse = action === "cast" ? async function(schema, value) {
7
+ return schema.cast(value, options);
8
+ } : function(schema, value) {
9
+ return schema.validate(value, options);
10
+ };
11
+ return {
12
+ _provider,
13
+ parse
14
+ };
15
+ }
16
+ export {
17
+ ffetchYupAdapter
18
+ };
package/zod.cjs ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ function ffetchZodAdapter({ async, ...rest } = {}) {
4
+ const _provider = null;
5
+ const parse = async ? async function(schema, value) {
6
+ return schema.parseAsync(value, rest);
7
+ } : function(schema, value) {
8
+ return schema.parse(value, rest);
9
+ };
10
+ return {
11
+ _provider,
12
+ parse
13
+ };
14
+ }
15
+ exports.ffetchZodAdapter = ffetchZodAdapter;
package/zod.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./addons/parse/adapters/zod.js"
package/zod.js ADDED
@@ -0,0 +1,15 @@
1
+ function ffetchZodAdapter({ async, ...rest } = {}) {
2
+ const _provider = null;
3
+ const parse = async ? async function(schema, value) {
4
+ return schema.parseAsync(value, rest);
5
+ } : function(schema, value) {
6
+ return schema.parse(value, rest);
7
+ };
8
+ return {
9
+ _provider,
10
+ parse
11
+ };
12
+ }
13
+ export {
14
+ ffetchZodAdapter
15
+ };