@readme/httpsnippet 6.2.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-XPUGYZ4Y.mjs +3485 -0
- package/dist/chunk-XPUGYZ4Y.mjs.map +1 -0
- package/dist/index-acc66e3d.d.ts +167 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -95
- package/dist/index.js +3777 -261
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +299 -0
- package/dist/index.mjs.map +1 -0
- package/dist/targets/targets.d.mts +4 -0
- package/dist/targets/targets.d.ts +4 -53
- package/dist/targets/targets.js +3476 -113
- package/dist/targets/targets.js.map +1 -0
- package/dist/targets/targets.mjs +3 -0
- package/dist/targets/targets.mjs.map +1 -0
- package/package.json +30 -14
- package/dist/helpers/code-builder.d.ts +0 -49
- package/dist/helpers/code-builder.js +0 -91
- package/dist/helpers/escape.d.ts +0 -46
- package/dist/helpers/escape.js +0 -101
- package/dist/helpers/form-data.d.ts +0 -30
- package/dist/helpers/form-data.js +0 -157
- package/dist/helpers/headers.d.ts +0 -18
- package/dist/helpers/headers.js +0 -33
- package/dist/helpers/reducer.d.ts +0 -5
- package/dist/helpers/reducer.js +0 -19
- package/dist/helpers/shell.d.ts +0 -6
- package/dist/helpers/shell.js +0 -20
- package/dist/helpers/utils.d.ts +0 -6
- package/dist/helpers/utils.js +0 -21
- package/dist/targets/c/libcurl/client.d.ts +0 -2
- package/dist/targets/c/libcurl/client.js +0 -45
- package/dist/targets/c/target.d.ts +0 -2
- package/dist/targets/c/target.js +0 -16
- package/dist/targets/clojure/clj_http/client.d.ts +0 -11
- package/dist/targets/clojure/clj_http/client.js +0 -178
- package/dist/targets/clojure/target.d.ts +0 -2
- package/dist/targets/clojure/target.js +0 -15
- package/dist/targets/csharp/httpclient/client.d.ts +0 -2
- package/dist/targets/csharp/httpclient/client.js +0 -163
- package/dist/targets/csharp/restsharp/client.d.ts +0 -2
- package/dist/targets/csharp/restsharp/client.js +0 -92
- package/dist/targets/csharp/target.d.ts +0 -2
- package/dist/targets/csharp/target.js +0 -18
- package/dist/targets/go/native/client.d.ts +0 -17
- package/dist/targets/go/native/client.js +0 -103
- package/dist/targets/go/target.d.ts +0 -2
- package/dist/targets/go/target.js +0 -16
- package/dist/targets/http/http1.1/client.d.ts +0 -23
- package/dist/targets/http/http1.1/client.js +0 -69
- package/dist/targets/http/target.d.ts +0 -2
- package/dist/targets/http/target.js +0 -15
- package/dist/targets/java/asynchttp/client.d.ts +0 -11
- package/dist/targets/java/asynchttp/client.js +0 -45
- package/dist/targets/java/nethttp/client.d.ts +0 -14
- package/dist/targets/java/nethttp/client.js +0 -44
- package/dist/targets/java/okhttp/client.d.ts +0 -11
- package/dist/targets/java/okhttp/client.js +0 -71
- package/dist/targets/java/target.d.ts +0 -2
- package/dist/targets/java/target.js +0 -21
- package/dist/targets/java/unirest/client.d.ts +0 -11
- package/dist/targets/java/unirest/client.js +0 -45
- package/dist/targets/javascript/axios/client.d.ts +0 -11
- package/dist/targets/javascript/axios/client.js +0 -92
- package/dist/targets/javascript/axios/fixtures/application-form-encoded.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/application-form-encoded.js +0 -23
- package/dist/targets/javascript/axios/fixtures/application-json.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/application-json.js +0 -27
- package/dist/targets/javascript/axios/fixtures/cookies.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/cookies.js +0 -19
- package/dist/targets/javascript/axios/fixtures/custom-method.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/custom-method.js +0 -15
- package/dist/targets/javascript/axios/fixtures/full.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/full.js +0 -27
- package/dist/targets/javascript/axios/fixtures/headers.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/headers.js +0 -24
- package/dist/targets/javascript/axios/fixtures/http-insecure.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/http-insecure.js +0 -15
- package/dist/targets/javascript/axios/fixtures/jsonObj-multiline.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/jsonObj-multiline.js +0 -20
- package/dist/targets/javascript/axios/fixtures/jsonObj-null-value.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/jsonObj-null-value.js +0 -20
- package/dist/targets/javascript/axios/fixtures/multipart-data.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/multipart-data.js +0 -23
- package/dist/targets/javascript/axios/fixtures/multipart-file.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/multipart-file.js +0 -22
- package/dist/targets/javascript/axios/fixtures/multipart-form-data-no-params.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/multipart-form-data-no-params.js +0 -19
- package/dist/targets/javascript/axios/fixtures/multipart-form-data.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/multipart-form-data.js +0 -22
- package/dist/targets/javascript/axios/fixtures/nested.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/nested.js +0 -19
- package/dist/targets/javascript/axios/fixtures/postdata-malformed.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/postdata-malformed.js +0 -19
- package/dist/targets/javascript/axios/fixtures/query-encoded.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/query-encoded.js +0 -22
- package/dist/targets/javascript/axios/fixtures/query.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/query.js +0 -19
- package/dist/targets/javascript/axios/fixtures/short.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/short.js +0 -15
- package/dist/targets/javascript/axios/fixtures/text-plain.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/text-plain.js +0 -20
- package/dist/targets/javascript/fetch/client.d.ts +0 -15
- package/dist/targets/javascript/fetch/client.js +0 -106
- package/dist/targets/javascript/fetch/fixtures/application-form-encoded.d.ts +0 -8
- package/dist/targets/javascript/fetch/fixtures/application-form-encoded.js +0 -10
- package/dist/targets/javascript/fetch/fixtures/application-json.d.ts +0 -7
- package/dist/targets/javascript/fetch/fixtures/application-json.js +0 -17
- package/dist/targets/javascript/fetch/fixtures/cookies.d.ts +0 -6
- package/dist/targets/javascript/fetch/fixtures/cookies.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/custom-method.d.ts +0 -3
- package/dist/targets/javascript/fetch/fixtures/custom-method.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/full.d.ts +0 -10
- package/dist/targets/javascript/fetch/fixtures/full.js +0 -14
- package/dist/targets/javascript/fetch/fixtures/headers.d.ts +0 -9
- package/dist/targets/javascript/fetch/fixtures/headers.js +0 -14
- package/dist/targets/javascript/fetch/fixtures/http-insecure.d.ts +0 -3
- package/dist/targets/javascript/fetch/fixtures/http-insecure.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/jsonObj-multiline.d.ts +0 -7
- package/dist/targets/javascript/fetch/fixtures/jsonObj-multiline.js +0 -10
- package/dist/targets/javascript/fetch/fixtures/jsonObj-null-value.d.ts +0 -7
- package/dist/targets/javascript/fetch/fixtures/jsonObj-null-value.js +0 -10
- package/dist/targets/javascript/fetch/fixtures/multipart-data.d.ts +0 -4
- package/dist/targets/javascript/fetch/fixtures/multipart-data.js +0 -10
- package/dist/targets/javascript/fetch/fixtures/multipart-file.d.ts +0 -4
- package/dist/targets/javascript/fetch/fixtures/multipart-file.js +0 -9
- package/dist/targets/javascript/fetch/fixtures/multipart-form-data-no-params.d.ts +0 -6
- package/dist/targets/javascript/fetch/fixtures/multipart-form-data-no-params.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/multipart-form-data.d.ts +0 -4
- package/dist/targets/javascript/fetch/fixtures/multipart-form-data.js +0 -9
- package/dist/targets/javascript/fetch/fixtures/nested.d.ts +0 -3
- package/dist/targets/javascript/fetch/fixtures/nested.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/postdata-malformed.d.ts +0 -6
- package/dist/targets/javascript/fetch/fixtures/postdata-malformed.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/query-encoded.d.ts +0 -3
- package/dist/targets/javascript/fetch/fixtures/query-encoded.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/query.d.ts +0 -3
- package/dist/targets/javascript/fetch/fixtures/query.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/short.d.ts +0 -3
- package/dist/targets/javascript/fetch/fixtures/short.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/text-plain.d.ts +0 -7
- package/dist/targets/javascript/fetch/fixtures/text-plain.js +0 -6
- package/dist/targets/javascript/jquery/client.d.ts +0 -11
- package/dist/targets/javascript/jquery/client.js +0 -84
- package/dist/targets/javascript/jquery/fixtures/application-form-encoded.d.ts +0 -13
- package/dist/targets/javascript/jquery/fixtures/application-form-encoded.js +0 -17
- package/dist/targets/javascript/jquery/fixtures/application-json.d.ts +0 -11
- package/dist/targets/javascript/jquery/fixtures/application-json.js +0 -15
- package/dist/targets/javascript/jquery/fixtures/cookies.d.ts +0 -9
- package/dist/targets/javascript/jquery/fixtures/cookies.js +0 -13
- package/dist/targets/javascript/jquery/fixtures/custom-method.d.ts +0 -7
- package/dist/targets/javascript/jquery/fixtures/custom-method.js +0 -11
- package/dist/targets/javascript/jquery/fixtures/full.d.ts +0 -14
- package/dist/targets/javascript/jquery/fixtures/full.js +0 -18
- package/dist/targets/javascript/jquery/fixtures/headers.d.ts +0 -12
- package/dist/targets/javascript/jquery/fixtures/headers.js +0 -16
- package/dist/targets/javascript/jquery/fixtures/http-insecure.d.ts +0 -7
- package/dist/targets/javascript/jquery/fixtures/http-insecure.js +0 -11
- package/dist/targets/javascript/jquery/fixtures/jsonObj-multiline.d.ts +0 -11
- package/dist/targets/javascript/jquery/fixtures/jsonObj-multiline.js +0 -15
- package/dist/targets/javascript/jquery/fixtures/jsonObj-null-value.d.ts +0 -11
- package/dist/targets/javascript/jquery/fixtures/jsonObj-null-value.js +0 -15
- package/dist/targets/javascript/jquery/fixtures/multipart-data.d.ts +0 -12
- package/dist/targets/javascript/jquery/fixtures/multipart-data.js +0 -18
- package/dist/targets/javascript/jquery/fixtures/multipart-file.d.ts +0 -12
- package/dist/targets/javascript/jquery/fixtures/multipart-file.js +0 -17
- package/dist/targets/javascript/jquery/fixtures/multipart-form-data-no-params.d.ts +0 -9
- package/dist/targets/javascript/jquery/fixtures/multipart-form-data-no-params.js +0 -13
- package/dist/targets/javascript/jquery/fixtures/multipart-form-data.d.ts +0 -12
- package/dist/targets/javascript/jquery/fixtures/multipart-form-data.js +0 -17
- package/dist/targets/javascript/jquery/fixtures/nested.d.ts +0 -7
- package/dist/targets/javascript/jquery/fixtures/nested.js +0 -11
- package/dist/targets/javascript/jquery/fixtures/postdata-malformed.d.ts +0 -9
- package/dist/targets/javascript/jquery/fixtures/postdata-malformed.js +0 -13
- package/dist/targets/javascript/jquery/fixtures/query-encoded.d.ts +0 -7
- package/dist/targets/javascript/jquery/fixtures/query-encoded.js +0 -11
- package/dist/targets/javascript/jquery/fixtures/query.d.ts +0 -7
- package/dist/targets/javascript/jquery/fixtures/query.js +0 -11
- package/dist/targets/javascript/jquery/fixtures/short.d.ts +0 -7
- package/dist/targets/javascript/jquery/fixtures/short.js +0 -11
- package/dist/targets/javascript/jquery/fixtures/text-plain.d.ts +0 -10
- package/dist/targets/javascript/jquery/fixtures/text-plain.js +0 -14
- package/dist/targets/javascript/target.d.ts +0 -2
- package/dist/targets/javascript/target.js +0 -21
- package/dist/targets/javascript/xhr/client.d.ts +0 -14
- package/dist/targets/javascript/xhr/client.js +0 -83
- package/dist/targets/javascript/xhr/fixtures/application-form-encoded.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/application-form-encoded.js +0 -12
- package/dist/targets/javascript/xhr/fixtures/application-json.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/application-json.js +0 -31
- package/dist/targets/javascript/xhr/fixtures/cookies.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/cookies.js +0 -12
- package/dist/targets/javascript/xhr/fixtures/cors.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/cors.js +0 -10
- package/dist/targets/javascript/xhr/fixtures/custom-method.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/custom-method.js +0 -11
- package/dist/targets/javascript/xhr/fixtures/full.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/full.js +0 -14
- package/dist/targets/javascript/xhr/fixtures/headers.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/headers.js +0 -15
- package/dist/targets/javascript/xhr/fixtures/http-insecure.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/http-insecure.js +0 -11
- package/dist/targets/javascript/xhr/fixtures/jsonObj-multiline.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/jsonObj-multiline.js +0 -14
- package/dist/targets/javascript/xhr/fixtures/jsonObj-null-value.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/jsonObj-null-value.js +0 -14
- package/dist/targets/javascript/xhr/fixtures/multipart-data.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/multipart-data.js +0 -13
- package/dist/targets/javascript/xhr/fixtures/multipart-file.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/multipart-file.js +0 -12
- package/dist/targets/javascript/xhr/fixtures/multipart-form-data-no-params.d.ts +0 -1
- package/dist/targets/javascript/xhr/fixtures/multipart-form-data-no-params.js +0 -11
- package/dist/targets/javascript/xhr/fixtures/multipart-form-data.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/multipart-form-data.js +0 -12
- package/dist/targets/javascript/xhr/fixtures/nested.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/nested.js +0 -11
- package/dist/targets/javascript/xhr/fixtures/postdata-malformed.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/postdata-malformed.js +0 -12
- package/dist/targets/javascript/xhr/fixtures/query-encoded.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/query-encoded.js +0 -11
- package/dist/targets/javascript/xhr/fixtures/query.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/query.js +0 -11
- package/dist/targets/javascript/xhr/fixtures/short.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/short.js +0 -11
- package/dist/targets/javascript/xhr/fixtures/text-plain.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/text-plain.js +0 -12
- package/dist/targets/json/native/client.d.ts +0 -2
- package/dist/targets/json/native/client.js +0 -56
- package/dist/targets/json/target.d.ts +0 -2
- package/dist/targets/json/target.js +0 -15
- package/dist/targets/kotlin/okhttp/client.d.ts +0 -11
- package/dist/targets/kotlin/okhttp/client.js +0 -71
- package/dist/targets/kotlin/target.d.ts +0 -2
- package/dist/targets/kotlin/target.js +0 -15
- package/dist/targets/node/axios/client.d.ts +0 -11
- package/dist/targets/node/axios/client.js +0 -78
- package/dist/targets/node/axios/fixtures/application-form-encoded.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/application-form-encoded.js +0 -20
- package/dist/targets/node/axios/fixtures/application-json.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/application-json.js +0 -23
- package/dist/targets/node/axios/fixtures/cookies.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/cookies.js +0 -15
- package/dist/targets/node/axios/fixtures/custom-method.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/custom-method.js +0 -11
- package/dist/targets/node/axios/fixtures/full.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/full.js +0 -23
- package/dist/targets/node/axios/fixtures/headers.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/headers.js +0 -20
- package/dist/targets/node/axios/fixtures/http-insecure.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/http-insecure.js +0 -11
- package/dist/targets/node/axios/fixtures/jsonObj-multiline.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/jsonObj-multiline.js +0 -16
- package/dist/targets/node/axios/fixtures/jsonObj-null-value.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/jsonObj-null-value.js +0 -16
- package/dist/targets/node/axios/fixtures/multipart-data.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/multipart-data.js +0 -16
- package/dist/targets/node/axios/fixtures/multipart-file.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/multipart-file.js +0 -16
- package/dist/targets/node/axios/fixtures/multipart-form-data-no-params.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/multipart-form-data-no-params.js +0 -15
- package/dist/targets/node/axios/fixtures/multipart-form-data.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/multipart-form-data.js +0 -16
- package/dist/targets/node/axios/fixtures/nested.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/nested.js +0 -14
- package/dist/targets/node/axios/fixtures/postdata-malformed.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/postdata-malformed.js +0 -15
- package/dist/targets/node/axios/fixtures/query-encoded.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/query-encoded.js +0 -14
- package/dist/targets/node/axios/fixtures/query.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/query.js +0 -14
- package/dist/targets/node/axios/fixtures/short.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/short.js +0 -11
- package/dist/targets/node/axios/fixtures/text-plain.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/text-plain.js +0 -16
- package/dist/targets/node/fetch/client.d.ts +0 -11
- package/dist/targets/node/fetch/client.js +0 -140
- package/dist/targets/node/fetch/fixtures/application-form-encoded.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/application-form-encoded.js +0 -16
- package/dist/targets/node/fetch/fixtures/application-json.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/application-json.js +0 -19
- package/dist/targets/node/fetch/fixtures/cookies.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/cookies.js +0 -8
- package/dist/targets/node/fetch/fixtures/custom-method.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/custom-method.js +0 -8
- package/dist/targets/node/fetch/fixtures/full.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/full.js +0 -19
- package/dist/targets/node/fetch/fixtures/headers.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/headers.js +0 -16
- package/dist/targets/node/fetch/fixtures/http-insecure.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/http-insecure.js +0 -8
- package/dist/targets/node/fetch/fixtures/jsonObj-multiline.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/jsonObj-multiline.js +0 -12
- package/dist/targets/node/fetch/fixtures/jsonObj-null-value.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/jsonObj-null-value.js +0 -12
- package/dist/targets/node/fetch/fixtures/multipart-data.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/multipart-data.js +0 -14
- package/dist/targets/node/fetch/fixtures/multipart-file.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/multipart-file.js +0 -13
- package/dist/targets/node/fetch/fixtures/multipart-form-data-no-params.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/multipart-form-data-no-params.js +0 -8
- package/dist/targets/node/fetch/fixtures/multipart-form-data.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/multipart-form-data.js +0 -12
- package/dist/targets/node/fetch/fixtures/nested.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/nested.js +0 -8
- package/dist/targets/node/fetch/fixtures/postdata-malformed.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/postdata-malformed.js +0 -8
- package/dist/targets/node/fetch/fixtures/query-encoded.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/query-encoded.js +0 -8
- package/dist/targets/node/fetch/fixtures/query.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/query.js +0 -8
- package/dist/targets/node/fetch/fixtures/short.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/short.js +0 -8
- package/dist/targets/node/fetch/fixtures/text-plain.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/text-plain.js +0 -8
- package/dist/targets/node/native/client.d.ts +0 -11
- package/dist/targets/node/native/client.js +0 -72
- package/dist/targets/node/native/fixtures/application-form-encoded.d.ts +0 -1
- package/dist/targets/node/native/fixtures/application-form-encoded.js +0 -24
- package/dist/targets/node/native/fixtures/application-json.d.ts +0 -1
- package/dist/targets/node/native/fixtures/application-json.js +0 -30
- package/dist/targets/node/native/fixtures/cookies.d.ts +0 -1
- package/dist/targets/node/native/fixtures/cookies.js +0 -22
- package/dist/targets/node/native/fixtures/custom-method.d.ts +0 -1
- package/dist/targets/node/native/fixtures/custom-method.js +0 -20
- package/dist/targets/node/native/fixtures/full.d.ts +0 -1
- package/dist/targets/node/native/fixtures/full.js +0 -26
- package/dist/targets/node/native/fixtures/headers.d.ts +0 -1
- package/dist/targets/node/native/fixtures/headers.js +0 -25
- package/dist/targets/node/native/fixtures/http-insecure.d.ts +0 -1
- package/dist/targets/node/native/fixtures/http-insecure.js +0 -20
- package/dist/targets/node/native/fixtures/jsonObj-multiline.d.ts +0 -1
- package/dist/targets/node/native/fixtures/jsonObj-multiline.js +0 -23
- package/dist/targets/node/native/fixtures/jsonObj-null-value.d.ts +0 -1
- package/dist/targets/node/native/fixtures/jsonObj-null-value.js +0 -23
- package/dist/targets/node/native/fixtures/multipart-data.d.ts +0 -1
- package/dist/targets/node/native/fixtures/multipart-data.js +0 -23
- package/dist/targets/node/native/fixtures/multipart-file.d.ts +0 -1
- package/dist/targets/node/native/fixtures/multipart-file.js +0 -23
- package/dist/targets/node/native/fixtures/multipart-form-data-no-params.d.ts +0 -1
- package/dist/targets/node/native/fixtures/multipart-form-data-no-params.js +0 -22
- package/dist/targets/node/native/fixtures/multipart-form-data.d.ts +0 -1
- package/dist/targets/node/native/fixtures/multipart-form-data.js +0 -23
- package/dist/targets/node/native/fixtures/nested.d.ts +0 -1
- package/dist/targets/node/native/fixtures/nested.js +0 -20
- package/dist/targets/node/native/fixtures/postdata-malformed.d.ts +0 -1
- package/dist/targets/node/native/fixtures/postdata-malformed.js +0 -22
- package/dist/targets/node/native/fixtures/query-encoded.d.ts +0 -1
- package/dist/targets/node/native/fixtures/query-encoded.js +0 -20
- package/dist/targets/node/native/fixtures/query.d.ts +0 -1
- package/dist/targets/node/native/fixtures/query.js +0 -20
- package/dist/targets/node/native/fixtures/short.d.ts +0 -1
- package/dist/targets/node/native/fixtures/short.js +0 -20
- package/dist/targets/node/native/fixtures/text-plain.d.ts +0 -1
- package/dist/targets/node/native/fixtures/text-plain.js +0 -23
- package/dist/targets/node/request/client.d.ts +0 -11
- package/dist/targets/node/request/client.js +0 -107
- package/dist/targets/node/request/fixtures/application-form-encoded.d.ts +0 -1
- package/dist/targets/node/request/fixtures/application-form-encoded.js +0 -13
- package/dist/targets/node/request/fixtures/application-json.d.ts +0 -1
- package/dist/targets/node/request/fixtures/application-json.js +0 -21
- package/dist/targets/node/request/fixtures/cookies.d.ts +0 -1
- package/dist/targets/node/request/fixtures/cookies.js +0 -11
- package/dist/targets/node/request/fixtures/custom-method.d.ts +0 -1
- package/dist/targets/node/request/fixtures/custom-method.js +0 -8
- package/dist/targets/node/request/fixtures/full.d.ts +0 -1
- package/dist/targets/node/request/fixtures/full.js +0 -20
- package/dist/targets/node/request/fixtures/headers.d.ts +0 -1
- package/dist/targets/node/request/fixtures/headers.js +0 -17
- package/dist/targets/node/request/fixtures/http-insecure.d.ts +0 -1
- package/dist/targets/node/request/fixtures/http-insecure.js +0 -8
- package/dist/targets/node/request/fixtures/jsonObj-multiline.d.ts +0 -1
- package/dist/targets/node/request/fixtures/jsonObj-multiline.js +0 -14
- package/dist/targets/node/request/fixtures/jsonObj-null-value.d.ts +0 -1
- package/dist/targets/node/request/fixtures/jsonObj-null-value.js +0 -14
- package/dist/targets/node/request/fixtures/multipart-data.d.ts +0 -1
- package/dist/targets/node/request/fixtures/multipart-data.js +0 -20
- package/dist/targets/node/request/fixtures/multipart-file.d.ts +0 -1
- package/dist/targets/node/request/fixtures/multipart-file.js +0 -19
- package/dist/targets/node/request/fixtures/multipart-form-data-no-params.d.ts +0 -1
- package/dist/targets/node/request/fixtures/multipart-form-data-no-params.js +0 -12
- package/dist/targets/node/request/fixtures/multipart-form-data.d.ts +0 -1
- package/dist/targets/node/request/fixtures/multipart-form-data.js +0 -13
- package/dist/targets/node/request/fixtures/nested.d.ts +0 -1
- package/dist/targets/node/request/fixtures/nested.js +0 -11
- package/dist/targets/node/request/fixtures/postdata-malformed.d.ts +0 -1
- package/dist/targets/node/request/fixtures/postdata-malformed.js +0 -12
- package/dist/targets/node/request/fixtures/query-encoded.d.ts +0 -1
- package/dist/targets/node/request/fixtures/query-encoded.js +0 -11
- package/dist/targets/node/request/fixtures/query.d.ts +0 -1
- package/dist/targets/node/request/fixtures/query.js +0 -11
- package/dist/targets/node/request/fixtures/short.d.ts +0 -1
- package/dist/targets/node/request/fixtures/short.js +0 -8
- package/dist/targets/node/request/fixtures/text-plain.d.ts +0 -1
- package/dist/targets/node/request/fixtures/text-plain.js +0 -13
- package/dist/targets/node/target.d.ts +0 -2
- package/dist/targets/node/target.js +0 -24
- package/dist/targets/node/unirest/client.d.ts +0 -11
- package/dist/targets/node/unirest/client.js +0 -110
- package/dist/targets/node/unirest/fixtures/application-form-encoded.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/application-form-encoded.js +0 -15
- package/dist/targets/node/unirest/fixtures/application-json.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/application-json.js +0 -32
- package/dist/targets/node/unirest/fixtures/cookies.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/cookies.js +0 -12
- package/dist/targets/node/unirest/fixtures/custom-method.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/custom-method.js +0 -8
- package/dist/targets/node/unirest/fixtures/full.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/full.js +0 -27
- package/dist/targets/node/unirest/fixtures/headers.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/headers.js +0 -14
- package/dist/targets/node/unirest/fixtures/http-insecure.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/http-insecure.js +0 -8
- package/dist/targets/node/unirest/fixtures/jsonObj-multiline.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/jsonObj-multiline.js +0 -15
- package/dist/targets/node/unirest/fixtures/jsonObj-null-value.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/jsonObj-null-value.js +0 -15
- package/dist/targets/node/unirest/fixtures/multipart-data.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/multipart-data.js +0 -20
- package/dist/targets/node/unirest/fixtures/multipart-file.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/multipart-file.js +0 -18
- package/dist/targets/node/unirest/fixtures/multipart-form-data-no-params.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/multipart-form-data-no-params.js +0 -11
- package/dist/targets/node/unirest/fixtures/multipart-form-data.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/multipart-form-data.js +0 -16
- package/dist/targets/node/unirest/fixtures/nested.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/nested.js +0 -13
- package/dist/targets/node/unirest/fixtures/postdata-malformed.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/postdata-malformed.js +0 -11
- package/dist/targets/node/unirest/fixtures/query-encoded.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/query-encoded.js +0 -12
- package/dist/targets/node/unirest/fixtures/query.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/query.js +0 -16
- package/dist/targets/node/unirest/fixtures/short.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/short.js +0 -8
- package/dist/targets/node/unirest/fixtures/text-plain.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/text-plain.js +0 -12
- package/dist/targets/objc/helpers.d.ts +0 -26
- package/dist/targets/objc/helpers.js +0 -59
- package/dist/targets/objc/nsurlsession/client.d.ts +0 -15
- package/dist/targets/objc/nsurlsession/client.js +0 -143
- package/dist/targets/objc/target.d.ts +0 -2
- package/dist/targets/objc/target.js +0 -15
- package/dist/targets/ocaml/cohttp/client.d.ts +0 -11
- package/dist/targets/ocaml/cohttp/client.js +0 -64
- package/dist/targets/ocaml/target.d.ts +0 -2
- package/dist/targets/ocaml/target.js +0 -15
- package/dist/targets/php/curl/client.d.ts +0 -19
- package/dist/targets/php/curl/client.js +0 -122
- package/dist/targets/php/guzzle/client.d.ts +0 -17
- package/dist/targets/php/guzzle/client.js +0 -119
- package/dist/targets/php/helpers.d.ts +0 -2
- package/dist/targets/php/helpers.js +0 -66
- package/dist/targets/php/http1/client.d.ts +0 -16
- package/dist/targets/php/http1/client.js +0 -76
- package/dist/targets/php/http2/client.d.ts +0 -16
- package/dist/targets/php/http2/client.js +0 -115
- package/dist/targets/php/target.d.ts +0 -2
- package/dist/targets/php/target.js +0 -22
- package/dist/targets/powershell/common.d.ts +0 -3
- package/dist/targets/powershell/common.js +0 -50
- package/dist/targets/powershell/restmethod/client.d.ts +0 -2
- package/dist/targets/powershell/restmethod/client.js +0 -13
- package/dist/targets/powershell/target.d.ts +0 -2
- package/dist/targets/powershell/target.js +0 -17
- package/dist/targets/powershell/webrequest/client.d.ts +0 -2
- package/dist/targets/powershell/webrequest/client.js +0 -13
- package/dist/targets/python/helpers.d.ts +0 -8
- package/dist/targets/python/helpers.js +0 -64
- package/dist/targets/python/requests/client.d.ts +0 -14
- package/dist/targets/python/requests/client.js +0 -162
- package/dist/targets/python/target.d.ts +0 -2
- package/dist/targets/python/target.js +0 -16
- package/dist/targets/r/httr/client.d.ts +0 -11
- package/dist/targets/r/httr/client.js +0 -130
- package/dist/targets/r/target.d.ts +0 -2
- package/dist/targets/r/target.js +0 -15
- package/dist/targets/ruby/native/client.d.ts +0 -2
- package/dist/targets/ruby/native/client.js +0 -67
- package/dist/targets/ruby/target.d.ts +0 -2
- package/dist/targets/ruby/target.js +0 -15
- package/dist/targets/shell/curl/client.d.ts +0 -19
- package/dist/targets/shell/curl/client.js +0 -166
- package/dist/targets/shell/httpie/client.d.ts +0 -24
- package/dist/targets/shell/httpie/client.js +0 -102
- package/dist/targets/shell/target.d.ts +0 -2
- package/dist/targets/shell/target.js +0 -20
- package/dist/targets/shell/wget/client.d.ts +0 -16
- package/dist/targets/shell/wget/client.js +0 -46
- package/dist/targets/swift/helpers.d.ts +0 -16
- package/dist/targets/swift/helpers.js +0 -80
- package/dist/targets/swift/nsurlsession/client.d.ts +0 -15
- package/dist/targets/swift/nsurlsession/client.js +0 -148
- package/dist/targets/swift/target.d.ts +0 -2
- package/dist/targets/swift/target.js +0 -15
package/package.json
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "6.2.0",
|
|
3
2
|
"name": "@readme/httpsnippet",
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "HTTP Request snippet generator for *most* languages",
|
|
5
5
|
"homepage": "https://github.com/readmeio/httpsnippet",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"import": "./dist/index.mjs"
|
|
12
|
+
},
|
|
13
|
+
"./targets": {
|
|
14
|
+
"types": "./dist/targets.d.ts",
|
|
15
|
+
"require": "./dist/targets.js",
|
|
16
|
+
"import": "./dist/targets.mjs"
|
|
17
|
+
},
|
|
18
|
+
"./package.json": "./package.json"
|
|
19
|
+
},
|
|
7
20
|
"main": "dist/index.js",
|
|
21
|
+
"module": "dist/index.mjs",
|
|
8
22
|
"types": "dist/index.d.ts",
|
|
23
|
+
"sideEffects": false,
|
|
9
24
|
"keywords": [
|
|
10
25
|
"api",
|
|
11
26
|
"clojure",
|
|
@@ -47,31 +62,32 @@
|
|
|
47
62
|
"url": "https://github.com/readmeio/httpsnippet.git"
|
|
48
63
|
},
|
|
49
64
|
"scripts": {
|
|
50
|
-
"build": "
|
|
65
|
+
"build": "tsup",
|
|
51
66
|
"clean": "rm -rf dist/",
|
|
52
67
|
"lint": "eslint .",
|
|
53
68
|
"prebuild": "npm run clean",
|
|
54
69
|
"prepack": "npm run build",
|
|
55
70
|
"pretest": "npm run lint",
|
|
56
|
-
"prettier": "prettier --list-different --write \"./**/**.js\"",
|
|
71
|
+
"prettier": "prettier --list-different --write \"./**/**.{js,ts}\"",
|
|
57
72
|
"test": "jest --coverage"
|
|
58
73
|
},
|
|
59
74
|
"devDependencies": {
|
|
60
|
-
"@readme/eslint-config": "^
|
|
61
|
-
"@types/eslint": "^8.
|
|
75
|
+
"@readme/eslint-config": "^12.2.0",
|
|
76
|
+
"@types/eslint": "^8.44.2",
|
|
62
77
|
"@types/event-stream": "^4.0.1",
|
|
63
|
-
"@types/har-format": "^1.2.
|
|
64
|
-
"@types/jest": "^29.5.
|
|
65
|
-
"@types/node": "^20.
|
|
66
|
-
"@types/qs": "^6.9.
|
|
78
|
+
"@types/har-format": "^1.2.12",
|
|
79
|
+
"@types/jest": "^29.5.4",
|
|
80
|
+
"@types/node": "^20.5.9",
|
|
81
|
+
"@types/qs": "^6.9.8",
|
|
67
82
|
"@types/stringify-object": "^4.0.2",
|
|
68
|
-
"eslint": "^8.
|
|
69
|
-
"jest": "^29.
|
|
70
|
-
"prettier": "^
|
|
83
|
+
"eslint": "^8.48.0",
|
|
84
|
+
"jest": "^29.6.4",
|
|
85
|
+
"prettier": "^3.0.3",
|
|
71
86
|
"require-directory": "^2.1.1",
|
|
72
87
|
"ts-jest": "^29.1.1",
|
|
73
|
-
"
|
|
74
|
-
"
|
|
88
|
+
"tsup": "^7.2.0",
|
|
89
|
+
"type-fest": "^4.3.1",
|
|
90
|
+
"typescript": "^5.2.2"
|
|
75
91
|
},
|
|
76
92
|
"dependencies": {
|
|
77
93
|
"event-stream": "4.0.1",
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export type PostProcessor = (unreplacedCode: string) => string;
|
|
2
|
-
export interface CodeBuilderOptions {
|
|
3
|
-
/**
|
|
4
|
-
* Desired indentation character for aggregated lines of code
|
|
5
|
-
* @default ''
|
|
6
|
-
*/
|
|
7
|
-
indent?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Desired character to join each line of code
|
|
10
|
-
* @default \n
|
|
11
|
-
*/
|
|
12
|
-
join?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare class CodeBuilder {
|
|
15
|
-
postProcessors: PostProcessor[];
|
|
16
|
-
code: string[];
|
|
17
|
-
indentationCharacter: string;
|
|
18
|
-
lineJoin: string;
|
|
19
|
-
/**
|
|
20
|
-
* Helper object to format and aggragate lines of code.
|
|
21
|
-
* Lines are aggregated in a `code` array, and need to be joined to obtain a proper code snippet.
|
|
22
|
-
*/
|
|
23
|
-
constructor({ indent, join }?: CodeBuilderOptions);
|
|
24
|
-
/**
|
|
25
|
-
* Add given indentation level to given line of code
|
|
26
|
-
*/
|
|
27
|
-
indentLine: (line: string, indentationLevel?: number) => string;
|
|
28
|
-
/**
|
|
29
|
-
* Add the line at the beginning of the current lines
|
|
30
|
-
*/
|
|
31
|
-
unshift: (line: string, indentationLevel?: number) => void;
|
|
32
|
-
/**
|
|
33
|
-
* Add the line at the end of the current lines
|
|
34
|
-
*/
|
|
35
|
-
push: (line: string, indentationLevel?: number) => void;
|
|
36
|
-
/**
|
|
37
|
-
* Add an empty line at the end of current lines
|
|
38
|
-
*/
|
|
39
|
-
blank: () => void;
|
|
40
|
-
/**
|
|
41
|
-
* Concatenate all current lines using the given lineJoin, then apply any replacers that may have been added
|
|
42
|
-
*/
|
|
43
|
-
join: () => string;
|
|
44
|
-
/**
|
|
45
|
-
* Often when writing modules you may wish to add a literal tag or bit of metadata that you wish to transform after other processing as a final step.
|
|
46
|
-
* To do so, you can provide a PostProcessor function and it will be run automatically for you when you call `join()` later on.
|
|
47
|
-
*/
|
|
48
|
-
addPostProcessor: (postProcessor: PostProcessor) => void;
|
|
49
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
-
if (!m) return o;
|
|
5
|
-
var i = m.call(o), r, ar = [], e;
|
|
6
|
-
try {
|
|
7
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
-
}
|
|
9
|
-
catch (error) { e = { error: error }; }
|
|
10
|
-
finally {
|
|
11
|
-
try {
|
|
12
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
-
}
|
|
14
|
-
finally { if (e) throw e.error; }
|
|
15
|
-
}
|
|
16
|
-
return ar;
|
|
17
|
-
};
|
|
18
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
20
|
-
if (ar || !(i in from)) {
|
|
21
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
22
|
-
ar[i] = from[i];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.CodeBuilder = void 0;
|
|
29
|
-
var DEFAULT_INDENTATION_CHARACTER = '';
|
|
30
|
-
var DEFAULT_LINE_JOIN = '\n';
|
|
31
|
-
var CodeBuilder = /** @class */ (function () {
|
|
32
|
-
/**
|
|
33
|
-
* Helper object to format and aggragate lines of code.
|
|
34
|
-
* Lines are aggregated in a `code` array, and need to be joined to obtain a proper code snippet.
|
|
35
|
-
*/
|
|
36
|
-
function CodeBuilder(_a) {
|
|
37
|
-
var _b = _a === void 0 ? {} : _a, indent = _b.indent, join = _b.join;
|
|
38
|
-
var _this = this;
|
|
39
|
-
this.postProcessors = [];
|
|
40
|
-
this.code = [];
|
|
41
|
-
this.indentationCharacter = DEFAULT_INDENTATION_CHARACTER;
|
|
42
|
-
this.lineJoin = DEFAULT_LINE_JOIN;
|
|
43
|
-
/**
|
|
44
|
-
* Add given indentation level to given line of code
|
|
45
|
-
*/
|
|
46
|
-
this.indentLine = function (line, indentationLevel) {
|
|
47
|
-
if (indentationLevel === void 0) { indentationLevel = 0; }
|
|
48
|
-
var indent = _this.indentationCharacter.repeat(indentationLevel);
|
|
49
|
-
return "".concat(indent).concat(line);
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Add the line at the beginning of the current lines
|
|
53
|
-
*/
|
|
54
|
-
this.unshift = function (line, indentationLevel) {
|
|
55
|
-
var newLine = _this.indentLine(line, indentationLevel);
|
|
56
|
-
_this.code.unshift(newLine);
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Add the line at the end of the current lines
|
|
60
|
-
*/
|
|
61
|
-
this.push = function (line, indentationLevel) {
|
|
62
|
-
var newLine = _this.indentLine(line, indentationLevel);
|
|
63
|
-
_this.code.push(newLine);
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Add an empty line at the end of current lines
|
|
67
|
-
*/
|
|
68
|
-
this.blank = function () {
|
|
69
|
-
_this.code.push('');
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Concatenate all current lines using the given lineJoin, then apply any replacers that may have been added
|
|
73
|
-
*/
|
|
74
|
-
this.join = function () {
|
|
75
|
-
var unreplacedCode = _this.code.join(_this.lineJoin);
|
|
76
|
-
var replacedOutput = _this.postProcessors.reduce(function (accumulator, replacer) { return replacer(accumulator); }, unreplacedCode);
|
|
77
|
-
return replacedOutput;
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Often when writing modules you may wish to add a literal tag or bit of metadata that you wish to transform after other processing as a final step.
|
|
81
|
-
* To do so, you can provide a PostProcessor function and it will be run automatically for you when you call `join()` later on.
|
|
82
|
-
*/
|
|
83
|
-
this.addPostProcessor = function (postProcessor) {
|
|
84
|
-
_this.postProcessors = __spreadArray(__spreadArray([], __read(_this.postProcessors), false), [postProcessor], false);
|
|
85
|
-
};
|
|
86
|
-
this.indentationCharacter = indent || DEFAULT_INDENTATION_CHARACTER;
|
|
87
|
-
this.lineJoin = join !== null && join !== void 0 ? join : DEFAULT_LINE_JOIN;
|
|
88
|
-
}
|
|
89
|
-
return CodeBuilder;
|
|
90
|
-
}());
|
|
91
|
-
exports.CodeBuilder = CodeBuilder;
|
package/dist/helpers/escape.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export interface EscapeOptions {
|
|
2
|
-
/**
|
|
3
|
-
* The delimiter that will be used to wrap the string (and so must be escaped
|
|
4
|
-
* when used within the string).
|
|
5
|
-
* Defaults to "
|
|
6
|
-
*/
|
|
7
|
-
delimiter?: string;
|
|
8
|
-
/**
|
|
9
|
-
* The char to use to escape the delimiter and other special characters.
|
|
10
|
-
* Defaults to \
|
|
11
|
-
*/
|
|
12
|
-
escapeChar?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Whether newlines (\n and \r) should be escaped within the string.
|
|
15
|
-
* Defaults to true.
|
|
16
|
-
*/
|
|
17
|
-
escapeNewlines?: boolean;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Escape characters within a value to make it safe to insert directly into a
|
|
21
|
-
* snippet. Takes options which define the escape requirements.
|
|
22
|
-
*
|
|
23
|
-
* This is closely based on the JSON-stringify string serialization algorithm,
|
|
24
|
-
* but generalized for other string delimiters (e.g. " or ') and different escape
|
|
25
|
-
* characters (e.g. Powershell uses `)
|
|
26
|
-
*
|
|
27
|
-
* See https://tc39.es/ecma262/multipage/structured-data.html#sec-quotejsonstring
|
|
28
|
-
* for the complete original algorithm.
|
|
29
|
-
*/
|
|
30
|
-
export declare function escapeString(rawValue: any, options?: EscapeOptions): string;
|
|
31
|
-
/**
|
|
32
|
-
* Make a string value safe to insert literally into a snippet within single quotes,
|
|
33
|
-
* by escaping problematic characters, including single quotes inside the string,
|
|
34
|
-
* backslashes, newlines, and other special characters.
|
|
35
|
-
*
|
|
36
|
-
* If value is not a string, it will be stringified with .toString() first.
|
|
37
|
-
*/
|
|
38
|
-
export declare const escapeForSingleQuotes: (value: any) => string;
|
|
39
|
-
/**
|
|
40
|
-
* Make a string value safe to insert literally into a snippet within double quotes,
|
|
41
|
-
* by escaping problematic characters, including double quotes inside the string,
|
|
42
|
-
* backslashes, newlines, and other special characters.
|
|
43
|
-
*
|
|
44
|
-
* If value is not a string, it will be stringified with .toString() first.
|
|
45
|
-
*/
|
|
46
|
-
export declare const escapeForDoubleQuotes: (value: any) => string;
|
package/dist/helpers/escape.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
-
if (!m) return o;
|
|
5
|
-
var i = m.call(o), r, ar = [], e;
|
|
6
|
-
try {
|
|
7
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
-
}
|
|
9
|
-
catch (error) { e = { error: error }; }
|
|
10
|
-
finally {
|
|
11
|
-
try {
|
|
12
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
-
}
|
|
14
|
-
finally { if (e) throw e.error; }
|
|
15
|
-
}
|
|
16
|
-
return ar;
|
|
17
|
-
};
|
|
18
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
20
|
-
if (ar || !(i in from)) {
|
|
21
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
22
|
-
ar[i] = from[i];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.escapeForDoubleQuotes = exports.escapeForSingleQuotes = exports.escapeString = void 0;
|
|
29
|
-
/**
|
|
30
|
-
* Escape characters within a value to make it safe to insert directly into a
|
|
31
|
-
* snippet. Takes options which define the escape requirements.
|
|
32
|
-
*
|
|
33
|
-
* This is closely based on the JSON-stringify string serialization algorithm,
|
|
34
|
-
* but generalized for other string delimiters (e.g. " or ') and different escape
|
|
35
|
-
* characters (e.g. Powershell uses `)
|
|
36
|
-
*
|
|
37
|
-
* See https://tc39.es/ecma262/multipage/structured-data.html#sec-quotejsonstring
|
|
38
|
-
* for the complete original algorithm.
|
|
39
|
-
*/
|
|
40
|
-
function escapeString(rawValue, options) {
|
|
41
|
-
if (options === void 0) { options = {}; }
|
|
42
|
-
var _a = options.delimiter, delimiter = _a === void 0 ? '"' : _a, _b = options.escapeChar, escapeChar = _b === void 0 ? '\\' : _b, _c = options.escapeNewlines, escapeNewlines = _c === void 0 ? true : _c;
|
|
43
|
-
var stringValue = rawValue.toString();
|
|
44
|
-
return __spreadArray([], __read(stringValue), false).map(function (c) {
|
|
45
|
-
if (c === '\b') {
|
|
46
|
-
return "".concat(escapeChar, "b");
|
|
47
|
-
}
|
|
48
|
-
else if (c === '\t') {
|
|
49
|
-
return "".concat(escapeChar, "t");
|
|
50
|
-
}
|
|
51
|
-
else if (c === '\n') {
|
|
52
|
-
if (escapeNewlines) {
|
|
53
|
-
return "".concat(escapeChar, "n");
|
|
54
|
-
}
|
|
55
|
-
return c; // Don't just continue, or this is caught by < \u0020
|
|
56
|
-
}
|
|
57
|
-
else if (c === '\f') {
|
|
58
|
-
return "".concat(escapeChar, "f");
|
|
59
|
-
}
|
|
60
|
-
else if (c === '\r') {
|
|
61
|
-
if (escapeNewlines) {
|
|
62
|
-
return "".concat(escapeChar, "r");
|
|
63
|
-
}
|
|
64
|
-
return c; // Don't just continue, or this is caught by < \u0020
|
|
65
|
-
}
|
|
66
|
-
else if (c === escapeChar) {
|
|
67
|
-
return escapeChar + escapeChar;
|
|
68
|
-
}
|
|
69
|
-
else if (c === delimiter) {
|
|
70
|
-
return escapeChar + delimiter;
|
|
71
|
-
}
|
|
72
|
-
else if (c < '\u0020' || c > '\u007E') {
|
|
73
|
-
// Delegate the trickier non-ASCII cases to the normal algorithm. Some of these
|
|
74
|
-
// are escaped as \uXXXX, whilst others are represented literally. Since we're
|
|
75
|
-
// using this primarily for header values that are generally (though not 100%
|
|
76
|
-
// strictly?) ASCII-only, this should almost never happen.
|
|
77
|
-
return JSON.stringify(c).slice(1, -1);
|
|
78
|
-
}
|
|
79
|
-
return c;
|
|
80
|
-
})
|
|
81
|
-
.join('');
|
|
82
|
-
}
|
|
83
|
-
exports.escapeString = escapeString;
|
|
84
|
-
/**
|
|
85
|
-
* Make a string value safe to insert literally into a snippet within single quotes,
|
|
86
|
-
* by escaping problematic characters, including single quotes inside the string,
|
|
87
|
-
* backslashes, newlines, and other special characters.
|
|
88
|
-
*
|
|
89
|
-
* If value is not a string, it will be stringified with .toString() first.
|
|
90
|
-
*/
|
|
91
|
-
var escapeForSingleQuotes = function (value) { return escapeString(value, { delimiter: "'" }); };
|
|
92
|
-
exports.escapeForSingleQuotes = escapeForSingleQuotes;
|
|
93
|
-
/**
|
|
94
|
-
* Make a string value safe to insert literally into a snippet within double quotes,
|
|
95
|
-
* by escaping problematic characters, including double quotes inside the string,
|
|
96
|
-
* backslashes, newlines, and other special characters.
|
|
97
|
-
*
|
|
98
|
-
* If value is not a string, it will be stringified with .toString() first.
|
|
99
|
-
*/
|
|
100
|
-
var escapeForDoubleQuotes = function (value) { return escapeString(value, { delimiter: '"' }); };
|
|
101
|
-
exports.escapeForDoubleQuotes = escapeForDoubleQuotes;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license https://raw.githubusercontent.com/node-fetch/node-fetch/master/LICENSE.md
|
|
3
|
-
*
|
|
4
|
-
* The MIT License (MIT)
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2016 - 2020 Node Fetch Team
|
|
7
|
-
*
|
|
8
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
-
* in the Software without restriction, including without limitation the rights
|
|
11
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
* furnished to do so, subject to the following conditions:
|
|
14
|
-
*
|
|
15
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
-
* copies or substantial portions of the Software.
|
|
17
|
-
*
|
|
18
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
-
* SOFTWARE.
|
|
25
|
-
*
|
|
26
|
-
* Extracted from https://github.com/node-fetch/node-fetch/blob/64c5c296a0250b852010746c76144cb9e14698d9/src/utils/form-data.js
|
|
27
|
-
*/
|
|
28
|
-
import type FormData from 'form-data';
|
|
29
|
-
export declare const isBlob: (object: any) => boolean;
|
|
30
|
-
export declare const formDataIterator: (form: FormData, boundary: string) => Generator<any, void, any>;
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license https://raw.githubusercontent.com/node-fetch/node-fetch/master/LICENSE.md
|
|
4
|
-
*
|
|
5
|
-
* The MIT License (MIT)
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) 2016 - 2020 Node Fetch Team
|
|
8
|
-
*
|
|
9
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
11
|
-
* in the Software without restriction, including without limitation the rights
|
|
12
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
14
|
-
* furnished to do so, subject to the following conditions:
|
|
15
|
-
*
|
|
16
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
17
|
-
* copies or substantial portions of the Software.
|
|
18
|
-
*
|
|
19
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
-
* SOFTWARE.
|
|
26
|
-
*
|
|
27
|
-
* Extracted from https://github.com/node-fetch/node-fetch/blob/64c5c296a0250b852010746c76144cb9e14698d9/src/utils/form-data.js
|
|
28
|
-
*/
|
|
29
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
30
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
31
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
32
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
33
|
-
function step(op) {
|
|
34
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
35
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
36
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
37
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
38
|
-
switch (op[0]) {
|
|
39
|
-
case 0: case 1: t = op; break;
|
|
40
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
41
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
42
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
43
|
-
default:
|
|
44
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
45
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
46
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
47
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
48
|
-
if (t[2]) _.ops.pop();
|
|
49
|
-
_.trys.pop(); continue;
|
|
50
|
-
}
|
|
51
|
-
op = body.call(thisArg, _);
|
|
52
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
53
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
var __values = (this && this.__values) || function(o) {
|
|
57
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
58
|
-
if (m) return m.call(o);
|
|
59
|
-
if (o && typeof o.length === "number") return {
|
|
60
|
-
next: function () {
|
|
61
|
-
if (o && i >= o.length) o = void 0;
|
|
62
|
-
return { value: o && o[i++], done: !o };
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
66
|
-
};
|
|
67
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
68
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
69
|
-
if (!m) return o;
|
|
70
|
-
var i = m.call(o), r, ar = [], e;
|
|
71
|
-
try {
|
|
72
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
73
|
-
}
|
|
74
|
-
catch (error) { e = { error: error }; }
|
|
75
|
-
finally {
|
|
76
|
-
try {
|
|
77
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
78
|
-
}
|
|
79
|
-
finally { if (e) throw e.error; }
|
|
80
|
-
}
|
|
81
|
-
return ar;
|
|
82
|
-
};
|
|
83
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
84
|
-
exports.formDataIterator = exports.isBlob = void 0;
|
|
85
|
-
var carriage = '\r\n';
|
|
86
|
-
var dashes = '-'.repeat(2);
|
|
87
|
-
var NAME = Symbol.toStringTag;
|
|
88
|
-
var isBlob = function (object) {
|
|
89
|
-
return typeof object === 'object' &&
|
|
90
|
-
typeof object.arrayBuffer === 'function' &&
|
|
91
|
-
typeof object.type === 'string' &&
|
|
92
|
-
typeof object.stream === 'function' &&
|
|
93
|
-
typeof object.constructor === 'function' &&
|
|
94
|
-
/^(Blob|File)$/.test(object[NAME]);
|
|
95
|
-
};
|
|
96
|
-
exports.isBlob = isBlob;
|
|
97
|
-
var getFooter = function (boundary) { return "".concat(dashes).concat(boundary).concat(dashes).concat(carriage.repeat(2)); };
|
|
98
|
-
var getHeader = function (boundary, name, field) {
|
|
99
|
-
var header = '';
|
|
100
|
-
header += "".concat(dashes).concat(boundary).concat(carriage);
|
|
101
|
-
header += "Content-Disposition: form-data; name=\"".concat(name, "\"");
|
|
102
|
-
if ((0, exports.isBlob)(field)) {
|
|
103
|
-
header += "; filename=\"".concat(field.name, "\"").concat(carriage);
|
|
104
|
-
header += "Content-Type: ".concat(field.type || 'application/octet-stream');
|
|
105
|
-
}
|
|
106
|
-
return "".concat(header).concat(carriage.repeat(2));
|
|
107
|
-
};
|
|
108
|
-
var formDataIterator = function (form, boundary) {
|
|
109
|
-
var form_1, form_1_1, _a, name, value, e_1_1;
|
|
110
|
-
var e_1, _b;
|
|
111
|
-
return __generator(this, function (_c) {
|
|
112
|
-
switch (_c.label) {
|
|
113
|
-
case 0:
|
|
114
|
-
_c.trys.push([0, 10, 11, 12]);
|
|
115
|
-
form_1 = __values(form), form_1_1 = form_1.next();
|
|
116
|
-
_c.label = 1;
|
|
117
|
-
case 1:
|
|
118
|
-
if (!!form_1_1.done) return [3 /*break*/, 9];
|
|
119
|
-
_a = __read(form_1_1.value, 2), name = _a[0], value = _a[1];
|
|
120
|
-
return [4 /*yield*/, getHeader(boundary, name, value)];
|
|
121
|
-
case 2:
|
|
122
|
-
_c.sent();
|
|
123
|
-
if (!(0, exports.isBlob)(value)) return [3 /*break*/, 4];
|
|
124
|
-
return [5 /*yield**/, __values(value.stream())];
|
|
125
|
-
case 3:
|
|
126
|
-
_c.sent();
|
|
127
|
-
return [3 /*break*/, 6];
|
|
128
|
-
case 4: return [4 /*yield*/, value];
|
|
129
|
-
case 5:
|
|
130
|
-
_c.sent();
|
|
131
|
-
_c.label = 6;
|
|
132
|
-
case 6: return [4 /*yield*/, carriage];
|
|
133
|
-
case 7:
|
|
134
|
-
_c.sent();
|
|
135
|
-
_c.label = 8;
|
|
136
|
-
case 8:
|
|
137
|
-
form_1_1 = form_1.next();
|
|
138
|
-
return [3 /*break*/, 1];
|
|
139
|
-
case 9: return [3 /*break*/, 12];
|
|
140
|
-
case 10:
|
|
141
|
-
e_1_1 = _c.sent();
|
|
142
|
-
e_1 = { error: e_1_1 };
|
|
143
|
-
return [3 /*break*/, 12];
|
|
144
|
-
case 11:
|
|
145
|
-
try {
|
|
146
|
-
if (form_1_1 && !form_1_1.done && (_b = form_1.return)) _b.call(form_1);
|
|
147
|
-
}
|
|
148
|
-
finally { if (e_1) throw e_1.error; }
|
|
149
|
-
return [7 /*endfinally*/];
|
|
150
|
-
case 12: return [4 /*yield*/, getFooter(boundary)];
|
|
151
|
-
case 13:
|
|
152
|
-
_c.sent();
|
|
153
|
-
return [2 /*return*/];
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
};
|
|
157
|
-
exports.formDataIterator = formDataIterator;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
type Headers<T> = Record<string, T>;
|
|
2
|
-
/**
|
|
3
|
-
* Given a headers object retrieve a specific header out of it via a case-insensitive key.
|
|
4
|
-
*/
|
|
5
|
-
export declare const getHeaderName: <T>(headers: Headers<T>, name: string) => string | undefined;
|
|
6
|
-
/**
|
|
7
|
-
* Given a headers object retrieve the contents of a header out of it via a case-insensitive key.
|
|
8
|
-
*/
|
|
9
|
-
export declare const getHeader: <T>(headers: Headers<T>, name: string) => T | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* Determine if a given case-insensitive header exists within a header object.
|
|
12
|
-
*/
|
|
13
|
-
export declare const hasHeader: <T>(headers: Headers<T>, name: string) => boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Determines if a given MIME type is JSON, or a variant of such.
|
|
16
|
-
*/
|
|
17
|
-
export declare const isMimeTypeJSON: (mimeType: string) => boolean;
|
|
18
|
-
export {};
|
package/dist/helpers/headers.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isMimeTypeJSON = exports.hasHeader = exports.getHeader = exports.getHeaderName = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Given a headers object retrieve a specific header out of it via a case-insensitive key.
|
|
6
|
-
*/
|
|
7
|
-
var getHeaderName = function (headers, name) {
|
|
8
|
-
return Object.keys(headers).find(function (header) { return header.toLowerCase() === name.toLowerCase(); });
|
|
9
|
-
};
|
|
10
|
-
exports.getHeaderName = getHeaderName;
|
|
11
|
-
/**
|
|
12
|
-
* Given a headers object retrieve the contents of a header out of it via a case-insensitive key.
|
|
13
|
-
*/
|
|
14
|
-
var getHeader = function (headers, name) {
|
|
15
|
-
var headerName = (0, exports.getHeaderName)(headers, name);
|
|
16
|
-
if (!headerName) {
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
return headers[headerName];
|
|
20
|
-
};
|
|
21
|
-
exports.getHeader = getHeader;
|
|
22
|
-
/**
|
|
23
|
-
* Determine if a given case-insensitive header exists within a header object.
|
|
24
|
-
*/
|
|
25
|
-
var hasHeader = function (headers, name) { return Boolean((0, exports.getHeaderName)(headers, name)); };
|
|
26
|
-
exports.hasHeader = hasHeader;
|
|
27
|
-
/**
|
|
28
|
-
* Determines if a given MIME type is JSON, or a variant of such.
|
|
29
|
-
*/
|
|
30
|
-
var isMimeTypeJSON = function (mimeType) {
|
|
31
|
-
return ['application/json', 'application/x-json', 'text/json', 'text/x-json', '+json'].some(function (type) { return mimeType.indexOf(type) > -1; });
|
|
32
|
-
};
|
|
33
|
-
exports.isMimeTypeJSON = isMimeTypeJSON;
|
package/dist/helpers/reducer.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reducer = void 0;
|
|
4
|
-
var reducer = function (accumulator, pair) {
|
|
5
|
-
var currentValue = accumulator[pair.name];
|
|
6
|
-
if (currentValue === undefined) {
|
|
7
|
-
accumulator[pair.name] = pair.value;
|
|
8
|
-
return accumulator;
|
|
9
|
-
}
|
|
10
|
-
// If we already have it as array just push the value
|
|
11
|
-
if (Array.isArray(currentValue)) {
|
|
12
|
-
currentValue.push(pair.value);
|
|
13
|
-
return accumulator;
|
|
14
|
-
}
|
|
15
|
-
// convert to array since now we have more than one value for this key
|
|
16
|
-
accumulator[pair.name] = [currentValue, pair.value];
|
|
17
|
-
return accumulator;
|
|
18
|
-
};
|
|
19
|
-
exports.reducer = reducer;
|
package/dist/helpers/shell.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Use 'strong quoting' using single quotes so that we only need to deal with nested single quote characters.
|
|
3
|
-
* see: http://wiki.bash-hackers.org/syntax/quoting#strong_quoting
|
|
4
|
-
*/
|
|
5
|
-
export declare const quote: (value?: string) => string;
|
|
6
|
-
export declare const escape: (value: string) => string;
|
package/dist/helpers/shell.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.escape = exports.quote = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Use 'strong quoting' using single quotes so that we only need to deal with nested single quote characters.
|
|
6
|
-
* see: http://wiki.bash-hackers.org/syntax/quoting#strong_quoting
|
|
7
|
-
*/
|
|
8
|
-
var quote = function (value) {
|
|
9
|
-
if (value === void 0) { value = ''; }
|
|
10
|
-
var safe = /^[a-z0-9-_/.@%^=:]+$/i;
|
|
11
|
-
var isShellSafe = safe.test(value);
|
|
12
|
-
if (isShellSafe) {
|
|
13
|
-
return value;
|
|
14
|
-
}
|
|
15
|
-
// if the value is not shell safe, then quote it
|
|
16
|
-
return "'".concat(value.replace(/'/g, "'\\''"), "'");
|
|
17
|
-
};
|
|
18
|
-
exports.quote = quote;
|
|
19
|
-
var escape = function (value) { return value.replace(/\r/g, '\\r').replace(/\n/g, '\\n'); };
|
|
20
|
-
exports.escape = escape;
|
package/dist/helpers/utils.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ClientInfo, TargetId, TargetInfo } from '../targets/targets';
|
|
2
|
-
export interface AvailableTarget extends TargetInfo {
|
|
3
|
-
clients: ClientInfo[];
|
|
4
|
-
}
|
|
5
|
-
export declare const availableTargets: () => AvailableTarget[];
|
|
6
|
-
export declare const extname: (targetId: TargetId) => "" | `.${string}`;
|