@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,7 +0,0 @@
1
- # axios // helpers
2
-
3
- The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like:
4
-
5
- - Browser polyfills
6
- - Managing cookies
7
- - Parsing HTTP headers
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = function bind(fn, thisArg) {
4
- return function wrap() {
5
- var args = new Array(arguments.length);
6
- for (var i = 0; i < args.length; i++) {
7
- args[i] = arguments[i];
8
- }
9
- return fn.apply(thisArg, args);
10
- };
11
- };
@@ -1,70 +0,0 @@
1
- 'use strict';
2
-
3
- var utils = require('./../utils');
4
-
5
- function encode(val) {
6
- return encodeURIComponent(val).
7
- replace(/%3A/gi, ':').
8
- replace(/%24/g, '$').
9
- replace(/%2C/gi, ',').
10
- replace(/%20/g, '+').
11
- replace(/%5B/gi, '[').
12
- replace(/%5D/gi, ']');
13
- }
14
-
15
- /**
16
- * Build a URL by appending params to the end
17
- *
18
- * @param {string} url The base of the url (e.g., http://www.google.com)
19
- * @param {object} [params] The params to be appended
20
- * @returns {string} The formatted url
21
- */
22
- module.exports = function buildURL(url, params, paramsSerializer) {
23
- /*eslint no-param-reassign:0*/
24
- if (!params) {
25
- return url;
26
- }
27
-
28
- var serializedParams;
29
- if (paramsSerializer) {
30
- serializedParams = paramsSerializer(params);
31
- } else if (utils.isURLSearchParams(params)) {
32
- serializedParams = params.toString();
33
- } else {
34
- var parts = [];
35
-
36
- utils.forEach(params, function serialize(val, key) {
37
- if (val === null || typeof val === 'undefined') {
38
- return;
39
- }
40
-
41
- if (utils.isArray(val)) {
42
- key = key + '[]';
43
- } else {
44
- val = [val];
45
- }
46
-
47
- utils.forEach(val, function parseValue(v) {
48
- if (utils.isDate(v)) {
49
- v = v.toISOString();
50
- } else if (utils.isObject(v)) {
51
- v = JSON.stringify(v);
52
- }
53
- parts.push(encode(key) + '=' + encode(v));
54
- });
55
- });
56
-
57
- serializedParams = parts.join('&');
58
- }
59
-
60
- if (serializedParams) {
61
- var hashmarkIndex = url.indexOf('#');
62
- if (hashmarkIndex !== -1) {
63
- url = url.slice(0, hashmarkIndex);
64
- }
65
-
66
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
67
- }
68
-
69
- return url;
70
- };
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Creates a new URL by combining the specified URLs
5
- *
6
- * @param {string} baseURL The base URL
7
- * @param {string} relativeURL The relative URL
8
- * @returns {string} The combined URL
9
- */
10
- module.exports = function combineURLs(baseURL, relativeURL) {
11
- return relativeURL
12
- ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
13
- : baseURL;
14
- };
@@ -1,53 +0,0 @@
1
- 'use strict';
2
-
3
- var utils = require('./../utils');
4
-
5
- module.exports = (
6
- utils.isStandardBrowserEnv() ?
7
-
8
- // Standard browser envs support document.cookie
9
- (function standardBrowserEnv() {
10
- return {
11
- write: function write(name, value, expires, path, domain, secure) {
12
- var cookie = [];
13
- cookie.push(name + '=' + encodeURIComponent(value));
14
-
15
- if (utils.isNumber(expires)) {
16
- cookie.push('expires=' + new Date(expires).toGMTString());
17
- }
18
-
19
- if (utils.isString(path)) {
20
- cookie.push('path=' + path);
21
- }
22
-
23
- if (utils.isString(domain)) {
24
- cookie.push('domain=' + domain);
25
- }
26
-
27
- if (secure === true) {
28
- cookie.push('secure');
29
- }
30
-
31
- document.cookie = cookie.join('; ');
32
- },
33
-
34
- read: function read(name) {
35
- var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
36
- return (match ? decodeURIComponent(match[3]) : null);
37
- },
38
-
39
- remove: function remove(name) {
40
- this.write(name, '', Date.now() - 86400000);
41
- }
42
- };
43
- })() :
44
-
45
- // Non standard browser env (web workers, react-native) lack needed support.
46
- (function nonStandardBrowserEnv() {
47
- return {
48
- write: function write() {},
49
- read: function read() { return null; },
50
- remove: function remove() {}
51
- };
52
- })()
53
- );
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- /*eslint no-console:0*/
4
-
5
- /**
6
- * Supply a warning to the developer that a method they are using
7
- * has been deprecated.
8
- *
9
- * @param {string} method The name of the deprecated method
10
- * @param {string} [instead] The alternate method to use if applicable
11
- * @param {string} [docs] The documentation URL to get further details
12
- */
13
- module.exports = function deprecatedMethod(method, instead, docs) {
14
- try {
15
- console.warn(
16
- 'DEPRECATED method `' + method + '`.' +
17
- (instead ? ' Use `' + instead + '` instead.' : '') +
18
- ' This method will be removed in a future release.');
19
-
20
- if (docs) {
21
- console.warn('For more information about usage see ' + docs);
22
- }
23
- } catch (e) { /* Ignore */ }
24
- };
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Determines whether the specified URL is absolute
5
- *
6
- * @param {string} url The URL to test
7
- * @returns {boolean} True if the specified URL is absolute, otherwise false
8
- */
9
- module.exports = function isAbsoluteURL(url) {
10
- // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
11
- // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
12
- // by any combination of letters, digits, plus, period, or hyphen.
13
- return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
14
- };
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Determines whether the payload is an error thrown by Axios
5
- *
6
- * @param {*} payload The value to test
7
- * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
8
- */
9
- module.exports = function isAxiosError(payload) {
10
- return (typeof payload === 'object') && (payload.isAxiosError === true);
11
- };
@@ -1,68 +0,0 @@
1
- 'use strict';
2
-
3
- var utils = require('./../utils');
4
-
5
- module.exports = (
6
- utils.isStandardBrowserEnv() ?
7
-
8
- // Standard browser envs have full support of the APIs needed to test
9
- // whether the request URL is of the same origin as current location.
10
- (function standardBrowserEnv() {
11
- var msie = /(msie|trident)/i.test(navigator.userAgent);
12
- var urlParsingNode = document.createElement('a');
13
- var originURL;
14
-
15
- /**
16
- * Parse a URL to discover it's components
17
- *
18
- * @param {String} url The URL to be parsed
19
- * @returns {Object}
20
- */
21
- function resolveURL(url) {
22
- var href = url;
23
-
24
- if (msie) {
25
- // IE needs attribute set twice to normalize properties
26
- urlParsingNode.setAttribute('href', href);
27
- href = urlParsingNode.href;
28
- }
29
-
30
- urlParsingNode.setAttribute('href', href);
31
-
32
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
33
- return {
34
- href: urlParsingNode.href,
35
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
36
- host: urlParsingNode.host,
37
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
38
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
39
- hostname: urlParsingNode.hostname,
40
- port: urlParsingNode.port,
41
- pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
42
- urlParsingNode.pathname :
43
- '/' + urlParsingNode.pathname
44
- };
45
- }
46
-
47
- originURL = resolveURL(window.location.href);
48
-
49
- /**
50
- * Determine if a URL shares the same origin as the current location
51
- *
52
- * @param {String} requestURL The URL to test
53
- * @returns {boolean} True if URL shares the same origin, otherwise false
54
- */
55
- return function isURLSameOrigin(requestURL) {
56
- var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
57
- return (parsed.protocol === originURL.protocol &&
58
- parsed.host === originURL.host);
59
- };
60
- })() :
61
-
62
- // Non standard browser envs (web workers, react-native) lack needed support.
63
- (function nonStandardBrowserEnv() {
64
- return function isURLSameOrigin() {
65
- return true;
66
- };
67
- })()
68
- );
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var utils = require('../utils');
4
-
5
- module.exports = function normalizeHeaderName(headers, normalizedName) {
6
- utils.forEach(headers, function processHeader(value, name) {
7
- if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
8
- headers[normalizedName] = value;
9
- delete headers[name];
10
- }
11
- });
12
- };
@@ -1,53 +0,0 @@
1
- 'use strict';
2
-
3
- var utils = require('./../utils');
4
-
5
- // Headers whose duplicates are ignored by node
6
- // c.f. https://nodejs.org/api/http.html#http_message_headers
7
- var ignoreDuplicateOf = [
8
- 'age', 'authorization', 'content-length', 'content-type', 'etag',
9
- 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
10
- 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
11
- 'referer', 'retry-after', 'user-agent'
12
- ];
13
-
14
- /**
15
- * Parse headers into an object
16
- *
17
- * ```
18
- * Date: Wed, 27 Aug 2014 08:58:49 GMT
19
- * Content-Type: application/json
20
- * Connection: keep-alive
21
- * Transfer-Encoding: chunked
22
- * ```
23
- *
24
- * @param {String} headers Headers needing to be parsed
25
- * @returns {Object} Headers parsed into an object
26
- */
27
- module.exports = function parseHeaders(headers) {
28
- var parsed = {};
29
- var key;
30
- var val;
31
- var i;
32
-
33
- if (!headers) { return parsed; }
34
-
35
- utils.forEach(headers.split('\n'), function parser(line) {
36
- i = line.indexOf(':');
37
- key = utils.trim(line.substr(0, i)).toLowerCase();
38
- val = utils.trim(line.substr(i + 1));
39
-
40
- if (key) {
41
- if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
42
- return;
43
- }
44
- if (key === 'set-cookie') {
45
- parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
46
- } else {
47
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
48
- }
49
- }
50
- });
51
-
52
- return parsed;
53
- };
@@ -1,27 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Syntactic sugar for invoking a function and expanding an array for arguments.
5
- *
6
- * Common use case would be to use `Function.prototype.apply`.
7
- *
8
- * ```js
9
- * function f(x, y, z) {}
10
- * var args = [1, 2, 3];
11
- * f.apply(null, args);
12
- * ```
13
- *
14
- * With `spread` this example can be re-written.
15
- *
16
- * ```js
17
- * spread(function(x, y, z) {})([1, 2, 3]);
18
- * ```
19
- *
20
- * @param {Function} callback
21
- * @returns {Function}
22
- */
23
- module.exports = function spread(callback) {
24
- return function wrap(arr) {
25
- return callback.apply(null, arr);
26
- };
27
- };