@aligent/cdk-prerender-proxy 0.2.9-alpha → 2.0.2-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/index.ts +29 -0
  2. package/lib/error-response-construct.ts +54 -0
  3. package/lib/handlers/cache-control.ts +1 -4
  4. package/lib/handlers/error-response.ts +0 -1
  5. package/lib/handlers/prerender.ts +2 -2
  6. package/lib/prerender-cf-cache-control-construct.ts +58 -0
  7. package/lib/prerender-check-construct.ts +43 -0
  8. package/lib/prerender-construct.ts +55 -0
  9. package/lib/prerender-lambda-construct.ts +48 -0
  10. package/package.json +17 -26
  11. package/index.d.ts +0 -6
  12. package/lib/error-response-construct.d.ts +0 -9
  13. package/lib/error-response-construct.js +0 -32
  14. package/lib/handlers/node_modules/.package-lock.json +0 -55
  15. package/lib/handlers/node_modules/@types/aws-lambda/LICENSE +0 -21
  16. package/lib/handlers/node_modules/@types/aws-lambda/README.md +0 -16
  17. package/lib/handlers/node_modules/@types/aws-lambda/common/api-gateway.d.ts +0 -79
  18. package/lib/handlers/node_modules/@types/aws-lambda/common/cloudfront.d.ts +0 -79
  19. package/lib/handlers/node_modules/@types/aws-lambda/handler.d.ts +0 -171
  20. package/lib/handlers/node_modules/@types/aws-lambda/index.d.ts +0 -85
  21. package/lib/handlers/node_modules/@types/aws-lambda/package.json +0 -210
  22. package/lib/handlers/node_modules/@types/aws-lambda/trigger/alb.d.ts +0 -48
  23. package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-authorizer.d.ts +0 -174
  24. package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts +0 -187
  25. package/lib/handlers/node_modules/@types/aws-lambda/trigger/appsync-resolver.d.ts +0 -51
  26. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudformation-custom-resource.d.ts +0 -68
  27. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-request.d.ts +0 -20
  28. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-response.d.ts +0 -21
  29. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-events.d.ts +0 -8
  30. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-logs.d.ts +0 -37
  31. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codebuild-cloudwatch-state.d.ts +0 -104
  32. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-action.d.ts +0 -31
  33. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-pipeline.d.ts +0 -32
  34. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-stage.d.ts +0 -23
  35. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch.d.ts +0 -11
  36. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline.d.ts +0 -55
  37. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/_common.d.ts +0 -41
  38. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/create-auth-challenge.d.ts +0 -22
  39. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-email-sender.d.ts +0 -86
  40. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-message.d.ts +0 -44
  41. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/define-auth-challenge.d.ts +0 -21
  42. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/index.d.ts +0 -119
  43. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-authentication.d.ts +0 -15
  44. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-confirmation.d.ts +0 -22
  45. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-authentication.d.ts +0 -15
  46. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-signup.d.ts +0 -31
  47. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-token-generation.d.ts +0 -45
  48. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/user-migration.d.ts +0 -39
  49. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/verify-auth-challenge-response.d.ts +0 -20
  50. package/lib/handlers/node_modules/@types/aws-lambda/trigger/connect-contact-flow.d.ts +0 -65
  51. package/lib/handlers/node_modules/@types/aws-lambda/trigger/dynamodb-stream.d.ts +0 -45
  52. package/lib/handlers/node_modules/@types/aws-lambda/trigger/eventbridge.d.ts +0 -18
  53. package/lib/handlers/node_modules/@types/aws-lambda/trigger/iot.d.ts +0 -28
  54. package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-firehose-transformation.d.ts +0 -45
  55. package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-stream.d.ts +0 -28
  56. package/lib/handlers/node_modules/@types/aws-lambda/trigger/lex.d.ts +0 -116
  57. package/lib/handlers/node_modules/@types/aws-lambda/trigger/msk.d.ts +0 -21
  58. package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3-batch.d.ts +0 -41
  59. package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3.d.ts +0 -60
  60. package/lib/handlers/node_modules/@types/aws-lambda/trigger/ses.d.ts +0 -103
  61. package/lib/handlers/node_modules/@types/aws-lambda/trigger/sns.d.ts +0 -38
  62. package/lib/handlers/node_modules/@types/aws-lambda/trigger/sqs.d.ts +0 -46
  63. package/lib/handlers/node_modules/@types/node/LICENSE +0 -21
  64. package/lib/handlers/node_modules/@types/node/README.md +0 -16
  65. package/lib/handlers/node_modules/@types/node/assert/strict.d.ts +0 -4
  66. package/lib/handlers/node_modules/@types/node/assert.d.ts +0 -124
  67. package/lib/handlers/node_modules/@types/node/async_hooks.d.ts +0 -226
  68. package/lib/handlers/node_modules/@types/node/base.d.ts +0 -19
  69. package/lib/handlers/node_modules/@types/node/buffer.d.ts +0 -84
  70. package/lib/handlers/node_modules/@types/node/child_process.d.ts +0 -526
  71. package/lib/handlers/node_modules/@types/node/cluster.d.ts +0 -262
  72. package/lib/handlers/node_modules/@types/node/console.d.ts +0 -133
  73. package/lib/handlers/node_modules/@types/node/constants.d.ts +0 -13
  74. package/lib/handlers/node_modules/@types/node/crypto.d.ts +0 -1580
  75. package/lib/handlers/node_modules/@types/node/dgram.d.ts +0 -141
  76. package/lib/handlers/node_modules/@types/node/diagnostic_channel.d.ts +0 -34
  77. package/lib/handlers/node_modules/@types/node/dns/promises.d.ts +0 -97
  78. package/lib/handlers/node_modules/@types/node/dns.d.ts +0 -322
  79. package/lib/handlers/node_modules/@types/node/domain.d.ts +0 -24
  80. package/lib/handlers/node_modules/@types/node/events.d.ts +0 -93
  81. package/lib/handlers/node_modules/@types/node/fs/promises.d.ts +0 -592
  82. package/lib/handlers/node_modules/@types/node/fs.d.ts +0 -2239
  83. package/lib/handlers/node_modules/@types/node/globals.d.ts +0 -655
  84. package/lib/handlers/node_modules/@types/node/globals.global.d.ts +0 -1
  85. package/lib/handlers/node_modules/@types/node/http.d.ts +0 -434
  86. package/lib/handlers/node_modules/@types/node/http2.d.ts +0 -976
  87. package/lib/handlers/node_modules/@types/node/https.d.ts +0 -36
  88. package/lib/handlers/node_modules/@types/node/index.d.ts +0 -58
  89. package/lib/handlers/node_modules/@types/node/inspector.d.ts +0 -3041
  90. package/lib/handlers/node_modules/@types/node/module.d.ts +0 -52
  91. package/lib/handlers/node_modules/@types/node/net.d.ts +0 -326
  92. package/lib/handlers/node_modules/@types/node/os.d.ts +0 -239
  93. package/lib/handlers/node_modules/@types/node/package.json +0 -232
  94. package/lib/handlers/node_modules/@types/node/path.d.ts +0 -163
  95. package/lib/handlers/node_modules/@types/node/perf_hooks.d.ts +0 -310
  96. package/lib/handlers/node_modules/@types/node/process.d.ts +0 -461
  97. package/lib/handlers/node_modules/@types/node/punycode.d.ts +0 -75
  98. package/lib/handlers/node_modules/@types/node/querystring.d.ts +0 -28
  99. package/lib/handlers/node_modules/@types/node/readline.d.ts +0 -192
  100. package/lib/handlers/node_modules/@types/node/repl.d.ts +0 -395
  101. package/lib/handlers/node_modules/@types/node/stream/promises.d.ts +0 -67
  102. package/lib/handlers/node_modules/@types/node/stream.d.ts +0 -471
  103. package/lib/handlers/node_modules/@types/node/string_decoder.d.ts +0 -7
  104. package/lib/handlers/node_modules/@types/node/timers/promises.d.ts +0 -21
  105. package/lib/handlers/node_modules/@types/node/timers.d.ts +0 -27
  106. package/lib/handlers/node_modules/@types/node/tls.d.ts +0 -793
  107. package/lib/handlers/node_modules/@types/node/trace_events.d.ts +0 -61
  108. package/lib/handlers/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
  109. package/lib/handlers/node_modules/@types/node/ts3.6/base.d.ts +0 -68
  110. package/lib/handlers/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  111. package/lib/handlers/node_modules/@types/node/tty.d.ts +0 -66
  112. package/lib/handlers/node_modules/@types/node/url.d.ts +0 -116
  113. package/lib/handlers/node_modules/@types/node/util/types.d.ts +0 -53
  114. package/lib/handlers/node_modules/@types/node/util.d.ts +0 -156
  115. package/lib/handlers/node_modules/@types/node/v8.d.ts +0 -198
  116. package/lib/handlers/node_modules/@types/node/vm.d.ts +0 -152
  117. package/lib/handlers/node_modules/@types/node/wasi.d.ts +0 -86
  118. package/lib/handlers/node_modules/@types/node/worker_threads.d.ts +0 -282
  119. package/lib/handlers/node_modules/@types/node/zlib.d.ts +0 -361
  120. package/lib/handlers/node_modules/axios/CHANGELOG.md +0 -685
  121. package/lib/handlers/node_modules/axios/LICENSE +0 -19
  122. package/lib/handlers/node_modules/axios/README.md +0 -800
  123. package/lib/handlers/node_modules/axios/UPGRADE_GUIDE.md +0 -162
  124. package/lib/handlers/node_modules/axios/dist/axios.js +0 -1756
  125. package/lib/handlers/node_modules/axios/dist/axios.map +0 -1
  126. package/lib/handlers/node_modules/axios/dist/axios.min.js +0 -3
  127. package/lib/handlers/node_modules/axios/dist/axios.min.map +0 -1
  128. package/lib/handlers/node_modules/axios/index.d.ts +0 -161
  129. package/lib/handlers/node_modules/axios/index.js +0 -1
  130. package/lib/handlers/node_modules/axios/lib/adapters/README.md +0 -37
  131. package/lib/handlers/node_modules/axios/lib/adapters/http.js +0 -303
  132. package/lib/handlers/node_modules/axios/lib/adapters/xhr.js +0 -179
  133. package/lib/handlers/node_modules/axios/lib/axios.js +0 -56
  134. package/lib/handlers/node_modules/axios/lib/cancel/Cancel.js +0 -19
  135. package/lib/handlers/node_modules/axios/lib/cancel/CancelToken.js +0 -57
  136. package/lib/handlers/node_modules/axios/lib/cancel/isCancel.js +0 -5
  137. package/lib/handlers/node_modules/axios/lib/core/Axios.js +0 -95
  138. package/lib/handlers/node_modules/axios/lib/core/InterceptorManager.js +0 -52
  139. package/lib/handlers/node_modules/axios/lib/core/README.md +0 -7
  140. package/lib/handlers/node_modules/axios/lib/core/buildFullPath.js +0 -20
  141. package/lib/handlers/node_modules/axios/lib/core/createError.js +0 -18
  142. package/lib/handlers/node_modules/axios/lib/core/dispatchRequest.js +0 -79
  143. package/lib/handlers/node_modules/axios/lib/core/enhanceError.js +0 -42
  144. package/lib/handlers/node_modules/axios/lib/core/mergeConfig.js +0 -87
  145. package/lib/handlers/node_modules/axios/lib/core/settle.js +0 -25
  146. package/lib/handlers/node_modules/axios/lib/core/transformData.js +0 -20
  147. package/lib/handlers/node_modules/axios/lib/defaults.js +0 -98
  148. package/lib/handlers/node_modules/axios/lib/helpers/README.md +0 -7
  149. package/lib/handlers/node_modules/axios/lib/helpers/bind.js +0 -11
  150. package/lib/handlers/node_modules/axios/lib/helpers/buildURL.js +0 -70
  151. package/lib/handlers/node_modules/axios/lib/helpers/combineURLs.js +0 -14
  152. package/lib/handlers/node_modules/axios/lib/helpers/cookies.js +0 -53
  153. package/lib/handlers/node_modules/axios/lib/helpers/deprecatedMethod.js +0 -24
  154. package/lib/handlers/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -14
  155. package/lib/handlers/node_modules/axios/lib/helpers/isAxiosError.js +0 -11
  156. package/lib/handlers/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -68
  157. package/lib/handlers/node_modules/axios/lib/helpers/normalizeHeaderName.js +0 -12
  158. package/lib/handlers/node_modules/axios/lib/helpers/parseHeaders.js +0 -53
  159. package/lib/handlers/node_modules/axios/lib/helpers/spread.js +0 -27
  160. package/lib/handlers/node_modules/axios/lib/utils.js +0 -351
  161. package/lib/handlers/node_modules/axios/package.json +0 -86
  162. package/lib/handlers/node_modules/buffer-from/LICENSE +0 -21
  163. package/lib/handlers/node_modules/buffer-from/index.js +0 -69
  164. package/lib/handlers/node_modules/buffer-from/package.json +0 -19
  165. package/lib/handlers/node_modules/buffer-from/readme.md +0 -69
  166. package/lib/handlers/node_modules/follow-redirects/LICENSE +0 -18
  167. package/lib/handlers/node_modules/follow-redirects/README.md +0 -148
  168. package/lib/handlers/node_modules/follow-redirects/debug.js +0 -14
  169. package/lib/handlers/node_modules/follow-redirects/http.js +0 -1
  170. package/lib/handlers/node_modules/follow-redirects/https.js +0 -1
  171. package/lib/handlers/node_modules/follow-redirects/index.js +0 -531
  172. package/lib/handlers/node_modules/follow-redirects/package.json +0 -59
  173. package/lib/handlers/node_modules/source-map/CHANGELOG.md +0 -301
  174. package/lib/handlers/node_modules/source-map/LICENSE +0 -28
  175. package/lib/handlers/node_modules/source-map/README.md +0 -742
  176. package/lib/handlers/node_modules/source-map/dist/source-map.debug.js +0 -3234
  177. package/lib/handlers/node_modules/source-map/dist/source-map.js +0 -3233
  178. package/lib/handlers/node_modules/source-map/dist/source-map.min.js +0 -2
  179. package/lib/handlers/node_modules/source-map/dist/source-map.min.js.map +0 -1
  180. package/lib/handlers/node_modules/source-map/lib/array-set.js +0 -121
  181. package/lib/handlers/node_modules/source-map/lib/base64-vlq.js +0 -140
  182. package/lib/handlers/node_modules/source-map/lib/base64.js +0 -67
  183. package/lib/handlers/node_modules/source-map/lib/binary-search.js +0 -111
  184. package/lib/handlers/node_modules/source-map/lib/mapping-list.js +0 -79
  185. package/lib/handlers/node_modules/source-map/lib/quick-sort.js +0 -114
  186. package/lib/handlers/node_modules/source-map/lib/source-map-consumer.js +0 -1145
  187. package/lib/handlers/node_modules/source-map/lib/source-map-generator.js +0 -425
  188. package/lib/handlers/node_modules/source-map/lib/source-node.js +0 -413
  189. package/lib/handlers/node_modules/source-map/lib/util.js +0 -488
  190. package/lib/handlers/node_modules/source-map/package.json +0 -73
  191. package/lib/handlers/node_modules/source-map/source-map.d.ts +0 -98
  192. package/lib/handlers/node_modules/source-map/source-map.js +0 -8
  193. package/lib/handlers/node_modules/source-map-support/LICENSE.md +0 -21
  194. package/lib/handlers/node_modules/source-map-support/README.md +0 -284
  195. package/lib/handlers/node_modules/source-map-support/browser-source-map-support.js +0 -114
  196. package/lib/handlers/node_modules/source-map-support/package.json +0 -31
  197. package/lib/handlers/node_modules/source-map-support/register.js +0 -1
  198. package/lib/handlers/node_modules/source-map-support/source-map-support.js +0 -604
  199. package/lib/handlers/package-lock.json +0 -108
  200. package/lib/handlers/package.json +0 -13
  201. package/lib/handlers/tsconfig.json +0 -22
  202. package/lib/prerender-cf-cache-control-construct.d.ts +0 -10
  203. package/lib/prerender-cf-cache-control-construct.js +0 -33
  204. package/lib/prerender-check-construct.d.ts +0 -6
  205. package/lib/prerender-check-construct.js +0 -25
  206. package/lib/prerender-construct.d.ts +0 -11
  207. package/lib/prerender-construct.js +0 -34
  208. package/lib/prerender-lambda-construct.d.ts +0 -17
  209. package/lib/prerender-lambda-construct.js +0 -19
