typespeed 2.0.21 → 2.0.23

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 (219) hide show
  1. package/dist/core.decorator.js +1 -30
  2. package/dist/default/default-authentication.class.js +25 -0
  3. package/dist/default/express-server.class.js +11 -4
  4. package/dist/default/log-default.class.js +0 -6
  5. package/dist/factory/authentication-factory.class.js +11 -0
  6. package/dist/factory/log-factory.class.js +9 -0
  7. package/dist/route.decorator.js +92 -2
  8. package/dist/typespeed.d.ts +40 -3
  9. package/dist/typespeed.js +3 -1
  10. package/package.json +1 -1
  11. package/src/core.decorator.ts +1 -29
  12. package/src/default/default-authentication.class.ts +10 -0
  13. package/src/default/express-server.class.ts +12 -5
  14. package/src/default/log-default.class.ts +0 -10
  15. package/src/factory/authentication-factory.class.ts +9 -0
  16. package/src/factory/log-factory.class.ts +9 -2
  17. package/src/route.decorator.ts +91 -3
  18. package/src/typespeed.d.ts +40 -3
  19. package/src/typespeed.ts +1 -0
  20. package/test/node_modules/.package-lock.json +65 -101
  21. package/test/node_modules/@types/body-parser/LICENSE +21 -0
  22. package/test/node_modules/@types/body-parser/README.md +16 -0
  23. package/test/node_modules/@types/body-parser/index.d.ts +107 -0
  24. package/test/node_modules/@types/body-parser/package.json +58 -0
  25. package/test/node_modules/@types/connect/LICENSE +21 -0
  26. package/test/node_modules/@types/connect/README.md +16 -0
  27. package/test/node_modules/@types/connect/index.d.ts +93 -0
  28. package/test/node_modules/@types/connect/package.json +32 -0
  29. package/test/node_modules/@types/express/LICENSE +21 -0
  30. package/test/node_modules/@types/express/README.md +16 -0
  31. package/test/node_modules/@types/express/index.d.ts +136 -0
  32. package/test/node_modules/@types/express/package.json +45 -0
  33. package/test/node_modules/@types/express-serve-static-core/LICENSE +21 -0
  34. package/test/node_modules/@types/express-serve-static-core/README.md +16 -0
  35. package/test/node_modules/@types/express-serve-static-core/index.d.ts +1281 -0
  36. package/test/node_modules/@types/express-serve-static-core/package.json +55 -0
  37. package/test/node_modules/@types/mime/LICENSE +21 -0
  38. package/test/node_modules/@types/mime/Mime.d.ts +10 -0
  39. package/test/node_modules/@types/mime/README.md +16 -0
  40. package/test/node_modules/@types/mime/index.d.ts +35 -0
  41. package/test/node_modules/@types/mime/lite.d.ts +7 -0
  42. package/test/node_modules/@types/mime/package.json +29 -0
  43. package/test/node_modules/@types/qs/LICENSE +21 -0
  44. package/test/node_modules/@types/qs/README.md +16 -0
  45. package/test/node_modules/@types/qs/index.d.ts +62 -0
  46. package/test/node_modules/@types/qs/package.json +65 -0
  47. package/test/node_modules/@types/range-parser/LICENSE +21 -0
  48. package/test/node_modules/@types/range-parser/README.md +55 -0
  49. package/test/node_modules/@types/range-parser/index.d.ts +35 -0
  50. package/test/node_modules/@types/range-parser/package.json +25 -0
  51. package/test/node_modules/@types/send/LICENSE +21 -0
  52. package/test/node_modules/@types/send/README.md +16 -0
  53. package/test/node_modules/@types/send/index.d.ts +231 -0
  54. package/test/node_modules/@types/send/package.json +33 -0
  55. package/test/node_modules/@types/serve-static/LICENSE +21 -0
  56. package/test/node_modules/@types/serve-static/README.md +16 -0
  57. package/test/node_modules/@types/serve-static/index.d.ts +113 -0
  58. package/test/node_modules/@types/serve-static/package.json +38 -0
  59. package/test/src/config.json +5 -0
  60. package/test/src/custom-log.class.ts +6 -0
  61. package/test/src/jwt-authentication.class.ts +29 -0
  62. package/test/src/test-request.class.ts +36 -0
  63. package/test/node_modules/@acuminous/bitsyntax/.github/workflows/node-js-ci.yml +0 -17
  64. package/test/node_modules/@acuminous/bitsyntax/.github/workflows/node-js-publish.yml +0 -30
  65. package/test/node_modules/@acuminous/bitsyntax/LICENSE +0 -6
  66. package/test/node_modules/@acuminous/bitsyntax/LICENSE-MIT +0 -21
  67. package/test/node_modules/@acuminous/bitsyntax/Makefile +0 -15
  68. package/test/node_modules/@acuminous/bitsyntax/README.md +0 -308
  69. package/test/node_modules/@acuminous/bitsyntax/index.js +0 -10
  70. package/test/node_modules/@acuminous/bitsyntax/lib/compile.js +0 -303
  71. package/test/node_modules/@acuminous/bitsyntax/lib/constructor.js +0 -142
  72. package/test/node_modules/@acuminous/bitsyntax/lib/grammar.pegjs +0 -67
  73. package/test/node_modules/@acuminous/bitsyntax/lib/interp.js +0 -232
  74. package/test/node_modules/@acuminous/bitsyntax/lib/parse.js +0 -32
  75. package/test/node_modules/@acuminous/bitsyntax/lib/parser.js +0 -1173
  76. package/test/node_modules/@acuminous/bitsyntax/lib/pattern.js +0 -119
  77. package/test/node_modules/@acuminous/bitsyntax/package.json +0 -36
  78. package/test/node_modules/@acuminous/bitsyntax/test/consing.test.js +0 -50
  79. package/test/node_modules/@acuminous/bitsyntax/test/matching.test.js +0 -193
  80. package/test/node_modules/amqplib/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
  81. package/test/node_modules/amqplib/.github/workflows/test.yml +0 -38
  82. package/test/node_modules/amqplib/CHANGELOG.md +0 -430
  83. package/test/node_modules/amqplib/LICENSE +0 -6
  84. package/test/node_modules/amqplib/LICENSE-MIT +0 -21
  85. package/test/node_modules/amqplib/Makefile +0 -47
  86. package/test/node_modules/amqplib/README.md +0 -157
  87. package/test/node_modules/amqplib/bin/generate-defs.js +0 -722
  88. package/test/node_modules/amqplib/callback_api.js +0 -22
  89. package/test/node_modules/amqplib/channel_api.js +0 -16
  90. package/test/node_modules/amqplib/examples/headers.js +0 -42
  91. package/test/node_modules/amqplib/examples/receive_generator.js +0 -39
  92. package/test/node_modules/amqplib/examples/send_generators.js +0 -42
  93. package/test/node_modules/amqplib/examples/ssl.js +0 -64
  94. package/test/node_modules/amqplib/examples/tutorials/README.md +0 -93
  95. package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log.js +0 -28
  96. package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log_direct.js +0 -30
  97. package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log_topic.js +0 -27
  98. package/test/node_modules/amqplib/examples/tutorials/callback_api/new_task.js +0 -27
  99. package/test/node_modules/amqplib/examples/tutorials/callback_api/receive.js +0 -30
  100. package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs.js +0 -36
  101. package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs_direct.js +0 -56
  102. package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs_topic.js +0 -55
  103. package/test/node_modules/amqplib/examples/tutorials/callback_api/rpc_client.js +0 -49
  104. package/test/node_modules/amqplib/examples/tutorials/callback_api/rpc_server.js +0 -45
  105. package/test/node_modules/amqplib/examples/tutorials/callback_api/send.js +0 -29
  106. package/test/node_modules/amqplib/examples/tutorials/callback_api/worker.js +0 -35
  107. package/test/node_modules/amqplib/examples/tutorials/emit_log.js +0 -19
  108. package/test/node_modules/amqplib/examples/tutorials/emit_log_direct.js +0 -20
  109. package/test/node_modules/amqplib/examples/tutorials/emit_log_topic.js +0 -19
  110. package/test/node_modules/amqplib/examples/tutorials/new_task.js +0 -18
  111. package/test/node_modules/amqplib/examples/tutorials/package.json +0 -16
  112. package/test/node_modules/amqplib/examples/tutorials/receive.js +0 -21
  113. package/test/node_modules/amqplib/examples/tutorials/receive_logs.js +0 -28
  114. package/test/node_modules/amqplib/examples/tutorials/receive_logs_direct.js +0 -44
  115. package/test/node_modules/amqplib/examples/tutorials/receive_logs_topic.js +0 -43
  116. package/test/node_modules/amqplib/examples/tutorials/rpc_client.js +0 -52
  117. package/test/node_modules/amqplib/examples/tutorials/rpc_server.js +0 -39
  118. package/test/node_modules/amqplib/examples/tutorials/send.js +0 -23
  119. package/test/node_modules/amqplib/examples/tutorials/worker.js +0 -28
  120. package/test/node_modules/amqplib/examples/waitForConfirms.js +0 -22
  121. package/test/node_modules/amqplib/lib/api_args.js +0 -314
  122. package/test/node_modules/amqplib/lib/bitset.js +0 -130
  123. package/test/node_modules/amqplib/lib/callback_model.js +0 -327
  124. package/test/node_modules/amqplib/lib/channel.js +0 -499
  125. package/test/node_modules/amqplib/lib/channel_model.js +0 -302
  126. package/test/node_modules/amqplib/lib/codec.js +0 -321
  127. package/test/node_modules/amqplib/lib/connect.js +0 -189
  128. package/test/node_modules/amqplib/lib/connection.js +0 -663
  129. package/test/node_modules/amqplib/lib/credentials.js +0 -42
  130. package/test/node_modules/amqplib/lib/defs.js +0 -4966
  131. package/test/node_modules/amqplib/lib/error.js +0 -24
  132. package/test/node_modules/amqplib/lib/format.js +0 -40
  133. package/test/node_modules/amqplib/lib/frame.js +0 -113
  134. package/test/node_modules/amqplib/lib/heartbeat.js +0 -89
  135. package/test/node_modules/amqplib/lib/mux.js +0 -129
  136. package/test/node_modules/amqplib/package.json +0 -37
  137. package/test/node_modules/amqplib/test/bitset.js +0 -69
  138. package/test/node_modules/amqplib/test/callback_api.js +0 -312
  139. package/test/node_modules/amqplib/test/channel.js +0 -621
  140. package/test/node_modules/amqplib/test/channel_api.js +0 -596
  141. package/test/node_modules/amqplib/test/codec.js +0 -237
  142. package/test/node_modules/amqplib/test/connect.js +0 -197
  143. package/test/node_modules/amqplib/test/connection.js +0 -390
  144. package/test/node_modules/amqplib/test/data.js +0 -254
  145. package/test/node_modules/amqplib/test/frame.js +0 -198
  146. package/test/node_modules/amqplib/test/mux.js +0 -204
  147. package/test/node_modules/amqplib/test/util.js +0 -219
  148. package/test/node_modules/buffer-more-ints/.travis.yml +0 -6
  149. package/test/node_modules/buffer-more-ints/LICENSE +0 -19
  150. package/test/node_modules/buffer-more-ints/README.md +0 -69
  151. package/test/node_modules/buffer-more-ints/buffer-more-ints-tests.js +0 -183
  152. package/test/node_modules/buffer-more-ints/buffer-more-ints.js +0 -432
  153. package/test/node_modules/buffer-more-ints/package.json +0 -19
  154. package/test/node_modules/buffer-more-ints/polyfill.js +0 -71
  155. package/test/node_modules/core-util-is/LICENSE +0 -19
  156. package/test/node_modules/core-util-is/README.md +0 -3
  157. package/test/node_modules/core-util-is/lib/util.js +0 -107
  158. package/test/node_modules/core-util-is/package.json +0 -38
  159. package/test/node_modules/debug/LICENSE +0 -20
  160. package/test/node_modules/debug/README.md +0 -481
  161. package/test/node_modules/debug/package.json +0 -59
  162. package/test/node_modules/debug/src/browser.js +0 -269
  163. package/test/node_modules/debug/src/common.js +0 -274
  164. package/test/node_modules/debug/src/index.js +0 -10
  165. package/test/node_modules/debug/src/node.js +0 -263
  166. package/test/node_modules/inherits/LICENSE +0 -16
  167. package/test/node_modules/inherits/README.md +0 -42
  168. package/test/node_modules/inherits/inherits.js +0 -9
  169. package/test/node_modules/inherits/inherits_browser.js +0 -27
  170. package/test/node_modules/inherits/package.json +0 -29
  171. package/test/node_modules/isarray/README.md +0 -54
  172. package/test/node_modules/isarray/build/build.js +0 -209
  173. package/test/node_modules/isarray/component.json +0 -19
  174. package/test/node_modules/isarray/index.js +0 -3
  175. package/test/node_modules/isarray/package.json +0 -25
  176. package/test/node_modules/ms/index.js +0 -162
  177. package/test/node_modules/ms/license.md +0 -21
  178. package/test/node_modules/ms/package.json +0 -37
  179. package/test/node_modules/ms/readme.md +0 -60
  180. package/test/node_modules/querystringify/LICENSE +0 -22
  181. package/test/node_modules/querystringify/README.md +0 -61
  182. package/test/node_modules/querystringify/index.js +0 -118
  183. package/test/node_modules/querystringify/package.json +0 -38
  184. package/test/node_modules/readable-stream/LICENSE +0 -18
  185. package/test/node_modules/readable-stream/README.md +0 -15
  186. package/test/node_modules/readable-stream/duplex.js +0 -1
  187. package/test/node_modules/readable-stream/float.patch +0 -923
  188. package/test/node_modules/readable-stream/lib/_stream_duplex.js +0 -89
  189. package/test/node_modules/readable-stream/lib/_stream_passthrough.js +0 -46
  190. package/test/node_modules/readable-stream/lib/_stream_readable.js +0 -951
  191. package/test/node_modules/readable-stream/lib/_stream_transform.js +0 -209
  192. package/test/node_modules/readable-stream/lib/_stream_writable.js +0 -477
  193. package/test/node_modules/readable-stream/package.json +0 -32
  194. package/test/node_modules/readable-stream/passthrough.js +0 -1
  195. package/test/node_modules/readable-stream/readable.js +0 -10
  196. package/test/node_modules/readable-stream/transform.js +0 -1
  197. package/test/node_modules/readable-stream/writable.js +0 -1
  198. package/test/node_modules/requires-port/.travis.yml +0 -19
  199. package/test/node_modules/requires-port/LICENSE +0 -22
  200. package/test/node_modules/requires-port/README.md +0 -47
  201. package/test/node_modules/requires-port/index.js +0 -38
  202. package/test/node_modules/requires-port/package.json +0 -47
  203. package/test/node_modules/requires-port/test.js +0 -98
  204. package/test/node_modules/safe-buffer/LICENSE +0 -21
  205. package/test/node_modules/safe-buffer/README.md +0 -584
  206. package/test/node_modules/safe-buffer/index.d.ts +0 -187
  207. package/test/node_modules/safe-buffer/index.js +0 -62
  208. package/test/node_modules/safe-buffer/package.json +0 -37
  209. package/test/node_modules/string_decoder/LICENSE +0 -20
  210. package/test/node_modules/string_decoder/README.md +0 -7
  211. package/test/node_modules/string_decoder/index.js +0 -221
  212. package/test/node_modules/string_decoder/package.json +0 -25
  213. package/test/node_modules/url-parse/LICENSE +0 -22
  214. package/test/node_modules/url-parse/README.md +0 -153
  215. package/test/node_modules/url-parse/dist/url-parse.js +0 -755
  216. package/test/node_modules/url-parse/dist/url-parse.min.js +0 -1
  217. package/test/node_modules/url-parse/dist/url-parse.min.js.map +0 -1
  218. package/test/node_modules/url-parse/index.js +0 -589
  219. package/test/node_modules/url-parse/package.json +0 -49
