@celljs/mvc 4.0.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +13 -1
  2. package/esm/node/module.d.ts +1 -1
  3. package/esm/node/view/file-view.js +5 -3
  4. package/esm/node/view/file-view.js.map +1 -1
  5. package/esm/node/view/html-view.d.ts +8 -1
  6. package/esm/node/view/html-view.js +13 -7
  7. package/esm/node/view/html-view.js.map +1 -1
  8. package/esm/node/view/index.d.ts +1 -0
  9. package/esm/node/view/index.js +1 -0
  10. package/esm/node/view/index.js.map +1 -1
  11. package/esm/node/view/template.d.ts +33 -0
  12. package/esm/node/view/template.js +161 -0
  13. package/esm/node/view/template.js.map +1 -0
  14. package/lib/node/module.d.ts +1 -1
  15. package/lib/node/mvc-http.spec.d.ts +2 -0
  16. package/lib/node/mvc-http.spec.d.ts.map +1 -0
  17. package/lib/node/mvc-http.spec.js +532 -0
  18. package/lib/node/mvc-http.spec.js.map +1 -0
  19. package/lib/node/view/file-view.d.ts.map +1 -1
  20. package/lib/node/view/file-view.js +6 -3
  21. package/lib/node/view/file-view.js.map +1 -1
  22. package/lib/node/view/html-view.d.ts +8 -1
  23. package/lib/node/view/html-view.d.ts.map +1 -1
  24. package/lib/node/view/html-view.js +13 -9
  25. package/lib/node/view/html-view.js.map +1 -1
  26. package/lib/node/view/index.d.ts +1 -0
  27. package/lib/node/view/index.d.ts.map +1 -1
  28. package/lib/node/view/index.js +1 -0
  29. package/lib/node/view/index.js.map +1 -1
  30. package/lib/node/view/template.d.ts +34 -0
  31. package/lib/node/view/template.d.ts.map +1 -0
  32. package/lib/node/view/template.js +165 -0
  33. package/lib/node/view/template.js.map +1 -0
  34. package/lib/node/view/template.spec.d.ts +2 -0
  35. package/lib/node/view/template.spec.d.ts.map +1 -0
  36. package/lib/node/view/template.spec.js +35 -0
  37. package/lib/node/view/template.spec.js.map +1 -0
  38. package/package.json +7 -11
  39. package/src/node/mvc-http.spec.ts +352 -0
  40. package/src/node/view/file-view.ts +5 -2
  41. package/src/node/view/html-view.ts +15 -7
  42. package/src/node/view/index.ts +2 -1
  43. package/src/node/view/template.spec.ts +34 -0
  44. package/src/node/view/template.ts +170 -0
package/README.md CHANGED
@@ -1 +1,13 @@
1
- # Cell - MVC Component
1
+ # Cell - MVC Component
2
+
3
+ ## HTML views
4
+
5
+ `@Html('page.mustache')` renders a template from `cell.mustache.baseViewDir` (default `assets/views`) with the value the method returns. `cell.mustache.cache: true` keeps compiled templates in memory.
6
+
7
+ Templates use the Mustache syntax, without a third-party engine:
8
+
9
+ - `{{name}}` writes a value HTML-escaped, `{{{name}}}` or `{{& name}}` as it is; `user.name` reads a path, `.` is the current item;
10
+ - `{{#list}}...{{/list}}` repeats for each item, enters an object, or shows when the value is truthy; `{{^list}}...{{/list}}` shows when it is falsy or empty;
11
+ - `{{! comment }}` writes nothing.
12
+
13
+ Partials (`{{> name}}`) and other delimiters (`{{=<% %>=}}`) are not supported: such a template fails when it is compiled.
@@ -1,3 +1,3 @@
1
1
  import './index.js';
2
- declare const _default: import("inversify").interfaces.ContainerModule;
2
+ declare const _default: import("@celljs/core").ContainerModule;
3
3
  export default _default;
@@ -16,8 +16,7 @@ import { View } from './view-protocol.js';
16
16
  import { HttpHeaders, HttpStatus, MediaType } from '@celljs/http';
17
17
  import { Context } from '@celljs/web/lib/node';