@@ -1,351 +0,0 @@
1
- 'use strict';
2
-
3
- var bind = require('./helpers/bind');
4
-
5
- /*global toString:true*/
6
-
7
- // utils is a library of generic helper functions non-specific to axios
8
-
9
- var toString = Object.prototype.toString;
10
-
11
- /**
12
- * Determine if a value is an Array
13
- *
14
- * @param {Object} val The value to test
15
- * @returns {boolean} True if value is an Array, otherwise false
16
- */
17
- function isArray(val) {
18
- return toString.call(val) === '[object Array]';
19
- }
20
-
21
- /**
22
- * Determine if a value is undefined
23
- *
24
- * @param {Object} val The value to test
25
- * @returns {boolean} True if the value is undefined, otherwise false
26
- */
27
- function isUndefined(val) {
28
- return typeof val === 'undefined';
29
- }
30
-
31
- /**
32
- * Determine if a value is a Buffer
33
- *
34
- * @param {Object} val The value to test
35
- * @returns {boolean} True if value is a Buffer, otherwise false
36
- */
37
- function isBuffer(val) {
38
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
39
- && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
40
- }
41
-
42
- /**
43
- * Determine if a value is an ArrayBuffer
44
- *
45
- * @param {Object} val The value to test
46
- * @returns {boolean} True if value is an ArrayBuffer, otherwise false
47
- */
48
- function isArrayBuffer(val) {
49
- return toString.call(val) === '[object ArrayBuffer]';
50
- }
51
-
52
- /**
53
- * Determine if a value is a FormData
54
- *
55
- * @param {Object} val The value to test
56
- * @returns {boolean} True if value is an FormData, otherwise false
57
- */
58
- function isFormData(val) {
59
- return (typeof FormData !== 'undefined') && (val instanceof FormData);
60
- }
61
-
62
- /**
63
- * Determine if a value is a view on an ArrayBuffer
64
- *
65
- * @param {Object} val The value to test
66
- * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
67
- */
68
- function isArrayBufferView(val) {
69
- var result;
70
- if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
71
- result = ArrayBuffer.isView(val);
72
- } else {
73
- result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
74
- }
75
- return result;
76
- }
77
-
78
- /**
79
- * Determine if a value is a String
80
- *
81
- * @param {Object} val The value to test
82
- * @returns {boolean} True if value is a String, otherwise false
83
- */
84
- function isString(val) {
85
- return typeof val === 'string';
86
- }
87
-
88
- /**
89
- * Determine if a value is a Number
90
- *
91
- * @param {Object} val The value to test
92
- * @returns {boolean} True if value is a Number, otherwise false
93
- */
94
- function isNumber(val) {
95
- return typeof val === 'number';
96
- }
97
-
98
- /**
99
- * Determine if a value is an Object
100
- *
101
- * @param {Object} val The value to test
102
- * @returns {boolean} True if value is an Object, otherwise false
103
- */
104
- function isObject(val) {
105
- return val !== null && typeof val === 'object';
106
- }
107
-
108
- /**
109
- * Determine if a value is a plain Object
110
- *
111
- * @param {Object} val The value to test
112
- * @return {boolean} True if value is a plain Object, otherwise false
113
- */
114
- function isPlainObject(val) {
115
- if (toString.call(val) !== '[object Object]') {
116
- return false;
117
- }
118
-
119
- var prototype = Object.getPrototypeOf(val);
120
- return prototype === null || prototype === Object.prototype;
121
- }
122
-
123
- /**
124
- * Determine if a value is a Date
125
- *
126
- * @param {Object} val The value to test
127
- * @returns {boolean} True if value is a Date, otherwise false
128
- */
129
- function isDate(val) {
130
- return toString.call(val) === '[object Date]';
131
- }
132
-
133
- /**
134
- * Determine if a value is a File
135
- *
136
- * @param {Object} val The value to test
137
- * @returns {boolean} True if value is a File, otherwise false
138
- */
139
- function isFile(val) {
140
- return toString.call(val) === '[object File]';
141
- }
142
-
143
- /**
144
- * Determine if a value is a Blob
145
- *
146
- * @param {Object} val The value to test
147
- * @returns {boolean} True if value is a Blob, otherwise false
148
- */
149
- function isBlob(val) {
150
- return toString.call(val) === '[object Blob]';
151
- }
152
-
153
- /**
154
- * Determine if a value is a Function
155
- *
156
- * @param {Object} val The value to test
157
- * @returns {boolean} True if value is a Function, otherwise false
158
- */
159
- function isFunction(val) {
160
- return toString.call(val) === '[object Function]';
161
- }
162
-
163
- /**
164
- * Determine if a value is a Stream
165
- *
166
- * @param {Object} val The value to test
167
- * @returns {boolean} True if value is a Stream, otherwise false
168
- */
169
- function isStream(val) {
170
- return isObject(val) && isFunction(val.pipe);
171
- }
172
-
173
- /**
174
- * Determine if a value is a URLSearchParams object
175
- *
176
- * @param {Object} val The value to test
177
- * @returns {boolean} True if value is a URLSearchParams object, otherwise false
178
- */
179
- function isURLSearchParams(val) {
180
- return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
181
- }
182
-
183
- /**
184
- * Trim excess whitespace off the beginning and end of a string
185
- *
186
- * @param {String} str The String to trim
187
- * @returns {String} The String freed of excess whitespace
188
- */
189
- function trim(str) {
190
- return str.replace(/^\s*/, '').replace(/\s*$/, '');
191
- }
192
-
193
- /**
194
- * Determine if we're running in a standard browser environment
195
- *
196
- * This allows axios to run in a web worker, and react-native.
197
- * Both environments support XMLHttpRequest, but not fully standard globals.
198
- *
199
- * web workers:
200
- * typeof window -> undefined
201
- * typeof document -> undefined
202
- *
203
- * react-native:
204
- * navigator.product -> 'ReactNative'
205
- * nativescript
206
- * navigator.product -> 'NativeScript' or 'NS'
207
- */
208
- function isStandardBrowserEnv() {
209
- if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
210
- navigator.product === 'NativeScript' ||
211
- navigator.product === 'NS')) {
212
- return false;
213
- }
214
- return (
215
- typeof window !== 'undefined' &&
216
- typeof document !== 'undefined'
217
- );
218
- }
219
-
220
- /**
221
- * Iterate over an Array or an Object invoking a function for each item.
222
- *
223
- * If `obj` is an Array callback will be called passing
224
- * the value, index, and complete array for each item.
225
- *
226
- * If 'obj' is an Object callback will be called passing
227
- * the value, key, and complete object for each property.
228
- *
229
- * @param {Object|Array} obj The object to iterate
230
- * @param {Function} fn The callback to invoke for each item
231
- */
232
- function forEach(obj, fn) {
233
- // Don't bother if no value provided
234
- if (obj === null || typeof obj === 'undefined') {
235
- return;
236
- }
237
-
238
- // Force an array if not already something iterable
239
- if (typeof obj !== 'object') {
240
- /*eslint no-param-reassign:0*/
241
- obj = [obj];
242
- }
243
-
244
- if (isArray(obj)) {
245
- // Iterate over array values
246
- for (var i = 0, l = obj.length; i < l; i++) {
247
- fn.call(null, obj[i], i, obj);
248
- }
249
- } else {
250
- // Iterate over object keys
251
- for (var key in obj) {
252
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
253
- fn.call(null, obj[key], key, obj);
254
- }
255
- }
256
- }
257
- }
258
-
259
- /**
260
- * Accepts varargs expecting each argument to be an object, then
261
- * immutably merges the properties of each object and returns result.
262
- *
263
- * When multiple objects contain the same key the later object in
264
- * the arguments list will take precedence.
265
- *
266
- * Example:
267
- *
268
- * ```js
269
- * var result = merge({foo: 123}, {foo: 456});
270
- * console.log(result.foo); // outputs 456
271
- * ```
272
- *
273
- * @param {Object} obj1 Object to merge
274
- * @returns {Object} Result of all merge properties
275
- */
276
- function merge(/* obj1, obj2, obj3, ... */) {
277
- var result = {};
278
- function assignValue(val, key) {
279
- if (isPlainObject(result[key]) && isPlainObject(val)) {
280
- result[key] = merge(result[key], val);
281
- } else if (isPlainObject(val)) {
282
- result[key] = merge({}, val);
283
- } else if (isArray(val)) {
284
- result[key] = val.slice();
285
- } else {
286
- result[key] = val;
287
- }
288
- }
289
-
290
- for (var i = 0, l = arguments.length; i < l; i++) {
291
- forEach(arguments[i], assignValue);
292
- }
293
- return result;
294
- }
295
-
296
- /**
297
- * Extends object a by mutably adding to it the properties of object b.
298
- *
299
- * @param {Object} a The object to be extended
300
- * @param {Object} b The object to copy properties from
301
- * @param {Object} thisArg The object to bind function to
302
- * @return {Object} The resulting value of object a
303
- */
304
- function extend(a, b, thisArg) {
305
- forEach(b, function assignValue(val, key) {
306
- if (thisArg && typeof val === 'function') {
307
- a[key] = bind(val, thisArg);
308
- } else {
309
- a[key] = val;
310
- }
311
- });
312
- return a;
313
- }
314
-
315
- /**
316
- * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
317
- *
318
- * @param {string} content with BOM
319
- * @return {string} content value without BOM
320
- */
321
- function stripBOM(content) {
322
- if (content.charCodeAt(0) === 0xFEFF) {
323
- content = content.slice(1);
324
- }
325
- return content;
326
- }
327
-
328
- module.exports = {
329
- isArray: isArray,
330
- isArrayBuffer: isArrayBuffer,
331
- isBuffer: isBuffer,
332
- isFormData: isFormData,
333
- isArrayBufferView: isArrayBufferView,
334
- isString: isString,
335
- isNumber: isNumber,
336
- isObject: isObject,
337
- isPlainObject: isPlainObject,
338
- isUndefined: isUndefined,
339
- isDate: isDate,
340
- isFile: isFile,
341
- isBlob: isBlob,
342
- isFunction: isFunction,
343
- isStream: isStream,
344
- isURLSearchParams: isURLSearchParams,
345
- isStandardBrowserEnv: isStandardBrowserEnv,
346
- forEach: forEach,
347
- merge: merge,
348
- extend: extend,
349
- trim: trim,
350
- stripBOM: stripBOM
351
- };
@@ -1,86 +0,0 @@
1
- {
2
- "name": "axios",
3
- "version": "0.21.1",
4
- "description": "Promise based HTTP client for the browser and node.js",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "grunt test && bundlesize",
8
- "start": "node ./sandbox/server.js",
9
- "build": "NODE_ENV=production grunt build",
10
- "preversion": "npm test",
11
- "version": "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",
12
- "postversion": "git push && git push --tags",
13
- "examples": "node ./examples/server.js",
14
- "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
15
- "fix": "eslint --fix lib/**/*.js"
16
- },
17
- "repository": {
18
- "type": "git",
19
- "url": "https://github.com/axios/axios.git"
20
- },
21
- "keywords": [
22
- "xhr",
23
- "http",
24
- "ajax",
25
- "promise",
26
- "node"
27
- ],
28
- "author": "Matt Zabriskie",
29
- "license": "MIT",
30
- "bugs": {
31
- "url": "https://github.com/axios/axios/issues"
32
- },
33
- "homepage": "https://github.com/axios/axios",
34
- "devDependencies": {
35
- "bundlesize": "^0.17.0",
36
- "coveralls": "^3.0.0",
37
- "es6-promise": "^4.2.4",
38
- "grunt": "^1.0.2",
39
- "grunt-banner": "^0.6.0",
40
- "grunt-cli": "^1.2.0",
41
- "grunt-contrib-clean": "^1.1.0",
42
- "grunt-contrib-watch": "^1.0.0",
43
- "grunt-eslint": "^20.1.0",
44
- "grunt-karma": "^2.0.0",
45
- "grunt-mocha-test": "^0.13.3",
46
- "grunt-ts": "^6.0.0-beta.19",
47
- "grunt-webpack": "^1.0.18",
48
- "istanbul-instrumenter-loader": "^1.0.0",
49
- "jasmine-core": "^2.4.1",
50
- "karma": "^1.3.0",
51
- "karma-chrome-launcher": "^2.2.0",
52
- "karma-coverage": "^1.1.1",
53
- "karma-firefox-launcher": "^1.1.0",
54
- "karma-jasmine": "^1.1.1",
55
- "karma-jasmine-ajax": "^0.1.13",
56
- "karma-opera-launcher": "^1.0.0",
57
- "karma-safari-launcher": "^1.0.0",
58
- "karma-sauce-launcher": "^1.2.0",
59
- "karma-sinon": "^1.0.5",
60
- "karma-sourcemap-loader": "^0.3.7",
61
- "karma-webpack": "^1.7.0",
62
- "load-grunt-tasks": "^3.5.2",
63
- "minimist": "^1.2.0",
64
- "mocha": "^5.2.0",
65
- "sinon": "^4.5.0",
66
- "typescript": "^2.8.1",
67
- "url-search-params": "^0.10.0",
68
- "webpack": "^1.13.1",
69
- "webpack-dev-server": "^1.14.1"
70
- },
71
- "browser": {
72
- "./lib/adapters/http.js": "./lib/adapters/xhr.js"
73
- },
74
- "jsdelivr": "dist/axios.min.js",
75
- "unpkg": "dist/axios.min.js",
76
- "typings": "./index.d.ts",
77
- "dependencies": {
78
- "follow-redirects": "^1.10.0"
79
- },
80
- "bundlesize": [
81
- {
82
- "path": "./dist/axios.min.js",
83
- "threshold": "5kB"
84
- }
85
- ]
86
- }
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2016, 2018 Linus Unnebäck
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,69 +0,0 @@
1
- var toString = Object.prototype.toString
2
-
3
- var isModern = (
4
- typeof Buffer.alloc === 'function' &&
5
- typeof Buffer.allocUnsafe === 'function' &&
6
- typeof Buffer.from === 'function'
7
- )
8
-
9
- function isArrayBuffer (input) {
10
- return toString.call(input).slice(8, -1) === 'ArrayBuffer'
11
- }
12
-
13
- function fromArrayBuffer (obj, byteOffset, length) {
14
- byteOffset >>>= 0
15
-
16
- var maxLength = obj.byteLength - byteOffset
17
-
18
- if (maxLength < 0) {
19
- throw new RangeError("'offset' is out of bounds")
20
- }
21
-
22
- if (length === undefined) {
23
- length = maxLength
24
- } else {
25
- length >>>= 0
26
-
27
- if (length > maxLength) {
28
- throw new RangeError("'length' is out of bounds")
29
- }
30
- }
31
-
32
- return isModern
33
- ? Buffer.from(obj.slice(byteOffset, byteOffset + length))
34
- : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)))
35
- }
36
-
37
- function fromString (string, encoding) {
38
- if (typeof encoding !== 'string' || encoding === '') {
39
- encoding = 'utf8'
40
- }
41
-
42
- if (!Buffer.isEncoding(encoding)) {
43
- throw new TypeError('"encoding" must be a valid string encoding')
44
- }
45
-
46
- return isModern
47
- ? Buffer.from(string, encoding)
48
- : new Buffer(string, encoding)
49
- }
50
-
51
- function bufferFrom (value, encodingOrOffset, length) {
52
- if (typeof value === 'number') {
53
- throw new TypeError('"value" argument must not be a number')
54
- }
55
-
56
- if (isArrayBuffer(value)) {
57
- return fromArrayBuffer(value, encodingOrOffset, length)
58
- }
59
-
60
- if (typeof value === 'string') {
61
- return fromString(value, encodingOrOffset)
62
- }
63
-
64
- return isModern
65
- ? Buffer.from(value)
66
- : new Buffer(value)
67
- }
68
-
69
- module.exports = bufferFrom
@@ -1,19 +0,0 @@
1
- {
2
- "name": "buffer-from",
3
- "version": "1.1.1",
4
- "license": "MIT",
5
- "repository": "LinusU/buffer-from",
6
- "files": [
7
- "index.js"
8
- ],
9
- "scripts": {
10
- "test": "standard && node test"
11
- },
12
- "devDependencies": {
13
- "standard": "^7.1.2"
14
- },
15
- "keywords": [
16
- "buffer",
17
- "buffer from"
18
- ]
19
- }
@@ -1,69 +0,0 @@
1
- # Buffer From
2
-
3
- A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available.
4
-
5
- ## Installation
6
-
7
- ```sh
8
- npm install --save buffer-from
9
- ```
10
-
11
- ## Usage
12
-
13
- ```js
14
- const bufferFrom = require('buffer-from')
15
-
16
- console.log(bufferFrom([1, 2, 3, 4]))
17
- //=> <Buffer 01 02 03 04>
18
-
19
- const arr = new Uint8Array([1, 2, 3, 4])
20
- console.log(bufferFrom(arr.buffer, 1, 2))
21
- //=> <Buffer 02 03>
22
-
23
- console.log(bufferFrom('test', 'utf8'))
24
- //=> <Buffer 74 65 73 74>
25
-
26
- const buf = bufferFrom('test')
27
- console.log(bufferFrom(buf))
28
- //=> <Buffer 74 65 73 74>
29
- ```
30
-
31
- ## API
32
-
33
- ### bufferFrom(array)
34
-
35
- - `array` &lt;Array&gt;
36
-
37
- Allocates a new `Buffer` using an `array` of octets.
38
-
39
- ### bufferFrom(arrayBuffer[, byteOffset[, length]])
40
-
41
- - `arrayBuffer` &lt;ArrayBuffer&gt; The `.buffer` property of a TypedArray or ArrayBuffer
42
- - `byteOffset` &lt;Integer&gt; Where to start copying from `arrayBuffer`. **Default:** `0`
43
- - `length` &lt;Integer&gt; How many bytes to copy from `arrayBuffer`. **Default:** `arrayBuffer.length - byteOffset`
44
-
45
- When passed a reference to the `.buffer` property of a TypedArray instance, the
46
- newly created `Buffer` will share the same allocated memory as the TypedArray.
47
-
48
- The optional `byteOffset` and `length` arguments specify a memory range within
49
- the `arrayBuffer` that will be shared by the `Buffer`.
50
-
51
- ### bufferFrom(buffer)
52
-
53
- - `buffer` &lt;Buffer&gt; An existing `Buffer` to copy data from
54
-
55
- Copies the passed `buffer` data onto a new `Buffer` instance.
56
-
57
- ### bufferFrom(string[, encoding])
58
-
59
- - `string` &lt;String&gt; A string to encode.
60
- - `encoding` &lt;String&gt; The encoding of `string`. **Default:** `'utf8'`
61
-
62
- Creates a new `Buffer` containing the given JavaScript string `string`. If
63
- provided, the `encoding` parameter identifies the character encoding of
64
- `string`.
65
-
66
- ## See also
67
-
68
- - [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc`
69
- - [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe`
@@ -1,18 +0,0 @@
1
- Copyright 2014–present Olivier Lalonde <olalonde@gmail.com>, James Talmage <james@talmage.io>, Ruben Verborgh
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of
4
- this software and associated documentation files (the "Software"), to deal in
5
- the Software without restriction, including without limitation the rights to
6
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
- of the Software, and to permit persons to whom the Software is furnished to do
8
- so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
18
- IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.