extra-request 2.3.1 → 3.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/CHANGELOG.md +233 -0
- package/LICENSE +1 -1
- package/dist/es2015/index.min.mjs +2 -2
- package/dist/es2015/index.min.mjs.map +1 -1
- package/dist/es2015/index.mjs +48 -63
- package/dist/es2015/index.mjs.map +1 -1
- package/dist/es2015/index.umd.js +50 -65
- package/dist/es2015/index.umd.js.map +1 -1
- package/dist/es2015/index.umd.min.js +2 -2
- package/dist/es2015/index.umd.min.js.map +1 -1
- package/dist/es2018/index.min.mjs +2 -2
- package/dist/es2018/index.min.mjs.map +1 -1
- package/dist/es2018/index.mjs +48 -63
- package/dist/es2018/index.mjs.map +1 -1
- package/dist/es2018/index.umd.js +50 -65
- package/dist/es2018/index.umd.js.map +1 -1
- package/dist/es2018/index.umd.min.js +2 -2
- package/dist/es2018/index.umd.min.js.map +1 -1
- package/lib/es2015/request.js +1 -1
- package/lib/es2015/request.js.map +1 -1
- package/lib/es2015/transformers/accept.js +1 -1
- package/lib/es2015/transformers/accept.js.map +1 -1
- package/lib/es2015/transformers/basic-auth.js +1 -1
- package/lib/es2015/transformers/basic-auth.js.map +1 -1
- package/lib/es2015/transformers/bearer-auth.js +1 -1
- package/lib/es2015/transformers/bearer-auth.js.map +1 -1
- package/lib/es2015/transformers/csv.js +2 -2
- package/lib/es2015/transformers/csv.js.map +1 -1
- package/lib/es2015/transformers/form-data-field.js +2 -1
- package/lib/es2015/transformers/form-data-field.js.map +1 -1
- package/lib/es2018/request.js +1 -1
- package/lib/es2018/request.js.map +1 -1
- package/lib/es2018/transformers/accept.js +1 -1
- package/lib/es2018/transformers/accept.js.map +1 -1
- package/lib/es2018/transformers/basic-auth.js +1 -1
- package/lib/es2018/transformers/basic-auth.js.map +1 -1
- package/lib/es2018/transformers/bearer-auth.js +1 -1
- package/lib/es2018/transformers/bearer-auth.js.map +1 -1
- package/lib/es2018/transformers/csv.js +2 -2
- package/lib/es2018/transformers/csv.js.map +1 -1
- package/lib/es2018/transformers/form-data-field.js +2 -1
- package/lib/es2018/transformers/form-data-field.js.map +1 -1
- package/package.json +30 -23
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
### [3.0.3](https://github.com/BlackGlory/extra-request/compare/v3.0.2...v3.0.3) (2021-12-12)
|
|
6
|
+
|
|
7
|
+
### [3.0.2](https://github.com/BlackGlory/extra-request/compare/v3.0.1...v3.0.2) (2021-10-14)
|
|
8
|
+
|
|
9
|
+
### [3.0.1](https://github.com/BlackGlory/extra-request/compare/v3.0.0...v3.0.1) (2021-09-16)
|
|
10
|
+
|
|
11
|
+
## [3.0.0](https://github.com/BlackGlory/extra-request/compare/v2.3.1...v3.0.0) (2021-08-28)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### ⚠ BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* add `exports` field
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* add `exports` field ([a342b4a](https://github.com/BlackGlory/extra-request/commit/a342b4aea418c573a2fa61261e8afd8fee62fe21))
|
|
21
|
+
|
|
22
|
+
### [2.3.1](https://github.com/BlackGlory/extra-request/compare/v2.3.0...v2.3.1) (2021-08-28)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* remove `exports` field ([4d74e4c](https://github.com/BlackGlory/extra-request/commit/4d74e4c4b3b3ad51784d4eadc0c6dbefe2a86087))
|
|
28
|
+
|
|
29
|
+
## [2.3.0](https://github.com/BlackGlory/extra-request/compare/v2.2.0...v2.3.0) (2021-08-26)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Features
|
|
33
|
+
|
|
34
|
+
* add bearerAuth ([dedacf0](https://github.com/BlackGlory/extra-request/commit/dedacf0441173bac3d42ca3de0389d83c89bdb87))
|
|
35
|
+
|
|
36
|
+
## [2.2.0](https://github.com/BlackGlory/extra-request/compare/v2.1.5...v2.2.0) (2021-08-26)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Features
|
|
40
|
+
|
|
41
|
+
* transformers related to SearchParams support numbers as values ([ea53da0](https://github.com/BlackGlory/extra-request/commit/ea53da08567d0c01ad60d1cbade3df1860a0da7b))
|
|
42
|
+
|
|
43
|
+
### [2.1.5](https://github.com/BlackGlory/extra-request/compare/v2.1.4...v2.1.5) (2021-07-03)
|
|
44
|
+
|
|
45
|
+
### [2.1.4](https://github.com/BlackGlory/extra-request/compare/v2.1.3...v2.1.4) (2021-04-27)
|
|
46
|
+
|
|
47
|
+
### [2.1.3](https://github.com/BlackGlory/extra-request/compare/v2.1.2...v2.1.3) (2021-03-28)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Bug Fixes
|
|
51
|
+
|
|
52
|
+
* keepalive ([0c6339b](https://github.com/BlackGlory/extra-request/commit/0c6339be8739e5ae7f6f06357f362490e27a2389))
|
|
53
|
+
|
|
54
|
+
### [2.1.2](https://github.com/BlackGlory/extra-request/compare/v2.1.1...v2.1.2) (2021-03-17)
|
|
55
|
+
|
|
56
|
+
### [2.1.1](https://github.com/BlackGlory/extra-request/compare/v2.1.0...v2.1.1) (2021-03-17)
|
|
57
|
+
|
|
58
|
+
## [2.1.0](https://github.com/BlackGlory/extra-request/compare/v2.0.0...v2.1.0) (2021-03-10)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Features
|
|
62
|
+
|
|
63
|
+
* add keepalive ([b2921eb](https://github.com/BlackGlory/extra-request/commit/b2921eb756398499f557b13e21040a7660c44f2a))
|
|
64
|
+
|
|
65
|
+
## [2.0.0](https://github.com/BlackGlory/extra-request/compare/v1.1.7...v2.0.0) (2021-03-10)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### ⚠ BREAKING CHANGES
|
|
69
|
+
|
|
70
|
+
* Rename `header` to `appendHeader`
|
|
71
|
+
Rename `searchParam` to `appendSearchParam`
|
|
72
|
+
Add `header`(use `Headers.set`)
|
|
73
|
+
Add `searchParam`(use `URLSearchParams.set`)
|
|
74
|
+
`headers` use `Headers.set` now
|
|
75
|
+
`searchParams` use `URLSearchParams.set` now
|
|
76
|
+
|
|
77
|
+
### Features
|
|
78
|
+
|
|
79
|
+
* rewrite transformers ([be67b38](https://github.com/BlackGlory/extra-request/commit/be67b383adceb1ed7211fd8abd531330d119e673))
|
|
80
|
+
|
|
81
|
+
### [1.1.7](https://github.com/BlackGlory/extra-request/compare/v1.1.6...v1.1.7) (2021-03-05)
|
|
82
|
+
|
|
83
|
+
### [1.1.6](https://github.com/BlackGlory/extra-request/compare/v1.1.5...v1.1.6) (2021-03-05)
|
|
84
|
+
|
|
85
|
+
### [1.1.5](https://github.com/BlackGlory/extra-request/compare/v1.1.4...v1.1.5) (2021-03-05)
|
|
86
|
+
|
|
87
|
+
### [1.1.4](https://github.com/BlackGlory/extra-request/compare/v1.1.3...v1.1.4) (2021-03-05)
|
|
88
|
+
|
|
89
|
+
### [1.1.3](https://github.com/BlackGlory/extra-request/compare/v1.1.2...v1.1.3) (2021-03-05)
|
|
90
|
+
|
|
91
|
+
### [1.1.2](https://github.com/BlackGlory/extra-request/compare/v1.1.1...v1.1.2) (2021-03-04)
|
|
92
|
+
|
|
93
|
+
### [1.1.1](https://github.com/BlackGlory/extra-request/compare/v1.1.0...v1.1.1) (2021-02-25)
|
|
94
|
+
|
|
95
|
+
## [1.1.0](https://github.com/BlackGlory/extra-request/compare/v1.0.2...v1.1.0) (2021-02-19)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
### Features
|
|
99
|
+
|
|
100
|
+
* add port ([9423054](https://github.com/BlackGlory/extra-request/commit/94230548e9a2db10667c38d582e775954ad41c4d))
|
|
101
|
+
|
|
102
|
+
### [1.0.2](https://github.com/BlackGlory/extra-request/compare/v1.0.1...v1.0.2) (2021-02-04)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
### Bug Fixes
|
|
106
|
+
|
|
107
|
+
* bundle ([225be5b](https://github.com/BlackGlory/extra-request/commit/225be5b1b1badbe72abf255f22c3c0b5ca6d6a09))
|
|
108
|
+
|
|
109
|
+
### [1.0.1](https://github.com/BlackGlory/extra-request/compare/v1.0.0...v1.0.1) (2021-02-03)
|
|
110
|
+
|
|
111
|
+
## [1.0.0](https://github.com/BlackGlory/extra-request/compare/v0.3.5...v1.0.0) (2021-02-02)
|
|
112
|
+
|
|
113
|
+
### [0.3.5](https://github.com/BlackGlory/extra-request/compare/v0.3.4...v0.3.5) (2021-01-21)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### Features
|
|
117
|
+
|
|
118
|
+
* add basicAuth ([c0f25c6](https://github.com/BlackGlory/extra-request/commit/c0f25c6f68177d4da8efc8cc76ff84ff9caf78d2))
|
|
119
|
+
|
|
120
|
+
### [0.3.4](https://github.com/BlackGlory/extra-request/compare/v0.3.3...v0.3.4) (2021-01-20)
|
|
121
|
+
|
|
122
|
+
### [0.3.3](https://github.com/BlackGlory/extra-request/compare/v0.3.2...v0.3.3) (2021-01-20)
|
|
123
|
+
|
|
124
|
+
### [0.3.2](https://github.com/BlackGlory/extra-request/compare/v0.3.1...v0.3.2) (2021-01-15)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### Bug Fixes
|
|
128
|
+
|
|
129
|
+
* esm bundle ([7d0dc35](https://github.com/BlackGlory/extra-request/commit/7d0dc356d67c5ed6f95766efbe500d3cb6c0de5f))
|
|
130
|
+
|
|
131
|
+
### [0.3.1](https://github.com/BlackGlory/extra-request/compare/v0.3.0...v0.3.1) (2021-01-14)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
### Features
|
|
135
|
+
|
|
136
|
+
* add csv ([38e8659](https://github.com/BlackGlory/extra-request/commit/38e86595df9007d368de58ec117714014ad10c6a))
|
|
137
|
+
|
|
138
|
+
## [0.3.0](https://github.com/BlackGlory/extra-request/compare/v0.2.11...v0.3.0) (2021-01-08)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
### ⚠ BREAKING CHANGES
|
|
142
|
+
|
|
143
|
+
* formDataField(name: string, value: string | string[] | Blob |
|
|
144
|
+
ReadableStream | NodeJS.ReadableStream) => formDataField(name:
|
|
145
|
+
string, value: string | string[] | Blob)
|
|
146
|
+
|
|
147
|
+
### Features
|
|
148
|
+
|
|
149
|
+
* remove support for stream in FormData ([cb3d694](https://github.com/BlackGlory/extra-request/commit/cb3d69496e9e70f8860bd724615e0a0d7bd2ef88))
|
|
150
|
+
|
|
151
|
+
### [0.2.11](https://github.com/BlackGlory/extra-request/compare/v0.2.10...v0.2.11) (2021-01-08)
|
|
152
|
+
|
|
153
|
+
### [0.2.10](https://github.com/BlackGlory/extra-request/compare/v0.2.9...v0.2.10) (2021-01-07)
|
|
154
|
+
|
|
155
|
+
### [0.2.9](https://github.com/BlackGlory/extra-request/compare/v0.2.8...v0.2.9) (2021-01-07)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
### Features
|
|
159
|
+
|
|
160
|
+
* replace cross-fetch with extra-fetch ([c4df002](https://github.com/BlackGlory/extra-request/commit/c4df0022fb45f805f05be8cf2efecad95dd81709))
|
|
161
|
+
|
|
162
|
+
### [0.2.8](https://github.com/BlackGlory/extra-request/compare/v0.2.7...v0.2.8) (2021-01-07)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
### Bug Fixes
|
|
166
|
+
|
|
167
|
+
* bundle ([6d89860](https://github.com/BlackGlory/extra-request/commit/6d898602e1e13b2bea45c08bf807d0b8e7afc24f))
|
|
168
|
+
|
|
169
|
+
### [0.2.7](https://github.com/BlackGlory/extra-request/compare/v0.2.6...v0.2.7) (2021-01-07)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
### Features
|
|
173
|
+
|
|
174
|
+
* support array ([c9635a6](https://github.com/BlackGlory/extra-request/commit/c9635a6dd444aee0924fd01c0c90cdc8196028e4))
|
|
175
|
+
|
|
176
|
+
### [0.2.6](https://github.com/BlackGlory/extra-request/compare/v0.2.5...v0.2.6) (2021-01-07)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
### Features
|
|
180
|
+
|
|
181
|
+
* add formDataField ([ac81904](https://github.com/BlackGlory/extra-request/commit/ac819041eaa7d6c13b315b926fe650f8bd9aa9c0))
|
|
182
|
+
|
|
183
|
+
### [0.2.5](https://github.com/BlackGlory/extra-request/compare/v0.2.4...v0.2.5) (2021-01-04)
|
|
184
|
+
|
|
185
|
+
### [0.2.4](https://github.com/BlackGlory/extra-request/compare/v0.2.3...v0.2.4) (2021-01-04)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
### Bug Fixes
|
|
189
|
+
|
|
190
|
+
* bundle for browser ([532fdf0](https://github.com/BlackGlory/extra-request/commit/532fdf0c19bd2c7cfab5b5dd7b368bce48c75659))
|
|
191
|
+
|
|
192
|
+
### [0.2.3](https://github.com/BlackGlory/extra-request/compare/v0.2.2...v0.2.3) (2020-12-23)
|
|
193
|
+
|
|
194
|
+
### [0.2.2](https://github.com/BlackGlory/extra-request/compare/v0.2.1...v0.2.2) (2020-12-22)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
### Bug Fixes
|
|
198
|
+
|
|
199
|
+
* bundle ([4f0984a](https://github.com/BlackGlory/extra-request/commit/4f0984abaec413eb61b521992316c2444975e59c))
|
|
200
|
+
|
|
201
|
+
### [0.2.1](https://github.com/BlackGlory/extra-request/compare/v0.2.0...v0.2.1) (2020-12-22)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
### Features
|
|
205
|
+
|
|
206
|
+
* replace Json with any ([500aa24](https://github.com/BlackGlory/extra-request/commit/500aa24d04c6ad248e89434cfbbc4745ce0f9671))
|
|
207
|
+
|
|
208
|
+
## [0.2.0](https://github.com/BlackGlory/extra-request/compare/v0.1.1...v0.2.0) (2020-12-05)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
### ⚠ BREAKING CHANGES
|
|
212
|
+
|
|
213
|
+
* searchParams becomes append only
|
|
214
|
+
|
|
215
|
+
### Features
|
|
216
|
+
|
|
217
|
+
* add accept ([be3a5ae](https://github.com/BlackGlory/extra-request/commit/be3a5aed6a435d2942883341f5d6d95c98105ed9))
|
|
218
|
+
* add searchParam ([b8bc0e9](https://github.com/BlackGlory/extra-request/commit/b8bc0e901648810219b68e10b8a2b2af924466e4))
|
|
219
|
+
* modify searchParams ([12d538a](https://github.com/BlackGlory/extra-request/commit/12d538a39a86558cef0c041a36c8657d73a51d37))
|
|
220
|
+
|
|
221
|
+
### [0.1.1](https://github.com/BlackGlory/extra-request/compare/v0.1.0...v0.1.1) (2020-12-04)
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
### Features
|
|
225
|
+
|
|
226
|
+
* support Falsy ([e9f923d](https://github.com/BlackGlory/extra-request/commit/e9f923d4b1718c2c610b751040e1e3a04453462a))
|
|
227
|
+
|
|
228
|
+
## 0.1.0 (2020-12-03)
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
### Features
|
|
232
|
+
|
|
233
|
+
* init ([62bba21](https://github.com/BlackGlory/extra-request/commit/62bba214f6ce2a9db34ab29e39378addadb0ce1f))
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2020 BlackGlory <woshenmedoubuzhidao@blackglory.me>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t={},n={fetch:void 0};n.fetch=globalThis.fetch.bind(globalThis);var r={Headers:void 0};r.Headers=globalThis.Headers;var i={Request:void 0};i.Request=globalThis.Request;var s={Response:void 0};s.Response=globalThis.Response;var o={FormData:void 0};o.FormData=globalThis.FormData;var a={AbortController:void 0};a.AbortController=globalThis.AbortController;var u={
|
|
1
|
+
var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t={},n={fetch:void 0};n.fetch=globalThis.fetch.bind(globalThis);var r={Headers:void 0};r.Headers=globalThis.Headers;var i={Request:void 0};i.Request=globalThis.Request;var s={Response:void 0};s.Response=globalThis.Response;var o={FormData:void 0};o.FormData=globalThis.FormData;var a={AbortController:void 0};a.AbortController=globalThis.AbortController;var u={AbortError:void 0};u.AbortError=globalThis.DOMException;var c={Blob:void 0};c.Blob=globalThis.Blob;var f,h,d,l={};l.EventSource=void 0,l.EventSource=globalThis.EventSource,f=t,h=e&&e.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),(d=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||h(t,e,n)})(n,f),d(r,f),d(i,f),d(s,f),d(o,f),d(a,f),d(u,f),d(c,f),d(l,f);var p={},g={};function m(e){return Array.isArray(e)}g.isntEmptyArray=g.isEmptyArray=g.isntArray=g.isArray=void 0,g.isArray=m,g.isntArray=function(e){return!m(e)},g.isEmptyArray=function(e){return 0===e.length},g.isntEmptyArray=function(e){return 0!==e.length};var y={},v={};function _(e){return null===e}v.isntNull=v.isNull=void 0,v.isNull=_,v.isntNull=function(e){return!_(e)};var b={};function E(e){return void 0===e}b.isntUndefined=b.isUndefined=void 0,b.isUndefined=E,b.isntUndefined=function(e){return!E(e)},y.isntAsyncIterable=y.isAsyncIterable=void 0;const O=v,w=b;function R(e){return(0,O.isntNull)(e)&&(0,w.isntUndefined)(e)&&"function"==typeof e[Symbol.asyncIterator]}y.isAsyncIterable=R,y.isntAsyncIterable=function(e){return!R(e)};var k={};function S(e){return"bigint"==typeof e}k.isntBigInt=k.isBigInt=void 0,k.isBigInt=S,k.isntBigInt=function(e){return!S(e)};var C={};function j(e){return"boolean"==typeof e}C.isntBoolean=C.isBoolean=void 0,C.isBoolean=j,C.isntBoolean=function(e){return!j(e)};var A={},x={};function T(e){return"string"==typeof e}x.isntString=x.isString=void 0,x.isString=T,x.isntString=function(e){return!T(e)},A.isntChar=A.isChar=void 0;const D=x;function I(e){return(0,D.isString)(e)&&1===e.length}A.isChar=I,A.isntChar=function(e){return!I(e)};var L={};function U(e){return e instanceof Date}L.isntDate=L.isDate=void 0,L.isDate=U,L.isntDate=function(e){return!U(e)};var F={};F.inEnum=void 0,F.inEnum=function(e,t){return Object.values(t).includes(e)};var N={};function B(e){return e instanceof Error}N.isntError=N.isError=void 0,N.isError=B,N.isntError=function(e){return!B(e)};var P={};function z(e){return!e}P.isntFalsy=P.isFalsy=void 0,P.isFalsy=z,P.isntFalsy=function(e){return!z(e)};var J={};function q(e){return"function"==typeof e}J.isntFunction=J.isFunction=void 0,J.isFunction=q,J.isntFunction=function(e){return!q(e)};var M={};M.isntIterable=M.isIterable=void 0;const H=v,K=b;function W(e){return(0,H.isntNull)(e)&&(0,K.isntUndefined)(e)&&"function"==typeof e[Symbol.iterator]}M.isIterable=W,M.isntIterable=function(e){return!W(e)};var Q={},$={};function G(e){return null!==e&&"object"==typeof e}$.isntEmptyObject=$.isEmptyObject=$.isRecord=$.isntObject=$.isObject=void 0,$.isObject=G,$.isntObject=function(e){return!G(e)},$.isRecord=function(e){return G(e)},$.isEmptyObject=function(e){return 0===Object.keys(e).length},$.isntEmptyObject=function(e){return 0!==Object.keys(e).length};var Z={};function Y(e){return"number"==typeof e}Z.isntNumber=Z.isNumber=void 0,Z.isNumber=Y,Z.isntNumber=function(e){return!Y(e)},Q.isntJsonRpcError=Q.isJsonRpcError=Q.isntJsonRpcSuccess=Q.isJsonRpcSuccess=Q.isntJsonRpcRequest=Q.isJsonRpcRequest=Q.isntJsonRpcNotification=Q.isJsonRpcNotification=void 0;const X=g,V=$,ee=x,te=Z,ne=b;function re(e){return(0,ee.isString)(e)||(0,te.isNumber)(e)}function ie(e){return(0,X.isArray)(e)||(0,V.isObject)(e)}function se(e){return(0,V.isRecord)(e)&&(0,ee.isString)(e.jsonrpc)&&(0,ee.isString)(e.method)&&(0,ne.isUndefined)(e.id)&&ie(e.params)}function oe(e){return(0,V.isRecord)(e)&&(0,ee.isString)(e.jsonrpc)&&(0,ee.isString)(e.method)&&re(e.id)&&ie(e.params)}function ae(e){return(0,V.isRecord)(e)&&(0,ee.isString)(e.jsonrpc)&&(0,ee.isString)(e.id)&&"result"in e}function ue(e){return(0,V.isRecord)(e)&&(0,ee.isString)(e.jsonrpc)&&re(e.id)&&function(e){return(0,V.isRecord)(e)&&(0,te.isNumber)(e.code)&&(0,ee.isString)(e.message)&&((0,ne.isUndefined)(e.data)||(0,V.isObject)(e.data))}(e.error)}Q.isJsonRpcNotification=se,Q.isntJsonRpcNotification=function(e){return!se(e)},Q.isJsonRpcRequest=oe,Q.isntJsonRpcRequest=function(e){return!oe(e)},Q.isJsonRpcSuccess=ae,Q.isntJsonRpcSuccess=function(e){return!ae(e)},Q.isJsonRpcError=ue,Q.isntJsonRpcError=function(e){return!ue(e)};var ce={};ce.isntJson=ce.isJson=void 0,ce.isJson=function(e){try{return JSON.stringify(e),!0}catch(e){return!1}},ce.isntJson=function e(t){return!e()};var fe={};function he(...e){return ye("GET",...e)}function de(...e){return ye("HEAD",...e)}function le(...e){return ye("POST",...e)}function pe(...e){return ye("PUT",...e)}function ge(...e){return ye("PATCH",...e)}function me(...e){return ye("DELETE",...e)}function ye(e,...n){const r=n.reduce(((e,t)=>p.isFunction(t)?t(e):e),{url:new URL("http://localhost"),headers:new t.Headers}),i=new t.Headers(r.headers);return new t.Request(r.url.href,{method:e,headers:i,signal:r.signal,body:r.payload,keepalive:r.keepalive})}function ve(...e){return t=>{const n=new URL(e.reduce(((e,t)=>new URL(t,e).href)));return Object.assign(Object.assign({},t),{url:n})}}function _e(e){return n=>{const r=new t.Headers(n.headers);return r.set("Content-Type","application/x-www-form-urlencoded"),Object.assign(Object.assign({},n),{headers:r,payload:e})}}function be(e){return n=>{const r=new t.Headers(n.headers);return r.set("Content-Type","application/json"),Object.assign(Object.assign({},n),{headers:r,payload:JSON.stringify(e)})}}fe.isAbsoluteURL=void 0,fe.isAbsoluteURL=function(e){try{return new URL(e),!0}catch(e){return!1}},function(t){var n=e&&e.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=e&&e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};r(g,t),r(y,t),r(k,t),r(C,t),r(A,t),r(L,t),r(F,t),r(N,t),r(P,t),r(J,t),r(M,t),r(Q,t),r(ce,t),r(v,t),r(Z,t),r($,t),r(x,t),r(b,t),r(fe,t)}(p);var Ee={exports:{}};
|
|
2
2
|
/* @license
|
|
3
3
|
Papa Parse
|
|
4
4
|
v5.3.1
|
|
5
5
|
https://github.com/mholt/PapaParse
|
|
6
6
|
License: MIT
|
|
7
|
-
*/we.exports=function e(){var t="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:{},n=!t.document&&!!t.postMessage,r=n&&/blob:/i.test((t.location||{}).protocol),i={},s=0,o={parse:function(n,r){var a=(r=r||{}).dynamicTyping||!1;if(O(a)&&(r.dynamicTypingFunction=a,a={}),r.dynamicTyping=a,r.transform=!!O(r.transform)&&r.transform,r.worker&&o.WORKERS_SUPPORTED){var u=function(){if(!o.WORKERS_SUPPORTED)return!1;var n,r,a=(n=t.URL||t.webkitURL||null,r=e.toString(),o.BLOB_URL||(o.BLOB_URL=n.createObjectURL(new Blob(["(",r,")();"],{type:"text/javascript"})))),u=new t.Worker(a);return u.onmessage=m,u.id=s++,i[u.id]=u}();return u.userStep=r.step,u.userChunk=r.chunk,u.userComplete=r.complete,u.userError=r.error,r.step=O(r.step),r.chunk=O(r.chunk),r.complete=O(r.complete),r.error=O(r.error),delete r.worker,void u.postMessage({input:n,config:r,workerId:u.id})}var l=null;return o.NODE_STREAM_INPUT,"string"==typeof n?l=r.download?new c(r):new h(r):!0===n.readable&&O(n.read)&&O(n.on)?l=new d(r):(t.File&&n instanceof File||n instanceof Object)&&(l=new f(r)),l.stream(n)},unparse:function(e,t){var n=!1,r=!0,i=",",s="\r\n",a='"',u=a+a,c=!1,f=null,h=!1;!function(){if("object"==typeof t){if("string"!=typeof t.delimiter||o.BAD_DELIMITERS.filter((function(e){return-1!==t.delimiter.indexOf(e)})).length||(i=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(c=t.skipEmptyLines),"string"==typeof t.newline&&(s=t.newline),"string"==typeof t.quoteChar&&(a=t.quoteChar),"boolean"==typeof t.header&&(r=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");f=t.columns}void 0!==t.escapeChar&&(u=t.escapeChar+a),"boolean"==typeof t.escapeFormulae&&(h=t.escapeFormulae)}}();var d=new RegExp(p(a),"g");if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return l(null,e,c);if("object"==typeof e[0])return l(f||Object.keys(e[0]),e,c)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),l(e.fields||[],e.data||[],c);throw new Error("Unable to serialize unrecognized input");function l(e,t,n){var o="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var a=Array.isArray(e)&&0<e.length,u=!Array.isArray(t[0]);if(a&&r){for(var c=0;c<e.length;c++)0<c&&(o+=i),o+=g(e[c],c);0<t.length&&(o+=s)}for(var f=0;f<t.length;f++){var h=a?e.length:t[f].length,d=!1,l=a?0===Object.keys(t[f]).length:0===t[f].length;if(n&&!a&&(d="greedy"===n?""===t[f].join("").trim():1===t[f].length&&0===t[f][0].length),"greedy"===n&&a){for(var p=[],m=0;m<h;m++){var v=u?e[m]:m;p.push(t[f][v])}d=""===p.join("").trim()}if(!d){for(var y=0;y<h;y++){0<y&&!l&&(o+=i);var b=a&&u?e[y]:y;o+=g(t[f][b],y)}f<t.length-1&&(!n||0<h&&!l)&&(o+=s)}}return o}function g(e,t){if(null==e)return"";if(e.constructor===Date)return JSON.stringify(e).slice(1,25);!0===h&&"string"==typeof e&&null!==e.match(/^[=+\-@].*$/)&&(e="'"+e);var r=e.toString().replace(d,u);return"boolean"==typeof n&&n||"function"==typeof n&&n(e,t)||Array.isArray(n)&&n[t]||function(e,t){for(var n=0;n<t.length;n++)if(-1<e.indexOf(t[n]))return!0;return!1}(r,o.BAD_DELIMITERS)||-1<r.indexOf(i)||" "===r.charAt(0)||" "===r.charAt(r.length-1)?a+r+a:r}}};if(o.RECORD_SEP=String.fromCharCode(30),o.UNIT_SEP=String.fromCharCode(31),o.BYTE_ORDER_MARK="\ufeff",o.BAD_DELIMITERS=["\r","\n",'"',o.BYTE_ORDER_MARK],o.WORKERS_SUPPORTED=!n&&!!t.Worker,o.NODE_STREAM_INPUT=1,o.LocalChunkSize=10485760,o.RemoteChunkSize=5242880,o.DefaultDelimiter=",",o.Parser=g,o.ParserHandle=l,o.NetworkStreamer=c,o.FileStreamer=f,o.StringStreamer=h,o.ReadableStreamStreamer=d,t.jQuery){var a=t.jQuery;a.fn.parse=function(e){var n=e.config||{},r=[];return this.each((function(e){if("INPUT"!==a(this).prop("tagName").toUpperCase()||"file"!==a(this).attr("type").toLowerCase()||!t.FileReader||!this.files||0===this.files.length)return!0;for(var i=0;i<this.files.length;i++)r.push({file:this.files[i],inputElem:this,instanceConfig:a.extend({},n)})})),i(),this;function i(){if(0!==r.length){var t,n,i,u,c=r[0];if(O(e.before)){var f=e.before(c.file,c.inputElem);if("object"==typeof f){if("abort"===f.action)return t="AbortError",n=c.file,i=c.inputElem,u=f.reason,void(O(e.error)&&e.error({name:t},n,i,u));if("skip"===f.action)return void s();"object"==typeof f.config&&(c.instanceConfig=a.extend(c.instanceConfig,f.config))}else if("skip"===f)return void s()}var h=c.instanceConfig.complete;c.instanceConfig.complete=function(e){O(h)&&h(e,c.file,c.inputElem),s()},o.parse(c.file,c.instanceConfig)}else O(e.complete)&&e.complete()}function s(){r.splice(0,1),i()}}}function u(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(e){var t=b(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new l(t),(this._handle.streamer=this)._config=t}.call(this,e),this.parseChunk=function(e,n){if(this.isFirstChunk&&O(this._config.beforeFirstChunk)){var i=this._config.beforeFirstChunk(e);void 0!==i&&(e=i)}this.isFirstChunk=!1,this._halted=!1;var s=this._partialLine+e;this._partialLine="";var a=this._handle.parse(s,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var u=a.meta.cursor;this._finished||(this._partialLine=s.substring(u-this._baseIndex),this._baseIndex=u),a&&a.data&&(this._rowCount+=a.data.length);var c=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(r)t.postMessage({results:a,workerId:o.WORKER_ID,finished:c});else if(O(this._config.chunk)&&!n){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);a=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!c||!O(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),c||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){O(this._config.error)?this._config.error(e):r&&this._config.error&&t.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=o.RemoteChunkSize),u.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),n||(t.onload=_(this._chunkLoaded,this),t.onerror=_(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var r in e)t.setRequestHeader(r,e[r])}if(this._config.chunkSize){var i=this._start+this._config.chunkSize-1;t.setRequestHeader("Range","bytes="+this._start+"-"+i)}try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:t.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader("Content-Range");return null===t?-1:parseInt(t.substring(t.lastIndexOf("/")+1))}(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){var n=t.statusText||e;this._sendError(new Error(n))}}function f(e){var t,n;(e=e||{}).chunkSize||(e.chunkSize=o.LocalChunkSize),u.call(this,e);var r="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=_(this._chunkLoaded,this),t.onerror=_(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input;if(this._config.chunkSize){var i=Math.min(this._start+this._config.chunkSize,this._input.size);e=n.call(e,this._start,i)}var s=t.readAsText(e,this._config.encoding);r||this._chunkLoaded({target:{result:s}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function h(e){var t;u.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,n=this._config.chunkSize;return n?(e=t.substring(0,n),t=t.substring(n)):(e=t,t=""),this._finished=!t,this.parseChunk(e)}}}function d(e){u.call(this,e=e||{});var t=[],n=!0,r=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=_((function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}}),this),this._streamError=_((function(e){this._streamCleanUp(),this._sendError(e)}),this),this._streamEnd=_((function(){this._streamCleanUp(),r=!0,this._streamData("")}),this),this._streamCleanUp=_((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function l(e){var t,n,r,i=Math.pow(2,53),s=-i,a=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,u=/^(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))$/,c=this,f=0,h=0,d=!1,l=!1,m=[],v={data:[],errors:[],meta:{}};if(O(e.step)){var y=e.step;e.step=function(t){if(v=t,E())w();else{if(w(),0===v.data.length)return;f+=t.data.length,e.preview&&f>e.preview?n.abort():(v.data=v.data[0],y(v,c))}}}function _(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function w(){if(v&&r&&(S("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),r=!1),e.skipEmptyLines)for(var t=0;t<v.data.length;t++)_(v.data[t])&&v.data.splice(t--,1);return E()&&function(){if(v)if(Array.isArray(v.data[0])){for(var t=0;E()&&t<v.data.length;t++)v.data[t].forEach(n);v.data.splice(0,1)}else v.data.forEach(n);function n(t,n){O(e.transformHeader)&&(t=e.transformHeader(t,n)),m.push(t)}}(),function(){if(!v||!e.header&&!e.dynamicTyping&&!e.transform)return v;function t(t,n){var r,i=e.header?{}:[];for(r=0;r<t.length;r++){var s=r,o=t[r];e.header&&(s=r>=m.length?"__parsed_extra":m[r]),e.transform&&(o=e.transform(o,s)),o=R(s,o),"__parsed_extra"===s?(i[s]=i[s]||[],i[s].push(o)):i[s]=o}return e.header&&(r>m.length?S("FieldMismatch","TooManyFields","Too many fields: expected "+m.length+" fields but parsed "+r,h+n):r<m.length&&S("FieldMismatch","TooFewFields","Too few fields: expected "+m.length+" fields but parsed "+r,h+n)),i}var n=1;return!v.data.length||Array.isArray(v.data[0])?(v.data=v.data.map(t),n=v.data.length):v.data=t(v.data,0),e.header&&v.meta&&(v.meta.fields=m),h+=n,v}()}function E(){return e.header&&0===m.length}function R(t,n){return r=t,e.dynamicTypingFunction&&void 0===e.dynamicTyping[r]&&(e.dynamicTyping[r]=e.dynamicTypingFunction(r)),!0===(e.dynamicTyping[r]||e.dynamicTyping)?"true"===n||"TRUE"===n||"false"!==n&&"FALSE"!==n&&(function(e){if(a.test(e)){var t=parseFloat(e);if(s<t&&t<i)return!0}return!1}(n)?parseFloat(n):u.test(n)?new Date(n):""===n?null:n):n;var r}function S(e,t,n,r){var i={type:e,code:t,message:n};void 0!==r&&(i.row=r),v.errors.push(i)}this.parse=function(i,s,a){var u=e.quoteChar||'"';if(e.newline||(e.newline=function(e,t){e=e.substring(0,1048576);var n=new RegExp(p(t)+"([^]*?)"+p(t),"gm"),r=(e=e.replace(n,"")).split("\r"),i=e.split("\n"),s=1<i.length&&i[0].length<r[0].length;if(1===r.length||s)return"\n";for(var o=0,a=0;a<r.length;a++)"\n"===r[a][0]&&o++;return o>=r.length/2?"\r\n":"\r"}(i,u)),r=!1,e.delimiter)O(e.delimiter)&&(e.delimiter=e.delimiter(i),v.meta.delimiter=e.delimiter);else{var c=function(t,n,r,i,s){var a,u,c,f;s=s||[",","\t","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var h=0;h<s.length;h++){var d=s[h],l=0,p=0,m=0;c=void 0;for(var v=new g({comments:i,delimiter:d,newline:n,preview:10}).parse(t),y=0;y<v.data.length;y++)if(r&&_(v.data[y]))m++;else{var b=v.data[y].length;p+=b,void 0!==c?0<b&&(l+=Math.abs(b-c),c=b):c=b}0<v.data.length&&(p/=v.data.length-m),(void 0===u||l<=u)&&(void 0===f||f<p)&&1.99<p&&(u=l,a=d,f=p)}return{successful:!!(e.delimiter=a),bestDelimiter:a}}(i,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess);c.successful?e.delimiter=c.bestDelimiter:(r=!0,e.delimiter=o.DefaultDelimiter),v.meta.delimiter=e.delimiter}var f=b(e);return e.preview&&e.header&&f.preview++,t=i,n=new g(f),v=n.parse(t,s,a),w(),d?{meta:{paused:!0}}:v||{meta:{paused:!1}}},this.paused=function(){return d},this.pause=function(){d=!0,n.abort(),t=O(e.chunk)?"":t.substring(n.getCharIndex())},this.resume=function(){c.streamer._halted?(d=!1,c.streamer.parseChunk(t,!0)):setTimeout(c.resume,3)},this.aborted=function(){return l},this.abort=function(){l=!0,n.abort(),v.meta.aborted=!0,O(e.complete)&&e.complete(v),t=""}}function p(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g(e){var t,n=(e=e||{}).delimiter,r=e.newline,i=e.comments,s=e.step,a=e.preview,u=e.fastMode,c=t=void 0===e.quoteChar?'"':e.quoteChar;if(void 0!==e.escapeChar&&(c=e.escapeChar),("string"!=typeof n||-1<o.BAD_DELIMITERS.indexOf(n))&&(n=","),i===n)throw new Error("Comment character same as delimiter");!0===i?i="#":("string"!=typeof i||-1<o.BAD_DELIMITERS.indexOf(i))&&(i=!1),"\n"!==r&&"\r"!==r&&"\r\n"!==r&&(r="\n");var f=0,h=!1;this.parse=function(e,o,d){if("string"!=typeof e)throw new Error("Input must be a string");var l=e.length,g=n.length,m=r.length,v=i.length,y=O(s),b=[],_=[],w=[],E=f=0;if(!e)return F();if(u||!1!==u&&-1===e.indexOf(t)){for(var R=e.split(r),S=0;S<R.length;S++){if(w=R[S],f+=w.length,S!==R.length-1)f+=r.length;else if(d)return F();if(!i||w.substring(0,v)!==i){if(y){if(b=[],I(w.split(n)),P(),h)return F()}else I(w.split(n));if(a&&a<=S)return b=b.slice(0,a),F(!0)}}return F()}for(var k=e.indexOf(n,f),C=e.indexOf(r,f),j=new RegExp(p(c)+p(t),"g"),A=e.indexOf(t,f);;)if(e[f]!==t)if(i&&0===w.length&&e.substring(f,f+v)===i){if(-1===C)return F();f=C+m,C=e.indexOf(r,f),k=e.indexOf(n,f)}else if(-1!==k&&(k<C||-1===C))w.push(e.substring(f,k)),f=k+g,k=e.indexOf(n,f);else{if(-1===C)break;if(w.push(e.substring(f,C)),U(C+m),y&&(P(),h))return F();if(a&&b.length>=a)return F(!0)}else for(A=f,f++;;){if(-1===(A=e.indexOf(t,A+1)))return d||_.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:b.length,index:f}),L();if(A===l-1)return L(e.substring(f,A).replace(j,t));if(t!==c||e[A+1]!==c){if(t===c||0===A||e[A-1]!==c){-1!==k&&k<A+1&&(k=e.indexOf(n,A+1)),-1!==C&&C<A+1&&(C=e.indexOf(r,A+1));var x=D(-1===C?k:Math.min(k,C));if(e[A+1+x]===n){w.push(e.substring(f,A).replace(j,t)),e[f=A+1+x+g]!==t&&(A=e.indexOf(t,f)),k=e.indexOf(n,f),C=e.indexOf(r,f);break}var T=D(C);if(e.substring(A+1+T,A+1+T+m)===r){if(w.push(e.substring(f,A).replace(j,t)),U(A+1+T+m),k=e.indexOf(n,f),A=e.indexOf(t,f),y&&(P(),h))return F();if(a&&b.length>=a)return F(!0);break}_.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:b.length,index:f}),A++}}else A++}return L();function I(e){b.push(e),E=f}function D(t){var n=0;if(-1!==t){var r=e.substring(A+1,t);r&&""===r.trim()&&(n=r.length)}return n}function L(t){return d||(void 0===t&&(t=e.substring(f)),w.push(t),f=l,I(w),y&&P()),F()}function U(t){f=t,I(w),w=[],C=e.indexOf(r,f)}function F(e){return{data:b,errors:_,meta:{delimiter:n,linebreak:r,aborted:h,truncated:!!e,cursor:E+(o||0)}}}function P(){s(F()),b=[],_=[]}},this.abort=function(){h=!0},this.getCharIndex=function(){return f}}function m(e){var t=e.data,n=i[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var s={abort:function(){r=!0,v(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:y,resume:y};if(O(n.userStep)){for(var o=0;o<t.results.data.length&&(n.userStep({data:t.results.data[o],errors:t.results.errors,meta:t.results.meta},s),!r);o++);delete t.results}else O(n.userChunk)&&(n.userChunk(t.results,s,t.file),delete t.results)}t.finished&&!r&&v(t.workerId,t.results)}function v(e,t){var n=i[e];O(n.userComplete)&&n.userComplete(t),n.terminate(),delete i[e]}function y(){throw new Error("Not implemented.")}function b(e){if("object"!=typeof e||null===e)return e;var t=Array.isArray(e)?[]:{};for(var n in e)t[n]=b(e[n]);return t}function _(e,t){return function(){e.apply(t,arguments)}}function O(e){return"function"==typeof e}return r&&(t.onmessage=function(e){var n=e.data;if(void 0===o.WORKER_ID&&n&&(o.WORKER_ID=n.workerId),"string"==typeof n.input)t.postMessage({workerId:o.WORKER_ID,results:o.parse(n.input,n.config),finished:!0});else if(t.File&&n.input instanceof File||n.input instanceof Object){var r=o.parse(n.input,n.config);r&&t.postMessage({workerId:o.WORKER_ID,results:r,finished:!0})}}),(c.prototype=Object.create(u.prototype)).constructor=c,(f.prototype=Object.create(u.prototype)).constructor=f,(h.prototype=Object.create(h.prototype)).constructor=h,(d.prototype=Object.create(u.prototype)).constructor=d,o}();var Ee={},Re={CustomError:void 0};class Se extends Error{get name(){return this.constructor.name}}Re.CustomError=Se;var ke={ExpectedError:void 0};const Ce=Re;class je extends Ce.CustomError{}ke.ExpectedError=je;var Ae={AssertionError:void 0};const xe=Re;class Te extends xe.CustomError{}Ae.AssertionError=Te;var Ie={};Ie.normalize=void 0,Ie.normalize=function(e){var t;return{name:e.name,message:e.message,stack:null!==(t=e.stack)&&void 0!==t?t:null}};var De={refute:void 0};const Le=ke;De.refute=function(e,t){if(e)throw new Le.ExpectedError(t)};var Ue={assert:void 0};const Fe=Ae;function Pe(e){return Ee.assert(e.length>0,"payload must be a non-empty array"),n=>{const r=new t.Headers(n.headers);return r.set("Content-Type","text/csv"),Object.assign(Object.assign({},n),{headers:r,payload:Ne(e)})}}function Ne(e){const t=Object.keys(e[0]);return we.exports.unparse({data:e,fields:t})}function Be(e){return t=>Object.assign(Object.assign({},t),{signal:e})}function ze(e,n){return r=>{const i=new t.Headers(r.headers);return i.set(e,n),Object.assign(Object.assign({},r),{headers:i})}}function Je(e,n){return r=>{const i=new t.Headers(r.headers);return i.append(e,n),Object.assign(Object.assign({},r),{headers:i})}}function qe(e){return n=>{const r=new t.Headers(n.headers);for(const[t,n]of Object.entries(e))r.set(t,n);return Object.assign(Object.assign({},n),{headers:r})}}function Me(e){return Je("Accept",e)}function He(e){return t=>{const n=new URL(t.url.href);return n.host=e,Object.assign(Object.assign({},t),{url:n})}}function Ke(e){return t=>{const n=new URL(t.url.href);return n.port=e.toString(),Object.assign(Object.assign({},t),{url:n})}}function We(e){return t=>{const n=new URL(t.url.href);return n.pathname=e,Object.assign(Object.assign({},t),{url:n})}}function Qe(e){return t=>{const n=new URL(t.url.href);return n.search=e,Object.assign(Object.assign({},t),{url:n})}}function $e(e,t){return n=>{const r=new URL(n.url.href),i=new URLSearchParams(r.searchParams);return i.set(e,t.toString()),r.search=i.toString(),Object.assign(Object.assign({},n),{url:r})}}function Ge(e){return t=>{const n=new URL(t.url.href),r=new URLSearchParams(n.searchParams);for(const[t,n]of Object.entries(e))r.set(t,n.toString());return n.search=r.toString(),Object.assign(Object.assign({},t),{url:n})}}function Ze(e,t){return n=>{const r=new URL(n.url.href),i=new URLSearchParams(r.searchParams);return i.append(e,t.toString()),r.search=i.toString(),Object.assign(Object.assign({},n),{url:r})}}function Ye(e,n){return r=>{const i=r.payload instanceof t.FormData?function(e){const n=new t.FormData;for(const[t,r]of e.entries())n.append(t,r);return n}(r.payload):new t.FormData;return Array.isArray(n)?n.forEach((t=>i.append(e,t))):i.append(e,n),Object.assign(Object.assign({},r),{payload:i})}}Ue.assert=function(e,t){if(!e)throw new Fe.AssertionError(t)},function(t){var n=e&&e.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=e&&e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};r(Re,t),r(ke,t),r(Ae,t),r(Ie,t),r(De,t),r(Ue,t)}(Ee);const Xe="function"==typeof btoa,Ve="function"==typeof Buffer;"function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder&&new TextEncoder;const et=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="];(e=>{let t={};et.forEach(((e,n)=>t[e]=n))})(),String.fromCharCode.bind(String),"function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array);const tt=Xe?e=>btoa(e):Ve?e=>Buffer.from(e,"binary").toString("base64"):e=>{let t,n,r,i,s="";const o=e.length%3;for(let o=0;o<e.length;){if((n=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|i,s+=et[t>>18&63]+et[t>>12&63]+et[t>>6&63]+et[63&t]}return o?s.slice(0,o-3)+"===".substring(o):s};function nt(e,t){return ze("Authorization","Basic "+tt(`${e}:${t}`))}function rt(e){return ze("Authorization",`Bearer ${e}`)}function it(e=!0){return t=>Object.assign(Object.assign({},t),{keepalive:e})}export{Me as accept,Je as appendHeader,Ze as appendSearchParam,nt as basicAuth,rt as bearerAuth,Pe as csv,ve as del,Ye as formDataField,de as get,le as head,ze as header,qe as headers,He as host,Oe as json,it as keepalive,me as patch,We as pathname,Ke as port,pe as post,ge as put,Qe as search,$e as searchParam,Ge as searchParams,Be as signal,_e as text,be as url};
|
|
7
|
+
*/Ee.exports=function e(){var t="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:{},n=!t.document&&!!t.postMessage,r=n&&/blob:/i.test((t.location||{}).protocol),i={},s=0,o={parse:function(n,r){var a=(r=r||{}).dynamicTyping||!1;if(E(a)&&(r.dynamicTypingFunction=a,a={}),r.dynamicTyping=a,r.transform=!!E(r.transform)&&r.transform,r.worker&&o.WORKERS_SUPPORTED){var u=function(){if(!o.WORKERS_SUPPORTED)return!1;var n,r,a=(n=t.URL||t.webkitURL||null,r=e.toString(),o.BLOB_URL||(o.BLOB_URL=n.createObjectURL(new Blob(["(",r,")();"],{type:"text/javascript"})))),u=new t.Worker(a);return u.onmessage=m,u.id=s++,i[u.id]=u}();return u.userStep=r.step,u.userChunk=r.chunk,u.userComplete=r.complete,u.userError=r.error,r.step=E(r.step),r.chunk=E(r.chunk),r.complete=E(r.complete),r.error=E(r.error),delete r.worker,void u.postMessage({input:n,config:r,workerId:u.id})}var l=null;return o.NODE_STREAM_INPUT,"string"==typeof n?l=r.download?new c(r):new h(r):!0===n.readable&&E(n.read)&&E(n.on)?l=new d(r):(t.File&&n instanceof File||n instanceof Object)&&(l=new f(r)),l.stream(n)},unparse:function(e,t){var n=!1,r=!0,i=",",s="\r\n",a='"',u=a+a,c=!1,f=null,h=!1;!function(){if("object"==typeof t){if("string"!=typeof t.delimiter||o.BAD_DELIMITERS.filter((function(e){return-1!==t.delimiter.indexOf(e)})).length||(i=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(c=t.skipEmptyLines),"string"==typeof t.newline&&(s=t.newline),"string"==typeof t.quoteChar&&(a=t.quoteChar),"boolean"==typeof t.header&&(r=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");f=t.columns}void 0!==t.escapeChar&&(u=t.escapeChar+a),"boolean"==typeof t.escapeFormulae&&(h=t.escapeFormulae)}}();var d=new RegExp(p(a),"g");if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return l(null,e,c);if("object"==typeof e[0])return l(f||Object.keys(e[0]),e,c)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),l(e.fields||[],e.data||[],c);throw new Error("Unable to serialize unrecognized input");function l(e,t,n){var o="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var a=Array.isArray(e)&&0<e.length,u=!Array.isArray(t[0]);if(a&&r){for(var c=0;c<e.length;c++)0<c&&(o+=i),o+=g(e[c],c);0<t.length&&(o+=s)}for(var f=0;f<t.length;f++){var h=a?e.length:t[f].length,d=!1,l=a?0===Object.keys(t[f]).length:0===t[f].length;if(n&&!a&&(d="greedy"===n?""===t[f].join("").trim():1===t[f].length&&0===t[f][0].length),"greedy"===n&&a){for(var p=[],m=0;m<h;m++){var y=u?e[m]:m;p.push(t[f][y])}d=""===p.join("").trim()}if(!d){for(var v=0;v<h;v++){0<v&&!l&&(o+=i);var _=a&&u?e[v]:v;o+=g(t[f][_],v)}f<t.length-1&&(!n||0<h&&!l)&&(o+=s)}}return o}function g(e,t){if(null==e)return"";if(e.constructor===Date)return JSON.stringify(e).slice(1,25);!0===h&&"string"==typeof e&&null!==e.match(/^[=+\-@].*$/)&&(e="'"+e);var r=e.toString().replace(d,u);return"boolean"==typeof n&&n||"function"==typeof n&&n(e,t)||Array.isArray(n)&&n[t]||function(e,t){for(var n=0;n<t.length;n++)if(-1<e.indexOf(t[n]))return!0;return!1}(r,o.BAD_DELIMITERS)||-1<r.indexOf(i)||" "===r.charAt(0)||" "===r.charAt(r.length-1)?a+r+a:r}}};if(o.RECORD_SEP=String.fromCharCode(30),o.UNIT_SEP=String.fromCharCode(31),o.BYTE_ORDER_MARK="\ufeff",o.BAD_DELIMITERS=["\r","\n",'"',o.BYTE_ORDER_MARK],o.WORKERS_SUPPORTED=!n&&!!t.Worker,o.NODE_STREAM_INPUT=1,o.LocalChunkSize=10485760,o.RemoteChunkSize=5242880,o.DefaultDelimiter=",",o.Parser=g,o.ParserHandle=l,o.NetworkStreamer=c,o.FileStreamer=f,o.StringStreamer=h,o.ReadableStreamStreamer=d,t.jQuery){var a=t.jQuery;a.fn.parse=function(e){var n=e.config||{},r=[];return this.each((function(e){if("INPUT"!==a(this).prop("tagName").toUpperCase()||"file"!==a(this).attr("type").toLowerCase()||!t.FileReader||!this.files||0===this.files.length)return!0;for(var i=0;i<this.files.length;i++)r.push({file:this.files[i],inputElem:this,instanceConfig:a.extend({},n)})})),i(),this;function i(){if(0!==r.length){var t,n,i,u,c=r[0];if(E(e.before)){var f=e.before(c.file,c.inputElem);if("object"==typeof f){if("abort"===f.action)return t="AbortError",n=c.file,i=c.inputElem,u=f.reason,void(E(e.error)&&e.error({name:t},n,i,u));if("skip"===f.action)return void s();"object"==typeof f.config&&(c.instanceConfig=a.extend(c.instanceConfig,f.config))}else if("skip"===f)return void s()}var h=c.instanceConfig.complete;c.instanceConfig.complete=function(e){E(h)&&h(e,c.file,c.inputElem),s()},o.parse(c.file,c.instanceConfig)}else E(e.complete)&&e.complete()}function s(){r.splice(0,1),i()}}}function u(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(e){var t=_(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new l(t),(this._handle.streamer=this)._config=t}.call(this,e),this.parseChunk=function(e,n){if(this.isFirstChunk&&E(this._config.beforeFirstChunk)){var i=this._config.beforeFirstChunk(e);void 0!==i&&(e=i)}this.isFirstChunk=!1,this._halted=!1;var s=this._partialLine+e;this._partialLine="";var a=this._handle.parse(s,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var u=a.meta.cursor;this._finished||(this._partialLine=s.substring(u-this._baseIndex),this._baseIndex=u),a&&a.data&&(this._rowCount+=a.data.length);var c=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(r)t.postMessage({results:a,workerId:o.WORKER_ID,finished:c});else if(E(this._config.chunk)&&!n){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);a=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!c||!E(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),c||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){E(this._config.error)?this._config.error(e):r&&this._config.error&&t.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=o.RemoteChunkSize),u.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),n||(t.onload=b(this._chunkLoaded,this),t.onerror=b(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var r in e)t.setRequestHeader(r,e[r])}if(this._config.chunkSize){var i=this._start+this._config.chunkSize-1;t.setRequestHeader("Range","bytes="+this._start+"-"+i)}try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:t.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader("Content-Range");return null===t?-1:parseInt(t.substring(t.lastIndexOf("/")+1))}(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){var n=t.statusText||e;this._sendError(new Error(n))}}function f(e){var t,n;(e=e||{}).chunkSize||(e.chunkSize=o.LocalChunkSize),u.call(this,e);var r="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=b(this._chunkLoaded,this),t.onerror=b(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input;if(this._config.chunkSize){var i=Math.min(this._start+this._config.chunkSize,this._input.size);e=n.call(e,this._start,i)}var s=t.readAsText(e,this._config.encoding);r||this._chunkLoaded({target:{result:s}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function h(e){var t;u.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,n=this._config.chunkSize;return n?(e=t.substring(0,n),t=t.substring(n)):(e=t,t=""),this._finished=!t,this.parseChunk(e)}}}function d(e){u.call(this,e=e||{});var t=[],n=!0,r=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=b((function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}}),this),this._streamError=b((function(e){this._streamCleanUp(),this._sendError(e)}),this),this._streamEnd=b((function(){this._streamCleanUp(),r=!0,this._streamData("")}),this),this._streamCleanUp=b((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function l(e){var t,n,r,i=Math.pow(2,53),s=-i,a=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,u=/^(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))$/,c=this,f=0,h=0,d=!1,l=!1,m=[],y={data:[],errors:[],meta:{}};if(E(e.step)){var v=e.step;e.step=function(t){if(y=t,w())O();else{if(O(),0===y.data.length)return;f+=t.data.length,e.preview&&f>e.preview?n.abort():(y.data=y.data[0],v(y,c))}}}function b(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function O(){if(y&&r&&(k("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),r=!1),e.skipEmptyLines)for(var t=0;t<y.data.length;t++)b(y.data[t])&&y.data.splice(t--,1);return w()&&function(){if(y)if(Array.isArray(y.data[0])){for(var t=0;w()&&t<y.data.length;t++)y.data[t].forEach(n);y.data.splice(0,1)}else y.data.forEach(n);function n(t,n){E(e.transformHeader)&&(t=e.transformHeader(t,n)),m.push(t)}}(),function(){if(!y||!e.header&&!e.dynamicTyping&&!e.transform)return y;function t(t,n){var r,i=e.header?{}:[];for(r=0;r<t.length;r++){var s=r,o=t[r];e.header&&(s=r>=m.length?"__parsed_extra":m[r]),e.transform&&(o=e.transform(o,s)),o=R(s,o),"__parsed_extra"===s?(i[s]=i[s]||[],i[s].push(o)):i[s]=o}return e.header&&(r>m.length?k("FieldMismatch","TooManyFields","Too many fields: expected "+m.length+" fields but parsed "+r,h+n):r<m.length&&k("FieldMismatch","TooFewFields","Too few fields: expected "+m.length+" fields but parsed "+r,h+n)),i}var n=1;return!y.data.length||Array.isArray(y.data[0])?(y.data=y.data.map(t),n=y.data.length):y.data=t(y.data,0),e.header&&y.meta&&(y.meta.fields=m),h+=n,y}()}function w(){return e.header&&0===m.length}function R(t,n){return r=t,e.dynamicTypingFunction&&void 0===e.dynamicTyping[r]&&(e.dynamicTyping[r]=e.dynamicTypingFunction(r)),!0===(e.dynamicTyping[r]||e.dynamicTyping)?"true"===n||"TRUE"===n||"false"!==n&&"FALSE"!==n&&(function(e){if(a.test(e)){var t=parseFloat(e);if(s<t&&t<i)return!0}return!1}(n)?parseFloat(n):u.test(n)?new Date(n):""===n?null:n):n;var r}function k(e,t,n,r){var i={type:e,code:t,message:n};void 0!==r&&(i.row=r),y.errors.push(i)}this.parse=function(i,s,a){var u=e.quoteChar||'"';if(e.newline||(e.newline=function(e,t){e=e.substring(0,1048576);var n=new RegExp(p(t)+"([^]*?)"+p(t),"gm"),r=(e=e.replace(n,"")).split("\r"),i=e.split("\n"),s=1<i.length&&i[0].length<r[0].length;if(1===r.length||s)return"\n";for(var o=0,a=0;a<r.length;a++)"\n"===r[a][0]&&o++;return o>=r.length/2?"\r\n":"\r"}(i,u)),r=!1,e.delimiter)E(e.delimiter)&&(e.delimiter=e.delimiter(i),y.meta.delimiter=e.delimiter);else{var c=function(t,n,r,i,s){var a,u,c,f;s=s||[",","\t","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var h=0;h<s.length;h++){var d=s[h],l=0,p=0,m=0;c=void 0;for(var y=new g({comments:i,delimiter:d,newline:n,preview:10}).parse(t),v=0;v<y.data.length;v++)if(r&&b(y.data[v]))m++;else{var _=y.data[v].length;p+=_,void 0!==c?0<_&&(l+=Math.abs(_-c),c=_):c=_}0<y.data.length&&(p/=y.data.length-m),(void 0===u||l<=u)&&(void 0===f||f<p)&&1.99<p&&(u=l,a=d,f=p)}return{successful:!!(e.delimiter=a),bestDelimiter:a}}(i,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess);c.successful?e.delimiter=c.bestDelimiter:(r=!0,e.delimiter=o.DefaultDelimiter),y.meta.delimiter=e.delimiter}var f=_(e);return e.preview&&e.header&&f.preview++,t=i,n=new g(f),y=n.parse(t,s,a),O(),d?{meta:{paused:!0}}:y||{meta:{paused:!1}}},this.paused=function(){return d},this.pause=function(){d=!0,n.abort(),t=E(e.chunk)?"":t.substring(n.getCharIndex())},this.resume=function(){c.streamer._halted?(d=!1,c.streamer.parseChunk(t,!0)):setTimeout(c.resume,3)},this.aborted=function(){return l},this.abort=function(){l=!0,n.abort(),y.meta.aborted=!0,E(e.complete)&&e.complete(y),t=""}}function p(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g(e){var t,n=(e=e||{}).delimiter,r=e.newline,i=e.comments,s=e.step,a=e.preview,u=e.fastMode,c=t=void 0===e.quoteChar?'"':e.quoteChar;if(void 0!==e.escapeChar&&(c=e.escapeChar),("string"!=typeof n||-1<o.BAD_DELIMITERS.indexOf(n))&&(n=","),i===n)throw new Error("Comment character same as delimiter");!0===i?i="#":("string"!=typeof i||-1<o.BAD_DELIMITERS.indexOf(i))&&(i=!1),"\n"!==r&&"\r"!==r&&"\r\n"!==r&&(r="\n");var f=0,h=!1;this.parse=function(e,o,d){if("string"!=typeof e)throw new Error("Input must be a string");var l=e.length,g=n.length,m=r.length,y=i.length,v=E(s),_=[],b=[],O=[],w=f=0;if(!e)return F();if(u||!1!==u&&-1===e.indexOf(t)){for(var R=e.split(r),k=0;k<R.length;k++){if(O=R[k],f+=O.length,k!==R.length-1)f+=r.length;else if(d)return F();if(!i||O.substring(0,y)!==i){if(v){if(_=[],D(O.split(n)),N(),h)return F()}else D(O.split(n));if(a&&a<=k)return _=_.slice(0,a),F(!0)}}return F()}for(var S=e.indexOf(n,f),C=e.indexOf(r,f),j=new RegExp(p(c)+p(t),"g"),A=e.indexOf(t,f);;)if(e[f]!==t)if(i&&0===O.length&&e.substring(f,f+y)===i){if(-1===C)return F();f=C+m,C=e.indexOf(r,f),S=e.indexOf(n,f)}else if(-1!==S&&(S<C||-1===C))O.push(e.substring(f,S)),f=S+g,S=e.indexOf(n,f);else{if(-1===C)break;if(O.push(e.substring(f,C)),U(C+m),v&&(N(),h))return F();if(a&&_.length>=a)return F(!0)}else for(A=f,f++;;){if(-1===(A=e.indexOf(t,A+1)))return d||b.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:_.length,index:f}),L();if(A===l-1)return L(e.substring(f,A).replace(j,t));if(t!==c||e[A+1]!==c){if(t===c||0===A||e[A-1]!==c){-1!==S&&S<A+1&&(S=e.indexOf(n,A+1)),-1!==C&&C<A+1&&(C=e.indexOf(r,A+1));var x=I(-1===C?S:Math.min(S,C));if(e[A+1+x]===n){O.push(e.substring(f,A).replace(j,t)),e[f=A+1+x+g]!==t&&(A=e.indexOf(t,f)),S=e.indexOf(n,f),C=e.indexOf(r,f);break}var T=I(C);if(e.substring(A+1+T,A+1+T+m)===r){if(O.push(e.substring(f,A).replace(j,t)),U(A+1+T+m),S=e.indexOf(n,f),A=e.indexOf(t,f),v&&(N(),h))return F();if(a&&_.length>=a)return F(!0);break}b.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:_.length,index:f}),A++}}else A++}return L();function D(e){_.push(e),w=f}function I(t){var n=0;if(-1!==t){var r=e.substring(A+1,t);r&&""===r.trim()&&(n=r.length)}return n}function L(t){return d||(void 0===t&&(t=e.substring(f)),O.push(t),f=l,D(O),v&&N()),F()}function U(t){f=t,D(O),O=[],C=e.indexOf(r,f)}function F(e){return{data:_,errors:b,meta:{delimiter:n,linebreak:r,aborted:h,truncated:!!e,cursor:w+(o||0)}}}function N(){s(F()),_=[],b=[]}},this.abort=function(){h=!0},this.getCharIndex=function(){return f}}function m(e){var t=e.data,n=i[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var s={abort:function(){r=!0,y(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:v,resume:v};if(E(n.userStep)){for(var o=0;o<t.results.data.length&&(n.userStep({data:t.results.data[o],errors:t.results.errors,meta:t.results.meta},s),!r);o++);delete t.results}else E(n.userChunk)&&(n.userChunk(t.results,s,t.file),delete t.results)}t.finished&&!r&&y(t.workerId,t.results)}function y(e,t){var n=i[e];E(n.userComplete)&&n.userComplete(t),n.terminate(),delete i[e]}function v(){throw new Error("Not implemented.")}function _(e){if("object"!=typeof e||null===e)return e;var t=Array.isArray(e)?[]:{};for(var n in e)t[n]=_(e[n]);return t}function b(e,t){return function(){e.apply(t,arguments)}}function E(e){return"function"==typeof e}return r&&(t.onmessage=function(e){var n=e.data;if(void 0===o.WORKER_ID&&n&&(o.WORKER_ID=n.workerId),"string"==typeof n.input)t.postMessage({workerId:o.WORKER_ID,results:o.parse(n.input,n.config),finished:!0});else if(t.File&&n.input instanceof File||n.input instanceof Object){var r=o.parse(n.input,n.config);r&&t.postMessage({workerId:o.WORKER_ID,results:r,finished:!0})}}),(c.prototype=Object.create(u.prototype)).constructor=c,(f.prototype=Object.create(u.prototype)).constructor=f,(h.prototype=Object.create(h.prototype)).constructor=h,(d.prototype=Object.create(u.prototype)).constructor=d,o}();var Oe={},we={CustomError:void 0};class Re extends Error{get name(){return this.constructor.name}}we.CustomError=Re;var ke={ExpectedError:void 0};const Se=we;class Ce extends Se.CustomError{}ke.ExpectedError=Ce;var je={AssertionError:void 0};const Ae=we;class xe extends Ae.CustomError{}je.AssertionError=xe;var Te={};Te.normalize=void 0,Te.normalize=function(e){var t;return{name:e.name,message:e.message,stack:null!==(t=e.stack)&&void 0!==t?t:null}};var De={refute:void 0};const Ie=ke;De.refute=function(e,t){if(e)throw new Ie.ExpectedError(t)};var Le={assert:void 0};const Ue=je;function Fe(e){return Oe.assert(e.length>0,"payload must be a non-empty array"),n=>{const r=new t.Headers(n.headers);return r.set("Content-Type","text/csv"),Object.assign(Object.assign({},n),{headers:r,payload:Ne(e)})}}function Ne(e){const t=Object.keys(e[0]);return Ee.exports.unparse({data:e,fields:t})}function Be(e){return t=>Object.assign(Object.assign({},t),{signal:e})}function Pe(e,n){return r=>{const i=new t.Headers(r.headers);return i.set(e,n),Object.assign(Object.assign({},r),{headers:i})}}function ze(e,n){return r=>{const i=new t.Headers(r.headers);return i.append(e,n),Object.assign(Object.assign({},r),{headers:i})}}function Je(e){return n=>{const r=new t.Headers(n.headers);for(const[t,n]of Object.entries(e))r.set(t,n);return Object.assign(Object.assign({},n),{headers:r})}}function qe(e){return ze("Accept",e)}function Me(e){return t=>{const n=new URL(t.url.href);return n.host=e,Object.assign(Object.assign({},t),{url:n})}}function He(e){return t=>{const n=new URL(t.url.href);return n.port=e.toString(),Object.assign(Object.assign({},t),{url:n})}}function Ke(e){return t=>{const n=new URL(t.url.href);return n.pathname=e,Object.assign(Object.assign({},t),{url:n})}}function We(e){return t=>{const n=new URL(t.url.href);return n.search=e,Object.assign(Object.assign({},t),{url:n})}}function Qe(e,t){return n=>{const r=new URL(n.url.href),i=new URLSearchParams(r.searchParams);return i.set(e,t.toString()),r.search=i.toString(),Object.assign(Object.assign({},n),{url:r})}}function $e(e){return t=>{const n=new URL(t.url.href),r=new URLSearchParams(n.searchParams);for(const[t,n]of Object.entries(e))r.set(t,n.toString());return n.search=r.toString(),Object.assign(Object.assign({},t),{url:n})}}function Ge(e,t){return n=>{const r=new URL(n.url.href),i=new URLSearchParams(r.searchParams);return i.append(e,t.toString()),r.search=i.toString(),Object.assign(Object.assign({},n),{url:r})}}function Ze(e,n){return r=>{const i=r.payload instanceof t.FormData?function(e){const n=new t.FormData;for(const[t,r]of e.entries())n.append(t,r);return n}(r.payload):new t.FormData;return p.isArray(n)?n.forEach((t=>i.append(e,t))):i.append(e,n),Object.assign(Object.assign({},r),{payload:i})}}Le.assert=function(e,t){if(!e)throw new Ue.AssertionError(t)},function(t){var n=e&&e.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=e&&e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};r(we,t),r(ke,t),r(je,t),r(Te,t),r(De,t),r(Le,t)}(Oe);const Ye="function"==typeof btoa,Xe="function"==typeof Buffer;"function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder&&new TextEncoder;const Ve=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=");(e=>{let t={};Ve.forEach(((e,n)=>t[e]=n))})(),String.fromCharCode.bind(String),"function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array);const et=Ye?e=>btoa(e):Xe?e=>Buffer.from(e,"binary").toString("base64"):e=>{let t,n,r,i,s="";const o=e.length%3;for(let o=0;o<e.length;){if((n=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|i,s+=Ve[t>>18&63]+Ve[t>>12&63]+Ve[t>>6&63]+Ve[63&t]}return o?s.slice(0,o-3)+"===".substring(o):s};function tt(e,t){return Pe("Authorization","Basic "+et(`${e}:${t}`))}function nt(e){return Pe("Authorization",`Bearer ${e}`)}function rt(e=!0){return t=>Object.assign(Object.assign({},t),{keepalive:e})}export{qe as accept,ze as appendHeader,Ge as appendSearchParam,tt as basicAuth,nt as bearerAuth,Fe as csv,me as del,Ze as formDataField,he as get,de as head,Pe as header,Je as headers,Me as host,be as json,rt as keepalive,ge as patch,Ke as pathname,He as port,le as post,pe as put,We as search,Qe as searchParam,$e as searchParams,Be as signal,_e as text,ve as url};
|
|
8
8
|
//# sourceMappingURL=index.min.mjs.map
|