@modern-js/prod-server 2.0.0-beta.2 → 2.0.0-beta.4

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 (130) hide show
  1. package/CHANGELOG.md +132 -0
  2. package/dist/js/modern/constants.js +32 -25
  3. package/dist/js/modern/index.js +11 -6
  4. package/dist/js/modern/libs/context/context.js +52 -84
  5. package/dist/js/modern/libs/context/index.js +5 -2
  6. package/dist/js/modern/libs/hook-api/index.js +42 -35
  7. package/dist/js/modern/libs/hook-api/route.js +6 -7
  8. package/dist/js/modern/libs/hook-api/template.js +20 -34
  9. package/dist/js/modern/libs/loadConfig.js +45 -24
  10. package/dist/js/modern/libs/metrics.js +3 -4
  11. package/dist/js/modern/libs/proxy.js +68 -37
  12. package/dist/js/modern/libs/render/cache/__tests__/cache.fun.test.js +112 -67
  13. package/dist/js/modern/libs/render/cache/__tests__/cache.test.js +246 -216
  14. package/dist/js/modern/libs/render/cache/__tests__/cacheable.js +43 -49
  15. package/dist/js/modern/libs/render/cache/__tests__/error-configuration.js +36 -34
  16. package/dist/js/modern/libs/render/cache/__tests__/matched-cache.js +83 -113
  17. package/dist/js/modern/libs/render/cache/index.js +88 -54
  18. package/dist/js/modern/libs/render/cache/page-caches/index.js +31 -8
  19. package/dist/js/modern/libs/render/cache/page-caches/lru.js +6 -6
  20. package/dist/js/modern/libs/render/cache/spr.js +133 -117
  21. package/dist/js/modern/libs/render/cache/type.js +0 -1
  22. package/dist/js/modern/libs/render/cache/util.js +71 -39
  23. package/dist/js/modern/libs/render/index.js +76 -56
  24. package/dist/js/modern/libs/render/measure.js +38 -27
  25. package/dist/js/modern/libs/render/reader.js +65 -62
  26. package/dist/js/modern/libs/render/ssr.js +50 -32
  27. package/dist/js/modern/libs/render/static.js +50 -33
  28. package/dist/js/modern/libs/render/type.js +9 -6
  29. package/dist/js/modern/libs/route/index.js +8 -15
  30. package/dist/js/modern/libs/route/matcher.js +20 -34
  31. package/dist/js/modern/libs/route/route.js +9 -18
  32. package/dist/js/modern/libs/serve-file.js +33 -20
  33. package/dist/js/modern/server/index.js +144 -145
  34. package/dist/js/modern/server/modern-server-split.js +46 -12
  35. package/dist/js/modern/server/modern-server.js +377 -419
  36. package/dist/js/modern/type.js +0 -1
  37. package/dist/js/modern/utils.js +62 -43
  38. package/dist/js/modern/worker-server.js +34 -14
  39. package/dist/js/node/constants.js +45 -30
  40. package/dist/js/node/index.js +31 -57
  41. package/dist/js/node/libs/context/context.js +79 -94
  42. package/dist/js/node/libs/context/index.js +23 -13
  43. package/dist/js/node/libs/hook-api/index.js +69 -48
  44. package/dist/js/node/libs/hook-api/route.js +22 -11
  45. package/dist/js/node/libs/hook-api/template.js +36 -39
  46. package/dist/js/node/libs/loadConfig.js +69 -35
  47. package/dist/js/node/libs/metrics.js +21 -9
  48. package/dist/js/node/libs/proxy.js +86 -44
  49. package/dist/js/node/libs/render/cache/__tests__/cache.fun.test.js +132 -70
  50. package/dist/js/node/libs/render/cache/__tests__/cache.test.js +268 -218
  51. package/dist/js/node/libs/render/cache/__tests__/cacheable.js +61 -55
  52. package/dist/js/node/libs/render/cache/__tests__/error-configuration.js +54 -40
  53. package/dist/js/node/libs/render/cache/__tests__/matched-cache.js +101 -119
  54. package/dist/js/node/libs/render/cache/index.js +110 -64
  55. package/dist/js/node/libs/render/cache/page-caches/index.js +50 -14
  56. package/dist/js/node/libs/render/cache/page-caches/lru.js +29 -12
  57. package/dist/js/node/libs/render/cache/spr.js +156 -129
  58. package/dist/js/node/libs/render/cache/type.js +0 -5
  59. package/dist/js/node/libs/render/cache/util.js +88 -45
  60. package/dist/js/node/libs/render/index.js +102 -67
  61. package/dist/js/node/libs/render/measure.js +55 -31
  62. package/dist/js/node/libs/render/reader.js +87 -70
  63. package/dist/js/node/libs/render/ssr.js +76 -47
  64. package/dist/js/node/libs/render/static.js +75 -40
  65. package/dist/js/node/libs/render/type.js +27 -12
  66. package/dist/js/node/libs/route/index.js +26 -26
  67. package/dist/js/node/libs/route/matcher.js +36 -41
  68. package/dist/js/node/libs/route/route.js +25 -22
  69. package/dist/js/node/libs/serve-file.js +61 -32
  70. package/dist/js/node/server/index.js +160 -160
  71. package/dist/js/node/server/modern-server-split.js +68 -22
  72. package/dist/js/node/server/modern-server.js +395 -443
  73. package/dist/js/node/type.js +0 -3
  74. package/dist/js/node/utils.js +74 -52
  75. package/dist/js/node/worker-server.js +53 -21
  76. package/dist/js/treeshaking/constants.js +26 -25
  77. package/dist/js/treeshaking/index.js +10 -10
  78. package/dist/js/treeshaking/libs/context/context.js +268 -237
  79. package/dist/js/treeshaking/libs/context/index.js +3 -3
  80. package/dist/js/treeshaking/libs/hook-api/index.js +265 -143
  81. package/dist/js/treeshaking/libs/hook-api/route.js +65 -30
  82. package/dist/js/treeshaking/libs/hook-api/template.js +121 -85
  83. package/dist/js/treeshaking/libs/loadConfig.js +80 -37
  84. package/dist/js/treeshaking/libs/metrics.js +4 -10
  85. package/dist/js/treeshaking/libs/proxy.js +240 -76
  86. package/dist/js/treeshaking/libs/render/cache/__tests__/cache.fun.test.js +288 -121
  87. package/dist/js/treeshaking/libs/render/cache/__tests__/cache.test.js +772 -455
  88. package/dist/js/treeshaking/libs/render/cache/__tests__/cacheable.js +65 -51
  89. package/dist/js/treeshaking/libs/render/cache/__tests__/error-configuration.js +45 -35
  90. package/dist/js/treeshaking/libs/render/cache/__tests__/matched-cache.js +144 -118
  91. package/dist/js/treeshaking/libs/render/cache/index.js +337 -175
  92. package/dist/js/treeshaking/libs/render/cache/page-caches/index.js +151 -27
  93. package/dist/js/treeshaking/libs/render/cache/page-caches/lru.js +80 -42
  94. package/dist/js/treeshaking/libs/render/cache/spr.js +470 -340
  95. package/dist/js/treeshaking/libs/render/cache/type.js +1 -1
  96. package/dist/js/treeshaking/libs/render/cache/util.js +271 -92
  97. package/dist/js/treeshaking/libs/render/index.js +228 -95
  98. package/dist/js/treeshaking/libs/render/measure.js +142 -57
  99. package/dist/js/treeshaking/libs/render/reader.js +325 -177
  100. package/dist/js/treeshaking/libs/render/ssr.js +220 -95
  101. package/dist/js/treeshaking/libs/render/static.js +210 -78
  102. package/dist/js/treeshaking/libs/render/type.js +7 -6
  103. package/dist/js/treeshaking/libs/route/index.js +125 -89
  104. package/dist/js/treeshaking/libs/route/matcher.js +132 -107
  105. package/dist/js/treeshaking/libs/route/route.js +40 -26
  106. package/dist/js/treeshaking/libs/serve-file.js +177 -68
  107. package/dist/js/treeshaking/server/index.js +468 -327
  108. package/dist/js/treeshaking/server/modern-server-split.js +352 -144
  109. package/dist/js/treeshaking/server/modern-server.js +1046 -911
  110. package/dist/js/treeshaking/type.js +1 -1
  111. package/dist/js/treeshaking/utils.js +138 -81
  112. package/dist/js/treeshaking/worker-server.js +176 -55
  113. package/dist/types/index.d.ts +2 -0
  114. package/dist/types/libs/context/context.d.ts +4 -1
  115. package/dist/types/libs/loadConfig.d.ts +1 -0
  116. package/dist/types/libs/render/cache/index.d.ts +2 -0
  117. package/dist/types/libs/render/cache/spr.d.ts +2 -0
  118. package/dist/types/libs/route/route.d.ts +0 -1
  119. package/dist/types/server/index.d.ts +3 -0
  120. package/dist/types/utils.d.ts +1 -1
  121. package/dist/types/worker-server.d.ts +1 -2
  122. package/package.json +7 -14
  123. package/dist/js/modern/libs/render/modern/browser-list.js +0 -7
  124. package/dist/js/modern/libs/render/modern/index.js +0 -37
  125. package/dist/js/node/libs/render/modern/browser-list.js +0 -14
  126. package/dist/js/node/libs/render/modern/index.js +0 -46
  127. package/dist/js/treeshaking/libs/render/modern/browser-list.js +0 -7
  128. package/dist/js/treeshaking/libs/render/modern/index.js +0 -39
  129. package/dist/types/libs/render/modern/browser-list.d.ts +0 -1
  130. package/dist/types/libs/render/modern/index.d.ts +0 -3
