@recode-js/next-toolkit 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 (266) hide show
  1. package/README.md +27 -0
  2. package/dist/NextToolkitProvider.d.ts +8 -0
  3. package/dist/NextToolkitProvider.d.ts.map +1 -0
  4. package/dist/NextToolkitProvider.js +12 -0
  5. package/dist/NextToolkitProvider.js.map +1 -0
  6. package/dist/_virtual/_commonjsHelpers.js +6 -0
  7. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  8. package/dist/_virtual/browser.js +4 -0
  9. package/dist/_virtual/browser.js.map +1 -0
  10. package/dist/_virtual/index.js +4 -0
  11. package/dist/_virtual/index.js.map +1 -0
  12. package/dist/_virtual/index2.js +4 -0
  13. package/dist/_virtual/index2.js.map +1 -0
  14. package/dist/_virtual/index3.js +4 -0
  15. package/dist/_virtual/index3.js.map +1 -0
  16. package/dist/_virtual/node.js +4 -0
  17. package/dist/_virtual/node.js.map +1 -0
  18. package/dist/_virtual/use-sync-external-store-with-selector.development.js +4 -0
  19. package/dist/_virtual/use-sync-external-store-with-selector.development.js.map +1 -0
  20. package/dist/_virtual/use-sync-external-store-with-selector.production.js +4 -0
  21. package/dist/_virtual/use-sync-external-store-with-selector.production.js.map +1 -0
  22. package/dist/_virtual/with-selector.js +4 -0
  23. package/dist/_virtual/with-selector.js.map +1 -0
  24. package/dist/axios/api.d.ts +16 -0
  25. package/dist/axios/api.d.ts.map +1 -0
  26. package/dist/axios/api.js +11 -0
  27. package/dist/axios/api.js.map +1 -0
  28. package/dist/components/auth/Form.d.ts +10 -0
  29. package/dist/components/auth/Form.d.ts.map +1 -0
  30. package/dist/components/auth/Form.js +49 -0
  31. package/dist/components/auth/Form.js.map +1 -0
  32. package/dist/components/auth/auth.d.ts +8 -0
  33. package/dist/components/auth/auth.d.ts.map +1 -0
  34. package/dist/components/auth/auth.js +18 -0
  35. package/dist/components/auth/auth.js.map +1 -0
  36. package/dist/components/auth/formActions.d.ts +17 -0
  37. package/dist/components/auth/formActions.d.ts.map +1 -0
  38. package/dist/components/auth/formActions.js +58 -0
  39. package/dist/components/auth/formActions.js.map +1 -0
  40. package/dist/components/auth/login/LoginPage.d.ts +7 -0
  41. package/dist/components/auth/login/LoginPage.d.ts.map +1 -0
  42. package/dist/components/auth/login/LoginPage.js +18 -0
  43. package/dist/components/auth/login/LoginPage.js.map +1 -0
  44. package/dist/components/auth/login/login.d.ts +1 -0
  45. package/dist/components/auth/login/login.d.ts.map +1 -0
  46. package/dist/components/auth/register/RegisterPage.d.ts +7 -0
  47. package/dist/components/auth/register/RegisterPage.d.ts.map +1 -0
  48. package/dist/components/auth/register/RegisterPage.js +18 -0
  49. package/dist/components/auth/register/RegisterPage.js.map +1 -0
  50. package/dist/components/auth/register/register.d.ts +1 -0
  51. package/dist/components/auth/register/register.d.ts.map +1 -0
  52. package/dist/components/auth/styles/form.module.css.js +4 -0
  53. package/dist/components/auth/styles/form.module.css.js.map +1 -0
  54. package/dist/components/common/Button.d.ts +25 -0
  55. package/dist/components/common/Button.d.ts.map +1 -0
  56. package/dist/components/common/Button.js +25 -0
  57. package/dist/components/common/Button.js.map +1 -0
  58. package/dist/components/common/styles/button.module.css.js +4 -0
  59. package/dist/components/common/styles/button.module.css.js.map +1 -0
  60. package/dist/components/navigation/NavigatorProvider.d.ts +10 -0
  61. package/dist/components/navigation/NavigatorProvider.d.ts.map +1 -0
  62. package/dist/components/navigation/NavigatorProvider.js +15 -0
  63. package/dist/components/navigation/NavigatorProvider.js.map +1 -0
  64. package/dist/components/navigation/bottom-tab/BottomTab.d.ts +12 -0
  65. package/dist/components/navigation/bottom-tab/BottomTab.d.ts.map +1 -0
  66. package/dist/components/navigation/bottom-tab/BottomTab.js +45 -0
  67. package/dist/components/navigation/bottom-tab/BottomTab.js.map +1 -0
  68. package/dist/components/navigation/bottom-tab/bottom-tab.module.css.js +4 -0
  69. package/dist/components/navigation/bottom-tab/bottom-tab.module.css.js.map +1 -0
  70. package/dist/components/navigation/drawer/Drawer.d.ts +21 -0
  71. package/dist/components/navigation/drawer/Drawer.d.ts.map +1 -0
  72. package/dist/components/navigation/drawer/Drawer.js +91 -0
  73. package/dist/components/navigation/drawer/Drawer.js.map +1 -0
  74. package/dist/components/navigation/drawer/drawer.module.css.js +4 -0
  75. package/dist/components/navigation/drawer/drawer.module.css.js.map +1 -0
  76. package/dist/components/navigation/header/Header.d.ts +7 -0
  77. package/dist/components/navigation/header/Header.d.ts.map +1 -0
  78. package/dist/components/navigation/header/Header.js +32 -0
  79. package/dist/components/navigation/header/Header.js.map +1 -0
  80. package/dist/components/navigation/header/header.module.css.js +4 -0
  81. package/dist/components/navigation/header/header.module.css.js.map +1 -0
  82. package/dist/components/navigation/navigatior-provider.module.css.js +4 -0
  83. package/dist/components/navigation/navigatior-provider.module.css.js.map +1 -0
  84. package/dist/components/toast/Toast.d.ts +9 -0
  85. package/dist/components/toast/Toast.d.ts.map +1 -0
  86. package/dist/components/toast/Toast.js +92 -0
  87. package/dist/components/toast/Toast.js.map +1 -0
  88. package/dist/components/toast/ToastExamples.d.ts +2 -0
  89. package/dist/components/toast/ToastExamples.d.ts.map +1 -0
  90. package/dist/components/toast/ToastExamples.js +74 -0
  91. package/dist/components/toast/ToastExamples.js.map +1 -0
  92. package/dist/components/toast/toast.module.css.js +4 -0
  93. package/dist/components/toast/toast.module.css.js.map +1 -0
  94. package/dist/index.d.ts +11 -0
  95. package/dist/index.d.ts.map +1 -0
  96. package/dist/index.js +9 -0
  97. package/dist/index.js.map +1 -0
  98. package/dist/node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.js +969 -0
  99. package/dist/node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.js.map +1 -0
  100. package/dist/node_modules/axios/index.js +26 -0
  101. package/dist/node_modules/axios/index.js.map +1 -0
  102. package/dist/node_modules/axios/lib/adapters/adapters.js +129 -0
  103. package/dist/node_modules/axios/lib/adapters/adapters.js.map +1 -0
  104. package/dist/node_modules/axios/lib/adapters/fetch.js +289 -0
  105. package/dist/node_modules/axios/lib/adapters/fetch.js.map +1 -0
  106. package/dist/node_modules/axios/lib/adapters/http.js +895 -0
  107. package/dist/node_modules/axios/lib/adapters/http.js.map +1 -0
  108. package/dist/node_modules/axios/lib/adapters/xhr.js +203 -0
  109. package/dist/node_modules/axios/lib/adapters/xhr.js.map +1 -0
  110. package/dist/node_modules/axios/lib/axios.js +88 -0
  111. package/dist/node_modules/axios/lib/axios.js.map +1 -0
  112. package/dist/node_modules/axios/lib/cancel/CancelToken.js +135 -0
  113. package/dist/node_modules/axios/lib/cancel/CancelToken.js.map +1 -0
  114. package/dist/node_modules/axios/lib/cancel/CanceledError.js +25 -0
  115. package/dist/node_modules/axios/lib/cancel/CanceledError.js.map +1 -0
  116. package/dist/node_modules/axios/lib/cancel/isCancel.js +7 -0
  117. package/dist/node_modules/axios/lib/cancel/isCancel.js.map +1 -0
  118. package/dist/node_modules/axios/lib/core/Axios.js +238 -0
  119. package/dist/node_modules/axios/lib/core/Axios.js.map +1 -0
  120. package/dist/node_modules/axios/lib/core/AxiosError.js +110 -0
  121. package/dist/node_modules/axios/lib/core/AxiosError.js.map +1 -0
  122. package/dist/node_modules/axios/lib/core/AxiosHeaders.js +314 -0
  123. package/dist/node_modules/axios/lib/core/AxiosHeaders.js.map +1 -0
  124. package/dist/node_modules/axios/lib/core/InterceptorManager.js +71 -0
  125. package/dist/node_modules/axios/lib/core/InterceptorManager.js.map +1 -0
  126. package/dist/node_modules/axios/lib/core/buildFullPath.js +24 -0
  127. package/dist/node_modules/axios/lib/core/buildFullPath.js.map +1 -0
  128. package/dist/node_modules/axios/lib/core/dispatchRequest.js +83 -0
  129. package/dist/node_modules/axios/lib/core/dispatchRequest.js.map +1 -0
  130. package/dist/node_modules/axios/lib/core/mergeConfig.js +108 -0
  131. package/dist/node_modules/axios/lib/core/mergeConfig.js.map +1 -0
  132. package/dist/node_modules/axios/lib/core/settle.js +29 -0
  133. package/dist/node_modules/axios/lib/core/settle.js.map +1 -0
  134. package/dist/node_modules/axios/lib/core/transformData.js +30 -0
  135. package/dist/node_modules/axios/lib/core/transformData.js.map +1 -0
  136. package/dist/node_modules/axios/lib/defaults/index.js +161 -0
  137. package/dist/node_modules/axios/lib/defaults/index.js.map +1 -0
  138. package/dist/node_modules/axios/lib/defaults/transitional.js +9 -0
  139. package/dist/node_modules/axios/lib/defaults/transitional.js.map +1 -0
  140. package/dist/node_modules/axios/lib/env/data.js +4 -0
  141. package/dist/node_modules/axios/lib/env/data.js.map +1 -0
  142. package/dist/node_modules/axios/lib/helpers/AxiosTransformStream.js +143 -0
  143. package/dist/node_modules/axios/lib/helpers/AxiosTransformStream.js.map +1 -0
  144. package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +58 -0
  145. package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js.map +1 -0
  146. package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js +78 -0
  147. package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js.map +1 -0
  148. package/dist/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +28 -0
  149. package/dist/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js.map +1 -0
  150. package/dist/node_modules/axios/lib/helpers/bind.js +16 -0
  151. package/dist/node_modules/axios/lib/helpers/bind.js.map +1 -0
  152. package/dist/node_modules/axios/lib/helpers/buildURL.js +69 -0
  153. package/dist/node_modules/axios/lib/helpers/buildURL.js.map +1 -0
  154. package/dist/node_modules/axios/lib/helpers/callbackify.js +17 -0
  155. package/dist/node_modules/axios/lib/helpers/callbackify.js.map +1 -0
  156. package/dist/node_modules/axios/lib/helpers/combineURLs.js +17 -0
  157. package/dist/node_modules/axios/lib/helpers/combineURLs.js.map +1 -0
  158. package/dist/node_modules/axios/lib/helpers/composeSignals.js +49 -0
  159. package/dist/node_modules/axios/lib/helpers/composeSignals.js.map +1 -0
  160. package/dist/node_modules/axios/lib/helpers/cookies.js +55 -0
  161. package/dist/node_modules/axios/lib/helpers/cookies.js.map +1 -0
  162. package/dist/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +76 -0
  163. package/dist/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js.map +1 -0
  164. package/dist/node_modules/axios/lib/helpers/formDataToJSON.js +95 -0
  165. package/dist/node_modules/axios/lib/helpers/formDataToJSON.js.map +1 -0
  166. package/dist/node_modules/axios/lib/helpers/formDataToStream.js +113 -0
  167. package/dist/node_modules/axios/lib/helpers/formDataToStream.js.map +1 -0
  168. package/dist/node_modules/axios/lib/helpers/fromDataURI.js +55 -0
  169. package/dist/node_modules/axios/lib/helpers/fromDataURI.js.map +1 -0
  170. package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js +17 -0
  171. package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js.map +1 -0
  172. package/dist/node_modules/axios/lib/helpers/isAxiosError.js +16 -0
  173. package/dist/node_modules/axios/lib/helpers/isAxiosError.js.map +1 -0
  174. package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js +17 -0
  175. package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js.map +1 -0
  176. package/dist/node_modules/axios/lib/helpers/parseHeaders.js +57 -0
  177. package/dist/node_modules/axios/lib/helpers/parseHeaders.js.map +1 -0
  178. package/dist/node_modules/axios/lib/helpers/parseProtocol.js +8 -0
  179. package/dist/node_modules/axios/lib/helpers/parseProtocol.js.map +1 -0
  180. package/dist/node_modules/axios/lib/helpers/progressEventReducer.js +47 -0
  181. package/dist/node_modules/axios/lib/helpers/progressEventReducer.js.map +1 -0
  182. package/dist/node_modules/axios/lib/helpers/readBlob.js +16 -0
  183. package/dist/node_modules/axios/lib/helpers/readBlob.js.map +1 -0
  184. package/dist/node_modules/axios/lib/helpers/resolveConfig.js +63 -0
  185. package/dist/node_modules/axios/lib/helpers/resolveConfig.js.map +1 -0
  186. package/dist/node_modules/axios/lib/helpers/speedometer.js +55 -0
  187. package/dist/node_modules/axios/lib/helpers/speedometer.js.map +1 -0
  188. package/dist/node_modules/axios/lib/helpers/spread.js +30 -0
  189. package/dist/node_modules/axios/lib/helpers/spread.js.map +1 -0
  190. package/dist/node_modules/axios/lib/helpers/throttle.js +45 -0
  191. package/dist/node_modules/axios/lib/helpers/throttle.js.map +1 -0
  192. package/dist/node_modules/axios/lib/helpers/toFormData.js +222 -0
  193. package/dist/node_modules/axios/lib/helpers/toFormData.js.map +1 -0
  194. package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js +21 -0
  195. package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js.map +1 -0
  196. package/dist/node_modules/axios/lib/helpers/trackStream.js +89 -0
  197. package/dist/node_modules/axios/lib/helpers/trackStream.js.map +1 -0
  198. package/dist/node_modules/axios/lib/helpers/validator.js +101 -0
  199. package/dist/node_modules/axios/lib/helpers/validator.js.map +1 -0
  200. package/dist/node_modules/axios/lib/platform/common/utils.js +46 -0
  201. package/dist/node_modules/axios/lib/platform/common/utils.js.map +1 -0
  202. package/dist/node_modules/axios/lib/platform/index.js +10 -0
  203. package/dist/node_modules/axios/lib/platform/index.js.map +1 -0
  204. package/dist/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
  205. package/dist/node_modules/axios/lib/platform/node/classes/FormData.js.map +1 -0
  206. package/dist/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +7 -0
  207. package/dist/node_modules/axios/lib/platform/node/classes/URLSearchParams.js.map +1 -0
  208. package/dist/node_modules/axios/lib/platform/node/index.js +41 -0
  209. package/dist/node_modules/axios/lib/platform/node/index.js.map +1 -0
  210. package/dist/node_modules/axios/lib/utils.js +784 -0
  211. package/dist/node_modules/axios/lib/utils.js.map +1 -0
  212. package/dist/node_modules/debug/src/browser.js +287 -0
  213. package/dist/node_modules/debug/src/browser.js.map +1 -0
  214. package/dist/node_modules/debug/src/common.js +304 -0
  215. package/dist/node_modules/debug/src/common.js.map +1 -0
  216. package/dist/node_modules/debug/src/index.js +24 -0
  217. package/dist/node_modules/debug/src/index.js.map +1 -0
  218. package/dist/node_modules/debug/src/node.js +280 -0
  219. package/dist/node_modules/debug/src/node.js.map +1 -0
  220. package/dist/node_modules/follow-redirects/debug.js +20 -0
  221. package/dist/node_modules/follow-redirects/debug.js.map +1 -0
  222. package/dist/node_modules/follow-redirects/index.js +701 -0
  223. package/dist/node_modules/follow-redirects/index.js.map +1 -0
  224. package/dist/node_modules/immer/dist/immer.js +860 -0
  225. package/dist/node_modules/immer/dist/immer.js.map +1 -0
  226. package/dist/node_modules/proxy-from-env/index.js +112 -0
  227. package/dist/node_modules/proxy-from-env/index.js.map +1 -0
  228. package/dist/node_modules/react-redux/dist/react-redux.js +348 -0
  229. package/dist/node_modules/react-redux/dist/react-redux.js.map +1 -0
  230. package/dist/node_modules/redux/dist/redux.js +362 -0
  231. package/dist/node_modules/redux/dist/redux.js.map +1 -0
  232. package/dist/node_modules/redux-thunk/dist/redux-thunk.js +15 -0
  233. package/dist/node_modules/redux-thunk/dist/redux-thunk.js.map +1 -0
  234. package/dist/node_modules/reselect/dist/reselect.js +322 -0
  235. package/dist/node_modules/reselect/dist/reselect.js.map +1 -0
  236. package/dist/node_modules/server-only/index.js +5 -0
  237. package/dist/node_modules/server-only/index.js.map +1 -0
  238. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +108 -0
  239. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js.map +1 -0
  240. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js +96 -0
  241. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js.map +1 -0
  242. package/dist/node_modules/use-sync-external-store/with-selector.js +14 -0
  243. package/dist/node_modules/use-sync-external-store/with-selector.js.map +1 -0
  244. package/dist/store/StoreProvider.d.ts +7 -0
  245. package/dist/store/StoreProvider.d.ts.map +1 -0
  246. package/dist/store/StoreProvider.js +11 -0
  247. package/dist/store/StoreProvider.js.map +1 -0
  248. package/dist/store/features/drawer/drawer.slice.d.ts +12 -0
  249. package/dist/store/features/drawer/drawer.slice.d.ts.map +1 -0
  250. package/dist/store/features/drawer/drawer.slice.js +26 -0
  251. package/dist/store/features/drawer/drawer.slice.js.map +1 -0
  252. package/dist/store/features/toast/toastSlice.d.ts +16 -0
  253. package/dist/store/features/toast/toastSlice.d.ts.map +1 -0
  254. package/dist/store/features/toast/toastSlice.js +26 -0
  255. package/dist/store/features/toast/toastSlice.js.map +1 -0
  256. package/dist/store/hooks.d.ts +10 -0
  257. package/dist/store/hooks.d.ts.map +1 -0
  258. package/dist/store/hooks.js +8 -0
  259. package/dist/store/hooks.js.map +1 -0
  260. package/dist/store/store.d.ts +16 -0
  261. package/dist/store/store.d.ts.map +1 -0
  262. package/dist/store/store.js +13 -0
  263. package/dist/store/store.js.map +1 -0
  264. package/dist/styles.css +2 -0
  265. package/dist/styles.css.map +1 -0
  266. package/package.json +57 -0