@@ -1 +0,0 @@
1
- !function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).URLParse=e()}(function(){return function n(r,s,a){function i(o,e){if(!s[o]){if(!r[o]){var t="function"==typeof require&&require;if(!e&&t)return t(o,!0);if(p)return p(o,!0);throw(e=new Error("Cannot find module '"+o+"'")).code="MODULE_NOT_FOUND",e}t=s[o]={exports:{}},r[o][0].call(t.exports,function(e){return i(r[o][1][e]||e)},t,t.exports,n,r,s,a)}return s[o].exports}for(var p="function"==typeof require&&require,e=0;e<a.length;e++)i(a[e]);return i}({1:[function(e,t,o){!function(a){!function(){"use strict";var f=e("requires-port"),h=e("querystringify"),o=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,d=/[\n\r\t]/g,s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,i=/:\d+$/,p=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,v=/^[a-zA-Z]:/;function m(e){return(e||"").toString().replace(o,"")}var w=[["#","hash"],["?","query"],function(e,o){return g(o.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],r={hash:1,query:1};function y(e){var o,t="undefined"!=typeof window?window:void 0!==a?a:"undefined"!=typeof self?self:{},t=t.location||{},n={},t=typeof(e=e||t);if("blob:"===e.protocol)n=new C(unescape(e.pathname),{});else if("string"==t)for(o in n=new C(e,{}),r)delete n[o];else if("object"==t){for(o in e)o in r||(n[o]=e[o]);void 0===n.slashes&&(n.slashes=s.test(e.href))}return n}function g(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function b(e,o){e=(e=m(e)).replace(d,""),o=o||{};var t,e=p.exec(e),n=e[1]?e[1].toLowerCase():"",r=!!e[2],s=!!e[3],a=0;return r?a=s?(t=e[2]+e[3]+e[4],e[2].length+e[3].length):(t=e[2]+e[4],e[2].length):s?(t=e[3]+e[4],a=e[3].length):t=e[4],"file:"===n?2<=a&&(t=t.slice(2)):g(n)?t=e[4]:n?r&&(t=t.slice(2)):2<=a&&g(o.protocol)&&(t=e[4]),{protocol:n,slashes:r||g(n),slashesCount:a,rest:t}}function C(e,o,t){if(e=(e=m(e)).replace(d,""),!(this instanceof C))return new C(e,o,t);var n,r,s,a,i,u=w.slice(),p=typeof o,c=this,l=0;for("object"!=p&&"string"!=p&&(t=o,o=null),t&&"function"!=typeof t&&(t=h.parse),n=!(p=b(e||"",o=y(o))).protocol&&!p.slashes,c.slashes=p.slashes||n&&o.slashes,c.protocol=p.protocol||o.protocol||"",e=p.rest,("file:"===p.protocol&&(2!==p.slashesCount||v.test(e))||!p.slashes&&(p.protocol||p.slashesCount<2||!g(c.protocol)))&&(u[3]=[/(.*)/,"pathname"]);l<u.length;l++)"function"!=typeof(s=u[l])?(r=s[0],i=s[1],r!=r?c[i]=e:"string"==typeof r?~(a="@"===r?e.lastIndexOf(r):e.indexOf(r))&&(e="number"==typeof s[2]?(c[i]=e.slice(0,a),e.slice(a+s[2])):(c[i]=e.slice(a),e.slice(0,a))):(a=r.exec(e))&&(c[i]=a[1],e=e.slice(0,a.index)),c[i]=c[i]||n&&s[3]&&o[i]||"",s[4]&&(c[i]=c[i].toLowerCase())):e=s(e,c);t&&(c.query=t(c.query)),n&&o.slashes&&"/"!==c.pathname.charAt(0)&&(""!==c.pathname||""!==o.pathname)&&(c.pathname=function(e,o){if(""===e)return o;for(var t=(o||"/").split("/").slice(0,-1).concat(e.split("/")),n=t.length,o=t[n-1],r=!1,s=0;n--;)"."===t[n]?t.splice(n,1):".."===t[n]?(t.splice(n,1),s++):s&&(0===n&&(r=!0),t.splice(n,1),s--);return r&&t.unshift(""),"."!==o&&".."!==o||t.push(""),t.join("/")}(c.pathname,o.pathname)),"/"!==c.pathname.charAt(0)&&g(c.protocol)&&(c.pathname="/"+c.pathname),f(c.port,c.protocol)||(c.host=c.hostname,c.port=""),c.username=c.password="",c.auth&&(~(a=c.auth.indexOf(":"))?(c.username=c.auth.slice(0,a),c.username=encodeURIComponent(decodeURIComponent(c.username)),c.password=c.auth.slice(a+1),c.password=encodeURIComponent(decodeURIComponent(c.password))):c.username=encodeURIComponent(decodeURIComponent(c.auth)),c.auth=c.password?c.username+":"+c.password:c.username),c.origin="file:"!==c.protocol&&g(c.protocol)&&c.host?c.protocol+"//"+c.host:"null",c.href=c.toString()}C.prototype={set:function(e,o,t){var n=this;switch(e){case"query":"string"==typeof o&&o.length&&(o=(t||h.parse)(o)),n[e]=o;break;case"port":n[e]=o,f(o,n.protocol)?o&&(n.host=n.hostname+":"+o):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=o,n.port&&(o+=":"+n.port),n.host=o;break;case"host":n[e]=o,i.test(o)?(o=o.split(":"),n.port=o.pop(),n.hostname=o.join(":")):(n.hostname=o,n.port="");break;case"protocol":n.protocol=o.toLowerCase(),n.slashes=!t;break;case"pathname":case"hash":o?(r="pathname"===e?"/":"#",n[e]=o.charAt(0)!==r?r+o:o):n[e]=o;break;case"username":case"password":n[e]=encodeURIComponent(o);break;case"auth":var r=o.indexOf(":");~r?(n.username=o.slice(0,r),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=o.slice(r+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(o))}for(var s=0;s<w.length;s++){var a=w[s];a[4]&&(n[a[1]]=n[a[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin="file:"!==n.protocol&&g(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n},toString:function(e){e&&"function"==typeof e||(e=h.stringify);var o=this,t=o.host,n=((n=o.protocol)&&":"!==n.charAt(n.length-1)&&(n+=":"),n+(o.protocol&&o.slashes||g(o.protocol)?"//":""));return o.username?(n+=o.username,o.password&&(n+=":"+o.password),n+="@"):o.password?n=n+(":"+o.password)+"@":"file:"!==o.protocol&&g(o.protocol)&&!t&&"/"!==o.pathname&&(n+="@"),(":"===t[t.length-1]||i.test(o.hostname)&&!o.port)&&(t+=":"),n+=t+o.pathname,(t="object"==typeof o.query?e(o.query):o.query)&&(n+="?"!==t.charAt(0)?"?"+t:t),o.hash&&(n+=o.hash),n}},C.extractProtocol=b,C.location=y,C.trimLeft=m,C.qs=h,t.exports=C}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{querystringify:2,"requires-port":3}],2:[function(e,o,t){"use strict";var s=Object.prototype.hasOwnProperty;function a(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function i(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,o){var t,n,r=[];for(n in"string"!=typeof(o=o||"")&&(o="?"),e)s.call(e,n)&&((t=e[n])||null!=t&&!isNaN(t)||(t=""),n=i(n),t=i(t),null!==n&&null!==t&&r.push(n+"="+t));return r.length?o+r.join("&"):""},t.parse=function(e){for(var o=/([^=?#&]+)=?([^&]*)/g,t={};r=o.exec(e);){var n=a(r[1]),r=a(r[2]);null===n||null===r||n in t||(t[n]=r)}return t}},{}],3:[function(e,o,t){"use strict";o.exports=function(e,o){if(o=o.split(":")[0],!(e=+e))return!1;switch(o){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},{}]},{},[1])(1)});
@@ -1 +0,0 @@
1
- {"version":3,"sources":["dist/url-parse.js"],"names":["f","exports","module","define","amd","window","global","self","this","URLParse","r","e","n","t","o","i","c","require","u","a","Error","code","p","call","length","1","required","qs","controlOrWhitespace","CRHTLF","slashes","port","protocolre","windowsDriveLetter","trimLeft","str","toString","replace","rules","address","url","isSpecial","protocol","NaN","undefined","ignore","hash","query","lolcation","loc","key","globalVar","location","finaldestination","type","Url","unescape","pathname","test","href","scheme","extractProtocol","rest","match","exec","toLowerCase","forwardSlashes","otherSlashes","slashesCount","slice","parser","relative","parse","instruction","index","instructions","extracted","lastIndexOf","indexOf","charAt","base","path","split","concat","last","unshift","up","splice","push","join","resolve","host","hostname","username","password","auth","encodeURIComponent","decodeURIComponent","origin","prototype","set","part","value","fn","pop","char","ins","stringify","result","querystringify","requires-port","2","has","Object","hasOwnProperty","decode","input","encode","obj","prefix","pairs","isNaN","3"],"mappings":"CAAA,SAAUA,GAAuB,iBAAVC,SAAoC,oBAATC,OAAsBA,OAAOD,QAAQD,IAA4B,mBAATG,QAAqBA,OAAOC,IAAKD,OAAO,GAAGH,IAAiC,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L,OAAgB,KAATA,EAEP,IAAK,OACL,OAAO,EAGT,OAAgB,IAATA,IAGP,KAAK,GAAG,CAAC,GAjvBqW,CAivBjW"}
@@ -1,589 +0,0 @@
1
- 'use strict';
2
-
3
- var required = require('requires-port')
4
- , qs = require('querystringify')
5
- , controlOrWhitespace = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/
6
- , CRHTLF = /[\n\r\t]/g
7
- , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//
8
- , port = /:\d+$/
9
- , protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i
10
- , windowsDriveLetter = /^[a-zA-Z]:/;
11
-
12
- /**
13
- * Remove control characters and whitespace from the beginning of a string.
14
- *
15
- * @param {Object|String} str String to trim.
16
- * @returns {String} A new string representing `str` stripped of control
17
- * characters and whitespace from its beginning.
18
- * @public
19
- */
20
- function trimLeft(str) {
21
- return (str ? str : '').toString().replace(controlOrWhitespace, '');
22
- }
23
-
24
- /**
25
- * These are the parse rules for the URL parser, it informs the parser
26
- * about:
27
- *
28
- * 0. The char it Needs to parse, if it's a string it should be done using
29
- * indexOf, RegExp using exec and NaN means set as current value.
30
- * 1. The property we should set when parsing this value.
31
- * 2. Indication if it's backwards or forward parsing, when set as number it's
32
- * the value of extra chars that should be split off.
33
- * 3. Inherit from location if non existing in the parser.
34
- * 4. `toLowerCase` the resulting value.
35
- */
36
- var rules = [
37
- ['#', 'hash'], // Extract from the back.
38
- ['?', 'query'], // Extract from the back.
39
- function sanitize(address, url) { // Sanitize what is left of the address
40
- return isSpecial(url.protocol) ? address.replace(/\\/g, '/') : address;
41
- },
42
- ['/', 'pathname'], // Extract from the back.
43
- ['@', 'auth', 1], // Extract from the front.
44
- [NaN, 'host', undefined, 1, 1], // Set left over value.
45
- [/:(\d*)$/, 'port', undefined, 1], // RegExp the back.
46
- [NaN, 'hostname', undefined, 1, 1] // Set left over.
47
- ];
48
-
49
- /**
50
- * These properties should not be copied or inherited from. This is only needed
51
- * for all non blob URL's as a blob URL does not include a hash, only the
52
- * origin.
53
- *
54
- * @type {Object}
55
- * @private
56
- */
57
- var ignore = { hash: 1, query: 1 };
58
-
59
- /**
60
- * The location object differs when your code is loaded through a normal page,
61
- * Worker or through a worker using a blob. And with the blobble begins the
62
- * trouble as the location object will contain the URL of the blob, not the
63
- * location of the page where our code is loaded in. The actual origin is
64
- * encoded in the `pathname` so we can thankfully generate a good "default"
65
- * location from it so we can generate proper relative URL's again.
66
- *
67
- * @param {Object|String} loc Optional default location object.
68
- * @returns {Object} lolcation object.
69
- * @public
70
- */
71
- function lolcation(loc) {
72
- var globalVar;
73
-
74
- if (typeof window !== 'undefined') globalVar = window;
75
- else if (typeof global !== 'undefined') globalVar = global;
76
- else if (typeof self !== 'undefined') globalVar = self;
77
- else globalVar = {};
78
-
79
- var location = globalVar.location || {};
80
- loc = loc || location;
81
-
82
- var finaldestination = {}
83
- , type = typeof loc
84
- , key;
85
-
86
- if ('blob:' === loc.protocol) {
87
- finaldestination = new Url(unescape(loc.pathname), {});
88
- } else if ('string' === type) {
89
- finaldestination = new Url(loc, {});
90
- for (key in ignore) delete finaldestination[key];
91
- } else if ('object' === type) {
92
- for (key in loc) {
93
- if (key in ignore) continue;
94
- finaldestination[key] = loc[key];
95
- }
96
-
97
- if (finaldestination.slashes === undefined) {
98
- finaldestination.slashes = slashes.test(loc.href);
99
- }
100
- }
101
-
102
- return finaldestination;
103
- }
104
-
105
- /**
106
- * Check whether a protocol scheme is special.
107
- *
108
- * @param {String} The protocol scheme of the URL
109
- * @return {Boolean} `true` if the protocol scheme is special, else `false`
110
- * @private
111
- */
112
- function isSpecial(scheme) {
113
- return (
114
- scheme === 'file:' ||
115
- scheme === 'ftp:' ||
116
- scheme === 'http:' ||
117
- scheme === 'https:' ||
118
- scheme === 'ws:' ||
119
- scheme === 'wss:'
120
- );
121
- }
122
-
123
- /**
124
- * @typedef ProtocolExtract
125
- * @type Object
126
- * @property {String} protocol Protocol matched in the URL, in lowercase.
127
- * @property {Boolean} slashes `true` if protocol is followed by "//", else `false`.
128
- * @property {String} rest Rest of the URL that is not part of the protocol.
129
- */
130
-
131
- /**
132
- * Extract protocol information from a URL with/without double slash ("//").
133
- *
134
- * @param {String} address URL we want to extract from.
135
- * @param {Object} location
136
- * @return {ProtocolExtract} Extracted information.
137
- * @private
138
- */
139
- function extractProtocol(address, location) {
140
- address = trimLeft(address);
141
- address = address.replace(CRHTLF, '');
142
- location = location || {};
143
-
144
- var match = protocolre.exec(address);
145
- var protocol = match[1] ? match[1].toLowerCase() : '';
146
- var forwardSlashes = !!match[2];
147
- var otherSlashes = !!match[3];
148
- var slashesCount = 0;
149
- var rest;
150
-
151
- if (forwardSlashes) {
152
- if (otherSlashes) {
153
- rest = match[2] + match[3] + match[4];
154
- slashesCount = match[2].length + match[3].length;
155
- } else {
156
- rest = match[2] + match[4];
157
- slashesCount = match[2].length;
158
- }
159
- } else {
160
- if (otherSlashes) {
161
- rest = match[3] + match[4];
162
- slashesCount = match[3].length;
163
- } else {
164
- rest = match[4]
165
- }
166
- }
167
-
168
- if (protocol === 'file:') {
169
- if (slashesCount >= 2) {
170
- rest = rest.slice(2);
171
- }
172
- } else if (isSpecial(protocol)) {
173
- rest = match[4];
174
- } else if (protocol) {
175
- if (forwardSlashes) {
176
- rest = rest.slice(2);
177
- }
178
- } else if (slashesCount >= 2 && isSpecial(location.protocol)) {
179
- rest = match[4];
180
- }
181
-
182
- return {
183
- protocol: protocol,
184
- slashes: forwardSlashes || isSpecial(protocol),
185
- slashesCount: slashesCount,
186
- rest: rest
187
- };
188
- }
189
-
190
- /**
191
- * Resolve a relative URL pathname against a base URL pathname.
192
- *
193
- * @param {String} relative Pathname of the relative URL.
194
- * @param {String} base Pathname of the base URL.
195
- * @return {String} Resolved pathname.
196
- * @private
197
- */
198
- function resolve(relative, base) {
199
- if (relative === '') return base;
200
-
201
- var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))
202
- , i = path.length
203
- , last = path[i - 1]
204
- , unshift = false
205
- , up = 0;
206
-
207
- while (i--) {
208
- if (path[i] === '.') {
209
- path.splice(i, 1);
210
- } else if (path[i] === '..') {
211
- path.splice(i, 1);
212
- up++;
213
- } else if (up) {
214
- if (i === 0) unshift = true;
215
- path.splice(i, 1);
216
- up--;
217
- }
218
- }
219
-
220
- if (unshift) path.unshift('');
221
- if (last === '.' || last === '..') path.push('');
222
-
223
- return path.join('/');
224
- }
225
-
226
- /**
227
- * The actual URL instance. Instead of returning an object we've opted-in to
228
- * create an actual constructor as it's much more memory efficient and
229
- * faster and it pleases my OCD.
230
- *
231
- * It is worth noting that we should not use `URL` as class name to prevent
232
- * clashes with the global URL instance that got introduced in browsers.
233
- *
234
- * @constructor
235
- * @param {String} address URL we want to parse.
236
- * @param {Object|String} [location] Location defaults for relative paths.
237
- * @param {Boolean|Function} [parser] Parser for the query string.
238
- * @private
239
- */
240
- function Url(address, location, parser) {
241
- address = trimLeft(address);
242
- address = address.replace(CRHTLF, '');
243
-
244
- if (!(this instanceof Url)) {
245
- return new Url(address, location, parser);
246
- }
247
-
248
- var relative, extracted, parse, instruction, index, key
249
- , instructions = rules.slice()
250
- , type = typeof location
251
- , url = this
252
- , i = 0;
253
-
254
- //
255
- // The following if statements allows this module two have compatibility with
256
- // 2 different API:
257
- //
258
- // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments
259
- // where the boolean indicates that the query string should also be parsed.
260
- //
261
- // 2. The `URL` interface of the browser which accepts a URL, object as
262
- // arguments. The supplied object will be used as default values / fall-back
263
- // for relative paths.
264
- //
265
- if ('object' !== type && 'string' !== type) {
266
- parser = location;
267
- location = null;
268
- }
269
-
270
- if (parser && 'function' !== typeof parser) parser = qs.parse;
271
-
272
- location = lolcation(location);
273
-
274
- //
275
- // Extract protocol information before running the instructions.
276
- //
277
- extracted = extractProtocol(address || '', location);
278
- relative = !extracted.protocol && !extracted.slashes;
279
- url.slashes = extracted.slashes || relative && location.slashes;
280
- url.protocol = extracted.protocol || location.protocol || '';
281
- address = extracted.rest;
282
-
283
- //
284
- // When the authority component is absent the URL starts with a path
285
- // component.
286
- //
287
- if (
288
- extracted.protocol === 'file:' && (
289
- extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) ||
290
- (!extracted.slashes &&
291
- (extracted.protocol ||
292
- extracted.slashesCount < 2 ||
293
- !isSpecial(url.protocol)))
294
- ) {
295
- instructions[3] = [/(.*)/, 'pathname'];
296
- }
297
-
298
- for (; i < instructions.length; i++) {
299
- instruction = instructions[i];
300
-
301
- if (typeof instruction === 'function') {
302
- address = instruction(address, url);
303
- continue;
304
- }
305
-
306
- parse = instruction[0];
307
- key = instruction[1];
308
-
309
- if (parse !== parse) {
310
- url[key] = address;
311
- } else if ('string' === typeof parse) {
312
- index = parse === '@'
313
- ? address.lastIndexOf(parse)
314
- : address.indexOf(parse);
315
-
316
- if (~index) {
317
- if ('number' === typeof instruction[2]) {
318
- url[key] = address.slice(0, index);
319
- address = address.slice(index + instruction[2]);
320
- } else {
321
- url[key] = address.slice(index);
322
- address = address.slice(0, index);
323
- }
324
- }
325
- } else if ((index = parse.exec(address))) {
326
- url[key] = index[1];
327
- address = address.slice(0, index.index);
328
- }
329
-
330
- url[key] = url[key] || (
331
- relative && instruction[3] ? location[key] || '' : ''
332
- );
333
-
334
- //
335
- // Hostname, host and protocol should be lowercased so they can be used to
336
- // create a proper `origin`.
337
- //
338
- if (instruction[4]) url[key] = url[key].toLowerCase();
339
- }
340
-
341
- //
342
- // Also parse the supplied query string in to an object. If we're supplied
343
- // with a custom parser as function use that instead of the default build-in
344
- // parser.
345
- //
346
- if (parser) url.query = parser(url.query);
347
-
348
- //
349
- // If the URL is relative, resolve the pathname against the base URL.
350
- //
351
- if (
352
- relative
353
- && location.slashes
354
- && url.pathname.charAt(0) !== '/'
355
- && (url.pathname !== '' || location.pathname !== '')
356
- ) {
357
- url.pathname = resolve(url.pathname, location.pathname);
358
- }
359
-
360
- //
361
- // Default to a / for pathname if none exists. This normalizes the URL
362
- // to always have a /
363
- //
364
- if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {
365
- url.pathname = '/' + url.pathname;
366
- }
367
-
368
- //
369
- // We should not add port numbers if they are already the default port number
370
- // for a given protocol. As the host also contains the port number we're going
371
- // override it with the hostname which contains no port number.
372
- //
373
- if (!required(url.port, url.protocol)) {
374
- url.host = url.hostname;
375
- url.port = '';
376
- }
377
-
378
- //
379
- // Parse down the `auth` for the username and password.
380
- //
381
- url.username = url.password = '';
382
-
383
- if (url.auth) {
384
- index = url.auth.indexOf(':');
385
-
386
- if (~index) {
387
- url.username = url.auth.slice(0, index);
388
- url.username = encodeURIComponent(decodeURIComponent(url.username));
389
-
390
- url.password = url.auth.slice(index + 1);
391
- url.password = encodeURIComponent(decodeURIComponent(url.password))
392
- } else {
393
- url.username = encodeURIComponent(decodeURIComponent(url.auth));
394
- }
395
-
396
- url.auth = url.password ? url.username +':'+ url.password : url.username;
397
- }
398
-
399
- url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host
400
- ? url.protocol +'//'+ url.host
401
- : 'null';
402
-
403
- //
404
- // The href is just the compiled result.
405
- //
406
- url.href = url.toString();
407
- }
408
-
409
- /**
410
- * This is convenience method for changing properties in the URL instance to
411
- * insure that they all propagate correctly.
412
- *
413
- * @param {String} part Property we need to adjust.
414
- * @param {Mixed} value The newly assigned value.
415
- * @param {Boolean|Function} fn When setting the query, it will be the function
416
- * used to parse the query.
417
- * When setting the protocol, double slash will be
418
- * removed from the final url if it is true.
419
- * @returns {URL} URL instance for chaining.
420
- * @public
421
- */
422
- function set(part, value, fn) {
423
- var url = this;
424
-
425
- switch (part) {
426
- case 'query':
427
- if ('string' === typeof value && value.length) {
428
- value = (fn || qs.parse)(value);
429
- }
430
-
431
- url[part] = value;
432
- break;
433
-
434
- case 'port':
435
- url[part] = value;
436
-
437
- if (!required(value, url.protocol)) {
438
- url.host = url.hostname;
439
- url[part] = '';
440
- } else if (value) {
441
- url.host = url.hostname +':'+ value;
442
- }
443
-
444
- break;
445
-
446
- case 'hostname':
447
- url[part] = value;
448
-
449
- if (url.port) value += ':'+ url.port;
450
- url.host = value;
451
- break;
452
-
453
- case 'host':
454
- url[part] = value;
455
-
456
- if (port.test(value)) {
457
- value = value.split(':');
458
- url.port = value.pop();
459
- url.hostname = value.join(':');
460
- } else {
461
- url.hostname = value;
462
- url.port = '';
463
- }
464
-
465
- break;
466
-
467
- case 'protocol':
468
- url.protocol = value.toLowerCase();
469
- url.slashes = !fn;
470
- break;
471
-
472
- case 'pathname':
473
- case 'hash':
474
- if (value) {
475
- var char = part === 'pathname' ? '/' : '#';
476
- url[part] = value.charAt(0) !== char ? char + value : value;
477
- } else {
478
- url[part] = value;
479
- }
480
- break;
481
-
482
- case 'username':
483
- case 'password':
484
- url[part] = encodeURIComponent(value);
485
- break;
486
-
487
- case 'auth':
488
- var index = value.indexOf(':');
489
-
490
- if (~index) {
491
- url.username = value.slice(0, index);
492
- url.username = encodeURIComponent(decodeURIComponent(url.username));
493
-
494
- url.password = value.slice(index + 1);
495
- url.password = encodeURIComponent(decodeURIComponent(url.password));
496
- } else {
497
- url.username = encodeURIComponent(decodeURIComponent(value));
498
- }
499
- }
500
-
501
- for (var i = 0; i < rules.length; i++) {
502
- var ins = rules[i];
503
-
504
- if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();
505
- }
506
-
507
- url.auth = url.password ? url.username +':'+ url.password : url.username;
508
-
509
- url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host
510
- ? url.protocol +'//'+ url.host
511
- : 'null';
512
-
513
- url.href = url.toString();
514
-
515
- return url;
516
- }
517
-
518
- /**
519
- * Transform the properties back in to a valid and full URL string.
520
- *
521
- * @param {Function} stringify Optional query stringify function.
522
- * @returns {String} Compiled version of the URL.
523
- * @public
524
- */
525
- function toString(stringify) {
526
- if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;
527
-
528
- var query
529
- , url = this
530
- , host = url.host
531
- , protocol = url.protocol;
532
-
533
- if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';
534
-
535
- var result =
536
- protocol +
537
- ((url.protocol && url.slashes) || isSpecial(url.protocol) ? '//' : '');
538
-
539
- if (url.username) {
540
- result += url.username;
541
- if (url.password) result += ':'+ url.password;
542
- result += '@';
543
- } else if (url.password) {
544
- result += ':'+ url.password;
545
- result += '@';
546
- } else if (
547
- url.protocol !== 'file:' &&
548
- isSpecial(url.protocol) &&
549
- !host &&
550
- url.pathname !== '/'
551
- ) {
552
- //
553
- // Add back the empty userinfo, otherwise the original invalid URL
554
- // might be transformed into a valid one with `url.pathname` as host.
555
- //
556
- result += '@';
557
- }
558
-
559
- //
560
- // Trailing colon is removed from `url.host` when it is parsed. If it still
561
- // ends with a colon, then add back the trailing colon that was removed. This
562
- // prevents an invalid URL from being transformed into a valid one.
563
- //
564
- if (host[host.length - 1] === ':' || (port.test(url.hostname) && !url.port)) {
565
- host += ':';
566
- }
567
-
568
- result += host + url.pathname;
569
-
570
- query = 'object' === typeof url.query ? stringify(url.query) : url.query;
571
- if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;
572
-
573
- if (url.hash) result += url.hash;
574
-
575
- return result;
576
- }
577
-
578
- Url.prototype = { set: set, toString: toString };
579
-
580
- //
581
- // Expose the URL parser and some additional properties that might be useful for
582
- // others or testing.
583
- //
584
- Url.extractProtocol = extractProtocol;
585
- Url.location = lolcation;
586
- Url.trimLeft = trimLeft;
587
- Url.qs = qs;
588
-
589
- module.exports = Url;
@@ -1,49 +0,0 @@
1
- {
2
- "name": "url-parse",
3
- "version": "1.5.10",
4
- "description": "Small footprint URL parser that works seamlessly across Node.js and browser environments",
5
- "main": "index.js",
6
- "scripts": {
7
- "browserify": "rm -rf dist && mkdir -p dist && browserify index.js -s URLParse -o dist/url-parse.js",
8
- "minify": "uglifyjs dist/url-parse.js --source-map -cm -o dist/url-parse.min.js",
9
- "test": "c8 --reporter=lcov --reporter=text mocha test/test.js",
10
- "test-browser": "node test/browser.js",
11
- "prepublishOnly": "npm run browserify && npm run minify",
12
- "watch": "mocha --watch test/test.js"
13
- },
14
- "files": [
15
- "index.js",
16
- "dist"
17
- ],
18
- "repository": {
19
- "type": "git",
20
- "url": "https://github.com/unshiftio/url-parse.git"
21
- },
22
- "keywords": [
23
- "URL",
24
- "parser",
25
- "uri",
26
- "url",
27
- "parse",
28
- "query",
29
- "string",
30
- "querystring",
31
- "stringify"
32
- ],
33
- "author": "Arnout Kazemier",
34
- "license": "MIT",
35
- "dependencies": {
36
- "querystringify": "^2.1.1",
37
- "requires-port": "^1.0.0"
38
- },
39
- "devDependencies": {
40
- "assume": "^2.2.0",
41
- "browserify": "^17.0.0",
42
- "c8": "^7.3.1",
43
- "mocha": "^9.0.3",
44
- "pre-commit": "^1.2.2",
45
- "sauce-browsers": "^2.0.0",
46
- "sauce-test": "^1.3.3",
47
- "uglify-js": "^3.5.7"
48
- }
49
- }