18
18
  import { FILE_VIEW_NAME } from '../annotation/file.js';
19
- import __cellCjs0 from 'fs-extra';
20
- const { createReadStream } = __cellCjs0;
19
+ import { createReadStream } from 'node:fs';
21
20
  import { join } from 'path';
22
21
  let FileView = class FileView {
23
22
  constructor() {
@@ -60,7 +59,10 @@ let FileView = class FileView {
60
59
  }
61
60
  async handleError(response, reason, status = HttpStatus.INTERNAL_SERVER_ERROR) {
62
61
  this.logger.error(reason);
63
- response.status(status).send('Unable to download file.').end();
62
+ if (!response.headersSent) {
63
+ response.statusCode = status;
64
+ }
65
+ response.end('Unable to download file.');
64
66
  }
65
67
  support({ viewName }) {
66
68
  return Promise.resolve(viewName === FILE_VIEW_NAME);
@@ -1 +1 @@
1
- {"version":3,"file":"file-view.js","sourceRoot":"","sources":["../../../src/node/view/file-view.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,OAAO,EAAY,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAGrB,IAAM,QAAQ,GAAd,MAAM,QAAQ;IAAd;QAEM,gBAAW,GAAG,SAAS,CAAC,wBAAwB,CAAC;QAEjD,aAAQ,GAAG,GAAG,CAAC;IAoD5B,CAAC;IA5Ca,QAAQ,CAAC,KAAU;QACzB,OAAO,OAAO,KAAK,KAAK,QAAQ;eACzB,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAU,EAAE,EAAE,QAAQ,EAAgB;QAC/C,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,EAAE,CAAC;YACjB,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/E,CAAC;QACD,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;QAC/C,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CA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M,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;YACxB,QAAQ,CAAC,UAAU,GAAG,MAAM,CAAC;QACjC,CAAC;QACD,QAAQ,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,CAAC,EAAE,QAAQ,EAAgB;QAC9B,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,KAAK,cAAc,CAAC,CAAC;IACxD,CAAC;CACJ,CAAA;AApDsB;IADlB,SAAS,CAAC,MAAM,CAAC;;wCACgB;AAGf;IADlB,KAAK,CAAC,sBAAsB,CAAC;;6CACM;AAV3B,QAAQ;IADpB,SAAS,CAAC,IAAI,CAAC;GACH,QAAQ,CA2DpB"}
@@ -1,10 +1,17 @@
1
1
  import { View } from './view-protocol.js';
2
2
  import { ViewMetadata } from '../annotation/view.js';
3
3
  import { MediaType } from '@celljs/http';
4
+ import { Template } from './template.js';
5
+ /** Renders `@Html('page.mustache')` with {@link Template}, from `cell.mustache.baseViewDir`. */
4
6
  export declare class HtmlView implements View {
5
7
  readonly contentType = MediaType.TEXT_HTML;
6
8
  readonly priority = 500;
7
- protected readonly options: any;
9
+ protected readonly options: {
10
+ baseViewDir: string;
11
+ cache?: boolean;
12
+ };
13
+ /** Compiled templates by file, when `cell.mustache.cache` is on. */
14
+ protected readonly templates: Map<string, Template>;
8
15
  render(model: any, { metadata }: ViewMetadata): Promise<void>;
9
16
  support({ viewName, metadata }: ViewMetadata): Promise<boolean>;
10
17
  }
@@ -14,25 +14,31 @@ var __metadata = (this && this.__metadata) || function (k, v) {
14
14
  import { Component, Value } from '@celljs/core';
15
15
  import { View } from './view-protocol.js';
16
16
  import { Context } from '@celljs/web/lib/node';
17
- import Mustache from 'mustache';
18
17
  import { join } from 'path';
19
- import __cellCjs1 from 'fs-extra';
20
- const { readFile } = __cellCjs1;
18
+ import { readFile } from 'node:fs/promises';
21
19
  import { HTML_VIEW_NAME } from '../annotation/html.js';
22
20
  import { MediaType } from '@celljs/http';
21
+ import { Template } from './template.js';
22
+ /** Renders `@Html('page.mustache')` with {@link Template}, from `cell.mustache.baseViewDir`. */
23
23
  let HtmlView = class HtmlView {
24
24
  constructor() {
25
25
  this.contentType = MediaType.TEXT_HTML;
26
26
  this.priority = 500;
27
+ /** Compiled templates by file, when `cell.mustache.cache` is on. */
28
+ this.templates = new Map();
27
29
  }
28
30
  async render(model, { metadata }) {
29
31
  const response = Context.getCurrent().response;
30
32
  const { baseViewDir, cache } = this.options;
31
- const template = await readFile(join(__dirname, baseViewDir, metadata.file), { encoding: 'utf8' });
32
- if (cache) {
33
- Mustache.parse(template);
33
+ const file = join(__dirname, baseViewDir, metadata.file);
34
+ let template = this.templates.get(file);
35
+ if (!template) {
36
+ template = new Template(await readFile(file, { encoding: 'utf8' }));
37
+ if (cache) {
38
+ this.templates.set(file, template);
39
+ }
34
40
  }
35
- response.body = Mustache.render(template, model);
41
+ response.body = template.render(model);
36
42
  }
37
43
  support({ viewName, metadata }) {
38
44
  var _a;
@@ -1 +1 @@
1
- {"version":3,"file":"html-view.js","sourceRoot":"","sources":["../../../src/node/view/html-view.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGlC,IAAM,QAAQ,GAAd,MAAM,QAAQ;IAAd;QAEM,gBAAW,GAAG,S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AAQ,EAAgB;;QACxC,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,KAAK,cAAc,KAAI,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,0CAAE,QAAQ,CAAC,WAAW,CAAC,CAAA,CAAC,CAAC;IACjG,CAAC;CACJ,CAAA;AAtBsB;IADlB,KAAK,CAAC,eAAe,CAAC;;yCAC8C;AAP5D,QAAQ;IADpB,SAAS,CAAC,IAAI,CAAC;GACH,QAAQ,CA6BpB"}
@@ -2,5 +2,6 @@ export * from './json-view.js';
2
2
  export * from './text-view.js';
3
3
  export * from './view-provider.js';
4
4
  export * from './html-view.js';
5
+ export * from './template.js';
5
6
  export * from './file-view.js';
6
7
  export * from './json-view-template-renderer.js';
@@ -2,6 +2,7 @@ export * from './json-view.js';
2
2
  export * from './text-view.js';
3
3
  export * from './view-provider.js';
4
4
  export * from './html-view.js';
5
+ export * from './template.js';
5
6
  export * from './file-view.js';
6
7
  export * from './json-view-template-renderer.js';
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/node/view/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/node/view/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,+BAA+B,CAAC"}
@@ -0,0 +1,33 @@
1
+ /** `path` is the name split at dots; empty for `.`. */
2
+ type Token = {
3
+ type: 'text';
4
+ value: string;
5
+ } | {
6
+ type: 'name' | '&';
7
+ path: string[];
8
+ } | {
9
+ type: '#' | '^';
10
+ path: string[];
11
+ children: Token[];
12
+ };
13
+ /**
14
+ * A logic-less template with the syntax of Mustache (the subset Cell supports):
15
+ *
16
+ * - `{{name}}` writes a value HTML-escaped, `{{{name}}}` and `{{& name}}` as it is; `name` can be a path (`user.name`)
17
+ * or `.` for the current item; a missing value writes nothing;
18
+ * - `{{#name}}...{{/name}}` repeats for each item of a list, enters an object, or shows when the value is truthy;
19
+ * - `{{^name}}...{{/name}}` shows when the value is falsy or an empty list;
20
+ * - `{{! comment }}` writes nothing.
21
+ *
22
+ * Partials (`{{> name}}`) and other delimiters (`{{=<% %>=}}`) are not supported and fail when the template is compiled.
23
+ */
24
+ export declare class Template {
25
+ protected readonly source: string;
26
+ protected readonly tokens: Token[];
27
+ constructor(source: string);
28
+ render(model: unknown): string;
29
+ protected parse(source: string): Token[];
30
+ protected lookup(path: string[], contexts: unknown[]): unknown;
31
+ protected renderTokens(tokens: Token[], contexts: unknown[]): string;
32
+ }
33
+ export {};
@@ -0,0 +1,161 @@
1
+ const ESCAPES = {
2
+ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', '\'': '&#39;', '/': '&#x2F;', '`': '&#x60;', '=': '&#x3D;'
3
+ };
4
+ const UNSAFE = /[&<>"'`=/]/;
5
+ function escapeHtml(text) {
6
+ return UNSAFE.test(text) ? text.replace(/[&<>"'`=/]/g, c => ESCAPES[c]) : text;
7
+ }
8
+ function toPath(name) {
9
+ return name === '.' ? [] : name.split('.');
10
+ }
11
+ /** Section, inverted section, end of section and comment tags alone on a line take the line with them. */
12
+ const STANDALONE = new Set(['#', '^', '/', '!']);
13
+ /**
14
+ * A logic-less template with the syntax of Mustache (the subset Cell supports):
15
+ *
16
+ * - `{{name}}` writes a value HTML-escaped, `{{{name}}}` and `{{& name}}` as it is; `name` can be a path (`user.name`)
17
+ * or `.` for the current item; a missing value writes nothing;
18
+ * - `{{#name}}...{{/name}}` repeats for each item of a list, enters an object, or shows when the value is truthy;
19
+ * - `{{^name}}...{{/name}}` shows when the value is falsy or an empty list;
20
+ * - `{{! comment }}` writes nothing.
21
+ *
22
+ * Partials (`{{> name}}`) and other delimiters (`{{=<% %>=}}`) are not supported and fail when the template is compiled.
23
+ */
24
+ export class Template {
25
+ constructor(source) {
26
+ this.source = source;
27
+ this.tokens = this.parse(source);
28
+ }
29
+ render(model) {
30
+ return this.renderTokens(this.tokens, [model]);
31
+ }
32
+ parse(source) {
33
+ const root = [];
34
+ const stack = [];
35
+ let current = root;
36
+ let i = 0;
37
+ while (i < source.length) {
38
+ const open = source.indexOf('{{', i);
39
+ if (open < 0) {
40
+ current.push({ type: 'text', value: source.slice(i) });
41
+ break;
42
+ }
43
+ let text = source.slice(i, open);
44
+ let type;
45
+ let name;
46
+ let end;
47
+ if (source[open + 2] === '{') {
48
+ const close = source.indexOf('}}}', open + 3);
49
+ if (close < 0) {
50
+ throw new Error(`Unclosed tag at ${open}`);
51
+ }
52
+ type = '&';
53
+ name = source.slice(open + 3, close).trim();
54
+ end = close + 3;
55
+ }
56
+ else {
57
+ const close = source.indexOf('}}', open + 2);
58
+ if (close < 0) {
59
+ throw new Error(`Unclosed tag at ${open}`);
60
+ }
61
+ const content = source.slice(open + 2, close).trim();
62
+ type = '#^/!&>='.includes(content[0]) ? content[0] : 'name';
63
+ name = type === 'name' ? content : content.slice(1).trim();
64
+ end = close + 2;
65
+ }
66
+ if (type === '>' || type === '=') {
67
+ throw new Error(`${type === '>' ? 'Partials' : 'Custom delimiters'} are not supported: ${source.slice(open, end)}`);
68
+ }
69
+ if (STANDALONE.has(type)) {
70
+ const lineStart = source.lastIndexOf('\n', open - 1) + 1;
71
+ const lineEnd = source.indexOf('\n', end);
72
+ const before = source.slice(Math.max(lineStart, i), open);
73
+ const after = source.slice(end, lineEnd < 0 ? source.length : lineEnd);
74
+ if (lineStart >= i && /^[ \t]*$/.test(before) && /^[ \t]*\r?$/.test(after)) {
75
+ text = text.slice(0, text.length - before.length);
76
+ end = lineEnd < 0 ? source.length : lineEnd + 1;
77
+ }
78
+ }
79
+ if (text) {
80
+ current.push({ type: 'text', value: text });
81
+ }
82
+ if (type === '#' || type === '^') {
83
+ const section = { type, path: toPath(name), children: [] };
84
+ current.push(section);
85
+ stack.push({ name, children: current });
86
+ current = section.children;
87
+ }
88
+ else if (type === '/') {
89
+ const section = stack.pop();
90
+ if (!section || section.name !== name) {
91
+ throw new Error(`Unopened section "${name}" at ${open}`);
92
+ }
93
+ current = section.children;
94
+ }
95
+ else if (type !== '!') {
96
+ current.push({ type: type, path: toPath(name) });
97
+ }
98
+ i = end;
99
+ }
100
+ if (stack.length) {
101
+ throw new Error(`Unclosed section "${stack[stack.length - 1].name}"`);
102
+ }
103
+ return root;
104
+ }
105
+ lookup(path, contexts) {
106
+ if (path.length === 0) {
107
+ return contexts[contexts.length - 1];
108
+ }
109
+ const first = path[0];
110
+ for (let i = contexts.length - 1; i >= 0; i--) {
111
+ const context = contexts[i];
112
+ if (context !== null && typeof context === 'object' && first in context) {
113
+ let value = context[first];
114
+ for (let j = 1; j < path.length; j++) {
115
+ value = value === null || value === undefined ? undefined : value[path[j]];
116
+ }
117
+ return typeof value === 'function' ? value.call(context) : value;
118
+ }
119
+ }
120
+ return undefined;
121
+ }
122
+ renderTokens(tokens, contexts) {
123
+ let out = '';
124
+ for (const token of tokens) {
125
+ if (token.type === 'text') {
126
+ out += token.value;
127
+ continue;
128
+ }
129
+ const value = this.lookup(token.path, contexts);
130
+ if (token.type === '#') {
131
+ if (Array.isArray(value)) {
132
+ for (const item of value) {
133
+ contexts.push(item);
134
+ out += this.renderTokens(token.children, contexts);
135
+ contexts.pop();
136
+ }
137
+ }
138
+ else if (typeof value === 'object' || typeof value === 'string' || typeof value === 'number') {
139
+ if (value) {
140
+ contexts.push(value);
141
+ out += this.renderTokens(token.children, contexts);
142
+ contexts.pop();
143
+ }
144
+ }
145
+ else if (value) {
146
+ out += this.renderTokens(token.children, contexts);
147
+ }
148
+ }
149
+ else if (token.type === '^') {
150
+ if (!value || (Array.isArray(value) && value.length === 0)) {
151
+ out += this.renderTokens(token.children, contexts);
152
+ }
153
+ }
154
+ else if (value !== null && value !== undefined) {
155
+ out += token.type === '&' ? String(value) : escapeHtml(String(value));
156
+ }
157
+ }
158
+ return out;
159
+ }
160
+ }
161
+ //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/node/view/template.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAA2B;IACpC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ;CACpH,CAAC;AAEF,MAAM,MAAM,GAAG,YAAY,CAAC;AAE5B,SAAS,UAAU,CAAC,IAAY;IAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACnF,CAAC;AAQD,SAAS,MAAM,CAAC,IAAY;IACxB,OAAO,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC/C,CAAC;AAED,0GAA0G;AAC1G,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,QAAQ;IAIjB,YAA+B,MAAc;sBAAd,MAAM;QACjC,IAAI,CAAC,MAAM,GAAG,IAAI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AAK,KAAK,QAAQ,EAAE,CAAC;oBAC7F,IAAI,KAAK,EAAE,CAAC;wBACR,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;wBACrB,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;wBACnD,QAAQ,CAAC,GAAG,EAAE,CAAC;oBACnB,CAAC;gBACL,CAAC;qBAAM,IAAI,KAAK,EAAE,CAAC;oBACf,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;gBACvD,CAAC;YACL,CAAC;iBAAM,IAAI,KAAK,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;gBAC5B,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;oBACzD,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;gBACvD,CAAC;YACL,CAAC;iBAAM,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBAC/C,GAAG,IAAI,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAC1E,CAAC;QACL,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;CACJ"}
@@ -1,4 +1,4 @@
1
1
  import './index';
2
- declare const _default: import("inversify").interfaces.ContainerModule;
2
+ declare const _default: import("@celljs/core").ContainerModule;
3
3
  export default _default;
4
4
  //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=mvc-http.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mvc-http.spec.d.ts","sourceRoot":"","sources":["../../src/node/mvc-http.spec.ts"],"names":[],"mappings":""}