@@ -0,0 +1,784 @@
1
+ 'use strict';
2
+ import bind from './helpers/bind.js';
3
+
4
+ // utils is a library of generic helper functions non-specific to axios
5
+
6
+ const {toString} = Object.prototype;
7
+ const {getPrototypeOf} = Object;
8
+ const {iterator, toStringTag} = Symbol;
9
+
10
+ const kindOf = (cache => thing => {
11
+ const str = toString.call(thing);
12
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
13
+ })(Object.create(null));
14
+
15
+ const kindOfTest = (type) => {
16
+ type = type.toLowerCase();
17
+ return (thing) => kindOf(thing) === type
18
+ };
19
+
20
+ const typeOfTest = type => thing => typeof thing === type;
21
+
22
+ /**
23
+ * Determine if a value is an Array
24
+ *
25
+ * @param {Object} val The value to test
26
+ *
27
+ * @returns {boolean} True if value is an Array, otherwise false
28
+ */
29
+ const {isArray} = Array;
30
+
31
+ /**
32
+ * Determine if a value is undefined
33
+ *
34
+ * @param {*} val The value to test
35
+ *
36
+ * @returns {boolean} True if the value is undefined, otherwise false
37
+ */
38
+ const isUndefined = typeOfTest('undefined');
39
+
40
+ /**
41
+ * Determine if a value is a Buffer
42
+ *
43
+ * @param {*} val The value to test
44
+ *
45
+ * @returns {boolean} True if value is a Buffer, otherwise false
46
+ */
47
+ function isBuffer(val) {
48
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
49
+ && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
50
+ }
51
+
52
+ /**
53
+ * Determine if a value is an ArrayBuffer
54
+ *
55
+ * @param {*} val The value to test
56
+ *
57
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
58
+ */
59
+ const isArrayBuffer = kindOfTest('ArrayBuffer');
60
+
61
+
62
+ /**
63
+ * Determine if a value is a view on an ArrayBuffer
64
+ *
65
+ * @param {*} val The value to test
66
+ *
67
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
68
+ */
69
+ function isArrayBufferView(val) {
70
+ let result;
71
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
72
+ result = ArrayBuffer.isView(val);
73
+ } else {
74
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
75
+ }
76
+ return result;
77
+ }
78
+
79
+ /**
80
+ * Determine if a value is a String
81
+ *
82
+ * @param {*} val The value to test
83
+ *
84
+ * @returns {boolean} True if value is a String, otherwise false
85
+ */
86
+ const isString = typeOfTest('string');
87
+
88
+ /**
89
+ * Determine if a value is a Function
90
+ *
91
+ * @param {*} val The value to test
92
+ * @returns {boolean} True if value is a Function, otherwise false
93
+ */
94
+ const isFunction = typeOfTest('function');
95
+
96
+ /**
97
+ * Determine if a value is a Number
98
+ *
99
+ * @param {*} val The value to test
100
+ *
101
+ * @returns {boolean} True if value is a Number, otherwise false
102
+ */
103
+ const isNumber = typeOfTest('number');
104
+
105
+ /**
106
+ * Determine if a value is an Object
107
+ *
108
+ * @param {*} thing The value to test
109
+ *
110
+ * @returns {boolean} True if value is an Object, otherwise false
111
+ */
112
+ const isObject = (thing) => thing !== null && typeof thing === 'object';
113
+
114
+ /**
115
+ * Determine if a value is a Boolean
116
+ *
117
+ * @param {*} thing The value to test
118
+ * @returns {boolean} True if value is a Boolean, otherwise false
119
+ */
120
+ const isBoolean = thing => thing === true || thing === false;
121
+
122
+ /**
123
+ * Determine if a value is a plain Object
124
+ *
125
+ * @param {*} val The value to test
126
+ *
127
+ * @returns {boolean} True if value is a plain Object, otherwise false
128
+ */
129
+ const isPlainObject = (val) => {
130
+ if (kindOf(val) !== 'object') {
131
+ return false;
132
+ }
133
+
134
+ const prototype = getPrototypeOf(val);
135
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
136
+ };
137
+
138
+ /**
139
+ * Determine if a value is an empty object (safely handles Buffers)
140
+ *
141
+ * @param {*} val The value to test
142
+ *
143
+ * @returns {boolean} True if value is an empty object, otherwise false
144
+ */
145
+ const isEmptyObject = (val) => {
146
+ // Early return for non-objects or Buffers to prevent RangeError
147
+ if (!isObject(val) || isBuffer(val)) {
148
+ return false;
149
+ }
150
+
151
+ try {
152
+ return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
153
+ } catch (e) {
154
+ // Fallback for any other objects that might cause RangeError with Object.keys()
155
+ return false;
156
+ }
157
+ };
158
+
159
+ /**
160
+ * Determine if a value is a Date
161
+ *
162
+ * @param {*} val The value to test
163
+ *
164
+ * @returns {boolean} True if value is a Date, otherwise false
165
+ */
166
+ const isDate = kindOfTest('Date');
167
+
168
+ /**
169
+ * Determine if a value is a File
170
+ *
171
+ * @param {*} val The value to test
172
+ *
173
+ * @returns {boolean} True if value is a File, otherwise false
174
+ */
175
+ const isFile = kindOfTest('File');
176
+
177
+ /**
178
+ * Determine if a value is a Blob
179
+ *
180
+ * @param {*} val The value to test
181
+ *
182
+ * @returns {boolean} True if value is a Blob, otherwise false
183
+ */
184
+ const isBlob = kindOfTest('Blob');
185
+
186
+ /**
187
+ * Determine if a value is a FileList
188
+ *
189
+ * @param {*} val The value to test
190
+ *
191
+ * @returns {boolean} True if value is a File, otherwise false
192
+ */
193
+ const isFileList = kindOfTest('FileList');
194
+
195
+ /**
196
+ * Determine if a value is a Stream
197
+ *
198
+ * @param {*} val The value to test
199
+ *
200
+ * @returns {boolean} True if value is a Stream, otherwise false
201
+ */
202
+ const isStream = (val) => isObject(val) && isFunction(val.pipe);
203
+
204
+ /**
205
+ * Determine if a value is a FormData
206
+ *
207
+ * @param {*} thing The value to test
208
+ *
209
+ * @returns {boolean} True if value is an FormData, otherwise false
210
+ */
211
+ const isFormData = (thing) => {
212
+ let kind;
213
+ return thing && (
214
+ (typeof FormData === 'function' && thing instanceof FormData) || (
215
+ isFunction(thing.append) && (
216
+ (kind = kindOf(thing)) === 'formdata' ||
217
+ // detect form-data instance
218
+ (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
219
+ )
220
+ )
221
+ )
222
+ };
223
+
224
+ /**
225
+ * Determine if a value is a URLSearchParams object
226
+ *
227
+ * @param {*} val The value to test
228
+ *
229
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
230
+ */
231
+ const isURLSearchParams = kindOfTest('URLSearchParams');
232
+
233
+ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
234
+
235
+ /**
236
+ * Trim excess whitespace off the beginning and end of a string
237
+ *
238
+ * @param {String} str The String to trim
239
+ *
240
+ * @returns {String} The String freed of excess whitespace
241
+ */
242
+ const trim = (str) => str.trim ?
243
+ str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
244
+
245
+ /**
246
+ * Iterate over an Array or an Object invoking a function for each item.
247
+ *
248
+ * If `obj` is an Array callback will be called passing
249
+ * the value, index, and complete array for each item.
250
+ *
251
+ * If 'obj' is an Object callback will be called passing
252
+ * the value, key, and complete object for each property.
253
+ *
254
+ * @param {Object|Array} obj The object to iterate
255
+ * @param {Function} fn The callback to invoke for each item
256
+ *
257
+ * @param {Boolean} [allOwnKeys = false]
258
+ * @returns {any}
259
+ */
260
+ function forEach(obj, fn, {allOwnKeys = false} = {}) {
261
+ // Don't bother if no value provided
262
+ if (obj === null || typeof obj === 'undefined') {
263
+ return;
264
+ }
265
+
266
+ let i;
267
+ let l;
268
+
269
+ // Force an array if not already something iterable
270
+ if (typeof obj !== 'object') {
271
+ /*eslint no-param-reassign:0*/
272
+ obj = [obj];
273
+ }
274
+
275
+ if (isArray(obj)) {
276
+ // Iterate over array values
277
+ for (i = 0, l = obj.length; i < l; i++) {
278
+ fn.call(null, obj[i], i, obj);
279
+ }
280
+ } else {
281
+ // Buffer check
282
+ if (isBuffer(obj)) {
283
+ return;
284
+ }
285
+
286
+ // Iterate over object keys
287
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
288
+ const len = keys.length;
289
+ let key;
290
+
291
+ for (i = 0; i < len; i++) {
292
+ key = keys[i];
293
+ fn.call(null, obj[key], key, obj);
294
+ }
295
+ }
296
+ }
297
+
298
+ function findKey(obj, key) {
299
+ if (isBuffer(obj)){
300
+ return null;
301
+ }
302
+
303
+ key = key.toLowerCase();
304
+ const keys = Object.keys(obj);
305
+ let i = keys.length;
306
+ let _key;
307
+ while (i-- > 0) {
308
+ _key = keys[i];
309
+ if (key === _key.toLowerCase()) {
310
+ return _key;
311
+ }
312
+ }
313
+ return null;
314
+ }
315
+
316
+ const _global = (() => {
317
+ /*eslint no-undef:0*/
318
+ if (typeof globalThis !== "undefined") return globalThis;
319
+ return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
320
+ })();
321
+
322
+ const isContextDefined = (context) => !isUndefined(context) && context !== _global;
323
+
324
+ /**
325
+ * Accepts varargs expecting each argument to be an object, then
326
+ * immutably merges the properties of each object and returns result.
327
+ *
328
+ * When multiple objects contain the same key the later object in
329
+ * the arguments list will take precedence.
330
+ *
331
+ * Example:
332
+ *
333
+ * ```js
334
+ * var result = merge({foo: 123}, {foo: 456});
335
+ * console.log(result.foo); // outputs 456
336
+ * ```
337
+ *
338
+ * @param {Object} obj1 Object to merge
339
+ *
340
+ * @returns {Object} Result of all merge properties
341
+ */
342
+ function merge(/* obj1, obj2, obj3, ... */) {
343
+ const {caseless, skipUndefined} = isContextDefined(this) && this || {};
344
+ const result = {};
345
+ const assignValue = (val, key) => {
346
+ const targetKey = caseless && findKey(result, key) || key;
347
+ if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
348
+ result[targetKey] = merge(result[targetKey], val);
349
+ } else if (isPlainObject(val)) {
350
+ result[targetKey] = merge({}, val);
351
+ } else if (isArray(val)) {
352
+ result[targetKey] = val.slice();
353
+ } else if (!skipUndefined || !isUndefined(val)) {
354
+ result[targetKey] = val;
355
+ }
356
+ };
357
+
358
+ for (let i = 0, l = arguments.length; i < l; i++) {
359
+ arguments[i] && forEach(arguments[i], assignValue);
360
+ }
361
+ return result;
362
+ }
363
+
364
+ /**
365
+ * Extends object a by mutably adding to it the properties of object b.
366
+ *
367
+ * @param {Object} a The object to be extended
368
+ * @param {Object} b The object to copy properties from
369
+ * @param {Object} thisArg The object to bind function to
370
+ *
371
+ * @param {Boolean} [allOwnKeys]
372
+ * @returns {Object} The resulting value of object a
373
+ */
374
+ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
375
+ forEach(b, (val, key) => {
376
+ if (thisArg && isFunction(val)) {
377
+ a[key] = bind(val, thisArg);
378
+ } else {
379
+ a[key] = val;
380
+ }
381
+ }, {allOwnKeys});
382
+ return a;
383
+ };
384
+
385
+ /**
386
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
387
+ *
388
+ * @param {string} content with BOM
389
+ *
390
+ * @returns {string} content value without BOM
391
+ */
392
+ const stripBOM = (content) => {
393
+ if (content.charCodeAt(0) === 0xFEFF) {
394
+ content = content.slice(1);
395
+ }
396
+ return content;
397
+ };
398
+
399
+ /**
400
+ * Inherit the prototype methods from one constructor into another
401
+ * @param {function} constructor
402
+ * @param {function} superConstructor
403
+ * @param {object} [props]
404
+ * @param {object} [descriptors]
405
+ *
406
+ * @returns {void}
407
+ */
408
+ const inherits = (constructor, superConstructor, props, descriptors) => {
409
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
410
+ constructor.prototype.constructor = constructor;
411
+ Object.defineProperty(constructor, 'super', {
412
+ value: superConstructor.prototype
413
+ });
414
+ props && Object.assign(constructor.prototype, props);
415
+ };
416
+
417
+ /**
418
+ * Resolve object with deep prototype chain to a flat object
419
+ * @param {Object} sourceObj source object
420
+ * @param {Object} [destObj]
421
+ * @param {Function|Boolean} [filter]
422
+ * @param {Function} [propFilter]
423
+ *
424
+ * @returns {Object}
425
+ */
426
+ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
427
+ let props;
428
+ let i;
429
+ let prop;
430
+ const merged = {};
431
+
432
+ destObj = destObj || {};
433
+ // eslint-disable-next-line no-eq-null,eqeqeq
434
+ if (sourceObj == null) return destObj;
435
+
436
+ do {
437
+ props = Object.getOwnPropertyNames(sourceObj);
438
+ i = props.length;
439
+ while (i-- > 0) {
440
+ prop = props[i];
441
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
442
+ destObj[prop] = sourceObj[prop];
443
+ merged[prop] = true;
444
+ }
445
+ }
446
+ sourceObj = filter !== false && getPrototypeOf(sourceObj);
447
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
448
+
449
+ return destObj;
450
+ };
451
+
452
+ /**
453
+ * Determines whether a string ends with the characters of a specified string
454
+ *
455
+ * @param {String} str
456
+ * @param {String} searchString
457
+ * @param {Number} [position= 0]
458
+ *
459
+ * @returns {boolean}
460
+ */
461
+ const endsWith = (str, searchString, position) => {
462
+ str = String(str);
463
+ if (position === undefined || position > str.length) {
464
+ position = str.length;
465
+ }
466
+ position -= searchString.length;
467
+ const lastIndex = str.indexOf(searchString, position);
468
+ return lastIndex !== -1 && lastIndex === position;
469
+ };
470
+
471
+
472
+ /**
473
+ * Returns new array from array like object or null if failed
474
+ *
475
+ * @param {*} [thing]
476
+ *
477
+ * @returns {?Array}
478
+ */
479
+ const toArray = (thing) => {
480
+ if (!thing) return null;
481
+ if (isArray(thing)) return thing;
482
+ let i = thing.length;
483
+ if (!isNumber(i)) return null;
484
+ const arr = new Array(i);
485
+ while (i-- > 0) {
486
+ arr[i] = thing[i];
487
+ }
488
+ return arr;
489
+ };
490
+
491
+ /**
492
+ * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
493
+ * thing passed in is an instance of Uint8Array
494
+ *
495
+ * @param {TypedArray}
496
+ *
497
+ * @returns {Array}
498
+ */
499
+ // eslint-disable-next-line func-names
500
+ const isTypedArray = (TypedArray => {
501
+ // eslint-disable-next-line func-names
502
+ return thing => {
503
+ return TypedArray && thing instanceof TypedArray;
504
+ };
505
+ })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
506
+
507
+ /**
508
+ * For each entry in the object, call the function with the key and value.
509
+ *
510
+ * @param {Object<any, any>} obj - The object to iterate over.
511
+ * @param {Function} fn - The function to call for each entry.
512
+ *
513
+ * @returns {void}
514
+ */
515
+ const forEachEntry = (obj, fn) => {
516
+ const generator = obj && obj[iterator];
517
+
518
+ const _iterator = generator.call(obj);
519
+
520
+ let result;
521
+
522
+ while ((result = _iterator.next()) && !result.done) {
523
+ const pair = result.value;
524
+ fn.call(obj, pair[0], pair[1]);
525
+ }
526
+ };
527
+
528
+ /**
529
+ * It takes a regular expression and a string, and returns an array of all the matches
530
+ *
531
+ * @param {string} regExp - The regular expression to match against.
532
+ * @param {string} str - The string to search.
533
+ *
534
+ * @returns {Array<boolean>}
535
+ */
536
+ const matchAll = (regExp, str) => {
537
+ let matches;
538
+ const arr = [];
539
+
540
+ while ((matches = regExp.exec(str)) !== null) {
541
+ arr.push(matches);
542
+ }
543
+
544
+ return arr;
545
+ };
546
+
547
+ /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
548
+ const isHTMLForm = kindOfTest('HTMLFormElement');
549
+
550
+ const toCamelCase = str => {
551
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
552
+ function replacer(m, p1, p2) {
553
+ return p1.toUpperCase() + p2;
554
+ }
555
+ );
556
+ };
557
+
558
+ /* Creating a function that will check if an object has a property. */
559
+ const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
560
+
561
+ /**
562
+ * Determine if a value is a RegExp object
563
+ *
564
+ * @param {*} val The value to test
565
+ *
566
+ * @returns {boolean} True if value is a RegExp object, otherwise false
567
+ */
568
+ const isRegExp = kindOfTest('RegExp');
569
+
570
+ const reduceDescriptors = (obj, reducer) => {
571
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
572
+ const reducedDescriptors = {};
573
+
574
+ forEach(descriptors, (descriptor, name) => {
575
+ let ret;
576
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
577
+ reducedDescriptors[name] = ret || descriptor;
578
+ }
579
+ });
580
+
581
+ Object.defineProperties(obj, reducedDescriptors);
582
+ };
583
+
584
+ /**
585
+ * Makes all methods read-only
586
+ * @param {Object} obj
587
+ */
588
+
589
+ const freezeMethods = (obj) => {
590
+ reduceDescriptors(obj, (descriptor, name) => {
591
+ // skip restricted props in strict mode
592
+ if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
593
+ return false;
594
+ }
595
+
596
+ const value = obj[name];
597
+
598
+ if (!isFunction(value)) return;
599
+
600
+ descriptor.enumerable = false;
601
+
602
+ if ('writable' in descriptor) {
603
+ descriptor.writable = false;
604
+ return;
605
+ }
606
+
607
+ if (!descriptor.set) {
608
+ descriptor.set = () => {
609
+ throw Error('Can not rewrite read-only method \'' + name + '\'');
610
+ };
611
+ }
612
+ });
613
+ };
614
+
615
+ const toObjectSet = (arrayOrString, delimiter) => {
616
+ const obj = {};
617
+
618
+ const define = (arr) => {
619
+ arr.forEach(value => {
620
+ obj[value] = true;
621
+ });
622
+ };
623
+
624
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
625
+
626
+ return obj;
627
+ };
628
+
629
+ const noop = () => {};
630
+
631
+ const toFiniteNumber = (value, defaultValue) => {
632
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
633
+ };
634
+
635
+
636
+
637
+ /**
638
+ * If the thing is a FormData object, return true, otherwise return false.
639
+ *
640
+ * @param {unknown} thing - The thing to check.
641
+ *
642
+ * @returns {boolean}
643
+ */
644
+ function isSpecCompliantForm(thing) {
645
+ return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
646
+ }
647
+
648
+ const toJSONObject = (obj) => {
649
+ const stack = new Array(10);
650
+
651
+ const visit = (source, i) => {
652
+
653
+ if (isObject(source)) {
654
+ if (stack.indexOf(source) >= 0) {
655
+ return;
656
+ }
657
+
658
+ //Buffer check
659
+ if (isBuffer(source)) {
660
+ return source;
661
+ }
662
+
663
+ if(!('toJSON' in source)) {
664
+ stack[i] = source;
665
+ const target = isArray(source) ? [] : {};
666
+
667
+ forEach(source, (value, key) => {
668
+ const reducedValue = visit(value, i + 1);
669
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
670
+ });
671
+
672
+ stack[i] = undefined;
673
+
674
+ return target;
675
+ }
676
+ }
677
+
678
+ return source;
679
+ };
680
+
681
+ return visit(obj, 0);
682
+ };
683
+
684
+ const isAsyncFn = kindOfTest('AsyncFunction');
685
+
686
+ const isThenable = (thing) =>
687
+ thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
688
+
689
+ // original code
690
+ // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
691
+
692
+ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
693
+ if (setImmediateSupported) {
694
+ return setImmediate;
695
+ }
696
+
697
+ return postMessageSupported ? ((token, callbacks) => {
698
+ _global.addEventListener("message", ({source, data}) => {
699
+ if (source === _global && data === token) {
700
+ callbacks.length && callbacks.shift()();
701
+ }
702
+ }, false);
703
+
704
+ return (cb) => {
705
+ callbacks.push(cb);
706
+ _global.postMessage(token, "*");
707
+ }
708
+ })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
709
+ })(
710
+ typeof setImmediate === 'function',
711
+ isFunction(_global.postMessage)
712
+ );
713
+
714
+ const asap = typeof queueMicrotask !== 'undefined' ?
715
+ queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);
716
+
717
+ // *********************
718
+
719
+
720
+ const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
721
+
722
+
723
+ var utils = {
724
+ isArray,
725
+ isArrayBuffer,
726
+ isBuffer,
727
+ isFormData,
728
+ isArrayBufferView,
729
+ isString,
730
+ isNumber,
731
+ isBoolean,
732
+ isObject,
733
+ isPlainObject,
734
+ isEmptyObject,
735
+ isReadableStream,
736
+ isRequest,
737
+ isResponse,
738
+ isHeaders,
739
+ isUndefined,
740
+ isDate,
741
+ isFile,
742
+ isBlob,
743
+ isRegExp,
744
+ isFunction,
745
+ isStream,
746
+ isURLSearchParams,
747
+ isTypedArray,
748
+ isFileList,
749
+ forEach,
750
+ merge,
751
+ extend,
752
+ trim,
753
+ stripBOM,
754
+ inherits,
755
+ toFlatObject,
756
+ kindOf,
757
+ kindOfTest,
758
+ endsWith,
759
+ toArray,
760
+ forEachEntry,
761
+ matchAll,
762
+ isHTMLForm,
763
+ hasOwnProperty,
764
+ hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
765
+ reduceDescriptors,
766
+ freezeMethods,
767
+ toObjectSet,
768
+ toCamelCase,
769
+ noop,
770
+ toFiniteNumber,
771
+ findKey,
772
+ global: _global,
773
+ isContextDefined,
774
+ isSpecCompliantForm,
775
+ toJSONObject,
776
+ isAsyncFn,
777
+ isThenable,
778
+ setImmediate: _setImmediate,
779
+ asap,
780
+ isIterable
781
+ };
782
+
783
+ export { utils as default };
784
+ //# sourceMappingURL=utils.js.map