@@ -1,243 +1,274 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
- import { URL } from 'url';
5
- import qs from 'querystring';
6
- import { Buffer } from 'buffer';
7
- import createEtag from 'etag';
8
- import fresh from 'fresh';
9
- import { headersWithoutCookie } from "../../utils";
10
- export var ModernServerContext = /*#__PURE__*/function () {
11
- function ModernServerContext(req, res, options) {
12
- _classCallCheck(this, ModernServerContext);
13
- _defineProperty(this, "req", void 0);
14
- _defineProperty(this, "res", void 0);
15
- _defineProperty(this, "params", {});
16
- _defineProperty(this, "serverData", void 0);
17
- _defineProperty(this, "options", {});
18
- this.req = req;
19
- this.res = res;
20
- this.options = options || {};
21
- this.serverData = {};
22
- this.bind();
23
- }
24
- _createClass(ModernServerContext, [{
25
- key: "logger",
26
- get:
27
- /**
28
- * http request
29
- */
30
-
31
- /**
32
- * http response
33
- */
34
-
35
- /**
36
- * url params
37
- */
38
-
39
- function get() {
40
- return this.req.logger;
41
- }
42
- }, {
43
- key: "metrics",
44
- get: function get() {
45
- return this.req.metrics;
46
- }
47
- }, {
48
- key: "bind",
49
- value: function bind() {
50
- var _this = this;
51
- var _ref = this,
52
- req = _ref.req,
53
- res = _ref.res;
54
- req.get = function (key) {
55
- return _this.getReqHeader(key);
56
- };
57
- res.set = function (key, value) {
58
- return _this.res.setHeader(key, value);
59
- };
60
- res.send = function (body) {
61
- _this.send(body);
62
- };
63
- }
64
-
65
- // compat express res.send, only support etag now
66
- }, {
67
- key: "send",
68
- value: function send(body) {
69
- try {
70
- var generateETag = !this.res.getHeader('ETag') && this.options.etag;
71
- if (body !== undefined && generateETag) {
72
- var encoding = typeof body === 'string' ? 'utf-8' : undefined;
73
- var buf = !Buffer.isBuffer(body) ? Buffer.from(body, encoding) : body;
74
- var etag = createEtag(buf, {
75
- weak: true
76
- });
77
- if (etag) {
78
- this.res.setHeader('ETag', etag);
79
- }
80
- }
81
- if (this.fresh) {
82
- this.status = 304;
83
- }
84
- } catch (e) {
85
- this.logger.error(e.message);
86
- }
87
- this.res.end(body);
1
+ function _classCallCheck(instance, Constructor) {
2
+ if (!(instance instanceof Constructor)) {
3
+ throw new TypeError("Cannot call a class as a function");
88
4
  }
89
- }, {
90
- key: "setParams",
91
- value: function setParams(params) {
92
- this.params = params;
5
+ }
6
+ function _defineProperties(target, props) {
7
+ for(var i = 0; i < props.length; i++){
8
+ var descriptor = props[i];
9
+ descriptor.enumerable = descriptor.enumerable || false;
10
+ descriptor.configurable = true;
11
+ if ("value" in descriptor) descriptor.writable = true;
12
+ Object.defineProperty(target, descriptor.key, descriptor);
93
13
  }
94
- }, {
95
- key: "setServerData",
96
- value: function setServerData(key, value) {
97
- this.serverData[key] = value;
98
- }
99
- }, {
100
- key: "getReqHeader",
101
- value: function getReqHeader(key) {
102
- var req = this.req;
103
- var field = key.toLowerCase();
104
- switch (field) {
105
- case 'referer':
106
- case 'referrer':
107
- return req.headers.referrer || req.headers.referer || '';
108
- default:
109
- return req.headers[field] || '';
110
- }
111
- }
112
- }, {
113
- key: "fresh",
114
- get: function get() {
115
- var status = this.status,
116
- res = this.res,
117
- method = this.method;
118
-
119
- // GET or HEAD for weak freshness validation only
120
- if ('GET' !== method && 'HEAD' !== method) {
121
- return false;
122
- }
123
- if (status >= 200 && status < 300 || 304 === status) {
124
- return fresh(this.headers, {
125
- etag: res.getHeader('ETag'),
126
- 'last-modified': res.getHeader('Last-Modified')
14
+ }
15
+ function _createClass(Constructor, protoProps, staticProps) {
16
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
17
+ if (staticProps) _defineProperties(Constructor, staticProps);
18
+ return Constructor;
19
+ }
20
+ function _defineProperty(obj, key, value) {
21
+ if (key in obj) {
22
+ Object.defineProperty(obj, key, {
23
+ value: value,
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true
127
27
  });
128
- }
129
- return false;
130
- }
131
-
132
- /* request property */
133
- }, {
134
- key: "headers",
135
- get: function get() {
136
- return this.req.headers;
137
- }
138
- }, {
139
- key: "method",
140
- get: function get() {
141
- return this.req.method;
142
- }
143
- }, {
144
- key: "url",
145
- get: function get() {
146
- return this.req.url || '';
147
- },
148
- set: function set(val) {
149
- this.req.url = val;
28
+ } else {
29
+ obj[key] = value;
150
30
  }
151
- }, {
152
- key: "host",
153
- get: function get() {
154
- var host = this.getReqHeader('X-Forwarded-Host');
155
- if (!host) {
156
- host = this.getReqHeader('Host');
157
- }
158
- return host.split(/\s*,\s*/, 1)[0] || '';
31
+ return obj;
32
+ }
33
+ function _instanceof(left, right) {
34
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
35
+ return !!right[Symbol.hasInstance](left);
36
+ } else {
37
+ return left instanceof right;
159
38
  }
160
- }, {
161
- key: "protocol",
162
- get: function get() {
163
- if (this.req.socket.encrypted) {
164
- return 'https';
165
- }
166
- var proto = this.getReqHeader('X-Forwarded-Proto');
167
- return proto ? proto.split(/\s*,\s*/, 1)[0] : 'http';
168
- }
169
- }, {
170
- key: "origin",
171
- get: function get() {
172
- return "".concat(this.protocol, "://").concat(this.host);
173
- }
174
- }, {
175
- key: "href",
176
- get: function get() {
177
- return this.origin + this.url;
178
- }
179
- }, {
180
- key: "parsedURL",
181
- get: function get() {
182
- var url = new URL(this.req.url, this.origin);
183
- return url;
184
- }
185
- }, {
186
- key: "path",
187
- get: function get() {
188
- return this.parsedURL.pathname;
189
- },
190
- set: function set(p) {
191
- var url = new URL(this.req.url, this.origin);
192
- // this should never happened
193
- if (!url || !p) {
194
- return;
195
- }
196
- if (url.pathname === p) {
197
- return;
198
- }
199
- url.pathname = p;
200
- this.url = url.toString();
201
- }
202
- }, {
203
- key: "querystring",
204
- get: function get() {
205
- if (!this.req) {
206
- return '';
207
- }
208
- return this.parsedURL.search.replace(/^\?/, '') || '';
209
- }
210
- }, {
211
- key: "query",
212
- get: function get() {
213
- var str = this.querystring;
214
- return qs.parse(str);
215
- }
216
-
217
- /* response property */
218
- }, {
219
- key: "status",
220
- get: function get() {
221
- return this.res.statusCode;
222
- },
223
- set: function set(statusCode) {
224
- this.res.statusCode = statusCode;
225
- }
226
-
227
- /**
228
- * 判断链接是否已经关闭
229
- */
230
- }, {
231
- key: "resHasHandled",
232
- value: function resHasHandled() {
233
- return this.res.writableEnded;
234
- }
235
- }, {
236
- key: "error",
237
- value: function error(dig) {
238
- var e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
239
- this.logger.error("Web Server Error - ".concat(dig, ", error = %s, req.url = %s, req.headers = %o"), e instanceof Error ? e.stack || e.message : e, this.path, headersWithoutCookie(this.headers));
39
+ }
40
+ import { URL } from "url";
41
+ import qs from "querystring";
42
+ import { Buffer } from "buffer";
43
+ import createEtag from "etag";
44
+ import fresh from "fresh";
45
+ import { headersWithoutCookie } from "../../utils";
46
+ var ModernServerContext = /*#__PURE__*/ function() {
47
+ "use strict";
48
+ function ModernServerContext(req, res, options) {
49
+ _classCallCheck(this, ModernServerContext);
50
+ _defineProperty(this, "req", void 0);
51
+ _defineProperty(this, "res", void 0);
52
+ _defineProperty(this, "params", {});
53
+ _defineProperty(this, "serverData", void 0);
54
+ _defineProperty(this, "options", {});
55
+ this.req = req;
56
+ this.res = res;
57
+ this.options = options || {};
58
+ this.serverData = {};
59
+ this.bind();
240
60
  }
241
- }]);
242
- return ModernServerContext;
243
- }();
61
+ _createClass(ModernServerContext, [
62
+ {
63
+ key: "logger",
64
+ get: function get() {
65
+ return this.req.logger;
66
+ }
67
+ },
68
+ {
69
+ key: "metrics",
70
+ get: function get() {
71
+ return this.req.metrics;
72
+ }
73
+ },
74
+ {
75
+ key: "bind",
76
+ value: function bind() {
77
+ var _this = this;
78
+ var ref = this, req = ref.req, res = ref.res;
79
+ req.get = function(key) {
80
+ return _this.getReqHeader(key);
81
+ };
82
+ res.set = function(key, value) {
83
+ return _this.res.setHeader(key, value);
84
+ };
85
+ res.send = function(body) {
86
+ _this.send(body);
87
+ };
88
+ }
89
+ },
90
+ {
91
+ key: "send",
92
+ value: function send(body) {
93
+ try {
94
+ var generateETag = !this.res.getHeader("ETag") && this.options.etag;
95
+ if (body !== void 0 && generateETag) {
96
+ var encoding = typeof body === "string" ? "utf-8" : void 0;
97
+ var buf = !Buffer.isBuffer(body) ? Buffer.from(body, encoding) : body;
98
+ var etag = createEtag(buf, {
99
+ weak: true
100
+ });
101
+ if (etag) {
102
+ this.res.setHeader("ETag", etag);
103
+ }
104
+ }
105
+ if (this.fresh) {
106
+ this.status = 304;
107
+ }
108
+ } catch (e) {
109
+ this.logger.error(e.message);
110
+ }
111
+ this.res.end(body);
112
+ }
113
+ },
114
+ {
115
+ key: "setParams",
116
+ value: function setParams(params) {
117
+ this.params = params;
118
+ }
119
+ },
120
+ {
121
+ key: "setServerData",
122
+ value: function setServerData(key, value) {
123
+ this.serverData[key] = value;
124
+ }
125
+ },
126
+ {
127
+ key: "getReqHeader",
128
+ value: function getReqHeader(key) {
129
+ var req = this.req;
130
+ var field = key.toLowerCase();
131
+ switch(field){
132
+ case "referer":
133
+ case "referrer":
134
+ return req.headers.referrer || req.headers.referer || "";
135
+ default:
136
+ return req.headers[field] || "";
137
+ }
138
+ }
139
+ },
140
+ {
141
+ key: "fresh",
142
+ get: function get() {
143
+ var ref = this, status = ref.status, res = ref.res, method = ref.method;
144
+ if ("GET" !== method && "HEAD" !== method) {
145
+ return false;
146
+ }
147
+ if (status >= 200 && status < 300 || 304 === status) {
148
+ return fresh(this.headers, {
149
+ etag: res.getHeader("ETag"),
150
+ "last-modified": res.getHeader("Last-Modified")
151
+ });
152
+ }
153
+ return false;
154
+ }
155
+ },
156
+ {
157
+ key: "headers",
158
+ get: function get() {
159
+ return this.req.headers;
160
+ }
161
+ },
162
+ {
163
+ key: "method",
164
+ get: function get() {
165
+ return this.req.method;
166
+ }
167
+ },
168
+ {
169
+ key: "url",
170
+ get: function get() {
171
+ return this.req.url || "";
172
+ },
173
+ set: function set(val) {
174
+ this.req.url = val;
175
+ }
176
+ },
177
+ {
178
+ key: "host",
179
+ get: function get() {
180
+ var host = this.getReqHeader("X-Forwarded-Host");
181
+ if (!host) {
182
+ host = this.getReqHeader("Host");
183
+ }
184
+ return host.split(/\s*,\s*/, 1)[0] || "";
185
+ }
186
+ },
187
+ {
188
+ key: "protocol",
189
+ get: function get() {
190
+ if (this.req.socket.encrypted) {
191
+ return "https";
192
+ }
193
+ var proto = this.getReqHeader("X-Forwarded-Proto");
194
+ return proto ? proto.split(/\s*,\s*/, 1)[0] : "http";
195
+ }
196
+ },
197
+ {
198
+ key: "origin",
199
+ get: function get() {
200
+ return "".concat(this.protocol, "://").concat(this.host);
201
+ }
202
+ },
203
+ {
204
+ key: "href",
205
+ get: function get() {
206
+ return this.origin + this.url;
207
+ }
208
+ },
209
+ {
210
+ key: "parsedURL",
211
+ get: function get() {
212
+ var url = new URL(this.req.url, this.origin);
213
+ return url;
214
+ }
215
+ },
216
+ {
217
+ key: "path",
218
+ get: function get() {
219
+ return this.parsedURL.pathname;
220
+ },
221
+ set: function set(p) {
222
+ var url = new URL(this.req.url, this.origin);
223
+ if (!url || !p) {
224
+ return;
225
+ }
226
+ if (url.pathname === p) {
227
+ return;
228
+ }
229
+ url.pathname = p;
230
+ this.url = url.toString();
231
+ }
232
+ },
233
+ {
234
+ key: "querystring",
235
+ get: function get() {
236
+ if (!this.req) {
237
+ return "";
238
+ }
239
+ return this.parsedURL.search.replace(/^\?/, "") || "";
240
+ }
241
+ },
242
+ {
243
+ key: "query",
244
+ get: function get() {
245
+ var str = this.querystring;
246
+ return qs.parse(str);
247
+ }
248
+ },
249
+ {
250
+ key: "status",
251
+ get: function get() {
252
+ return this.res.statusCode;
253
+ },
254
+ set: function set(statusCode) {
255
+ this.res.statusCode = statusCode;
256
+ }
257
+ },
258
+ {
259
+ key: "resHasHandled",
260
+ value: function resHasHandled() {
261
+ return this.res.writableEnded;
262
+ }
263
+ },
264
+ {
265
+ key: "error",
266
+ value: function error(dig) {
267
+ var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
268
+ this.logger.error("Web Server Error - ".concat(dig, ", error = %s, req.url = %s, req.headers = %o"), _instanceof(e, Error) ? e.stack || e.message : e, this.path, headersWithoutCookie(this.headers));
269
+ }
270
+ }
271
+ ]);
272
+ return ModernServerContext;
273
+ }();
274
+ export { ModernServerContext };
@@ -1,5 +1,5 @@
1
1
  import { ModernServerContext } from "./context";
2
- export var createContext = function createContext(req, res, options) {
3
- return new ModernServerContext(req, res, options);
2
+ var createContext = function(req, res, options) {
3
+ return new ModernServerContext(req, res, options);
4
4
  };
5
- export { ModernServerContext };
5
+ export { ModernServerContext, createContext };