@cedarjs/structure 9.0.0-canary.1784 → 9.0.0-canary.3124

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 (118) hide show
  1. package/README.md +1 -1
  2. package/dist/errors.d.ts +2 -1
  3. package/dist/errors.d.ts.map +1 -1
  4. package/dist/errors.js +10 -15
  5. package/dist/errors.js.map +1 -0
  6. package/dist/index.d.ts +7 -7
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +40 -67
  9. package/dist/index.js.map +1 -0
  10. package/dist/model/RWCell.d.ts +4 -4
  11. package/dist/model/RWCell.d.ts.map +1 -1
  12. package/dist/model/RWCell.js +111 -103
  13. package/dist/model/RWCell.js.map +1 -0
  14. package/dist/model/RWComponent.d.ts +2 -2
  15. package/dist/model/RWComponent.d.ts.map +1 -1
  16. package/dist/model/RWComponent.js +46 -41
  17. package/dist/model/RWComponent.js.map +1 -0
  18. package/dist/model/RWEnvHelper.d.ts +4 -4
  19. package/dist/model/RWEnvHelper.d.ts.map +1 -1
  20. package/dist/model/RWEnvHelper.js +233 -205
  21. package/dist/model/RWEnvHelper.js.map +1 -0
  22. package/dist/model/RWFunction.d.ts +2 -2
  23. package/dist/model/RWFunction.d.ts.map +1 -1
  24. package/dist/model/RWFunction.js +10 -15
  25. package/dist/model/RWFunction.js.map +1 -0
  26. package/dist/model/RWLayout.d.ts +2 -2
  27. package/dist/model/RWLayout.d.ts.map +1 -1
  28. package/dist/model/RWLayout.js +10 -15
  29. package/dist/model/RWLayout.js.map +1 -0
  30. package/dist/model/RWPage.d.ts +3 -3
  31. package/dist/model/RWPage.d.ts.map +1 -1
  32. package/dist/model/RWPage.js +61 -57
  33. package/dist/model/RWPage.js.map +1 -0
  34. package/dist/model/RWProject.d.ts +22 -18
  35. package/dist/model/RWProject.d.ts.map +1 -1
  36. package/dist/model/RWProject.js +257 -164
  37. package/dist/model/RWProject.js.map +1 -0
  38. package/dist/model/RWRoute.d.ts +32 -6
  39. package/dist/model/RWRoute.d.ts.map +1 -1
  40. package/dist/model/RWRoute.js +424 -260
  41. package/dist/model/RWRoute.js.map +1 -0
  42. package/dist/model/RWRouter.d.ts +4 -4
  43. package/dist/model/RWRouter.d.ts.map +1 -1
  44. package/dist/model/RWRouter.js +130 -126
  45. package/dist/model/RWRouter.js.map +1 -0
  46. package/dist/model/RWSDL.d.ts +5 -5
  47. package/dist/model/RWSDL.d.ts.map +1 -1
  48. package/dist/model/RWSDL.js +96 -84
  49. package/dist/model/RWSDL.js.map +1 -0
  50. package/dist/model/RWSDLField.d.ts +6 -6
  51. package/dist/model/RWSDLField.d.ts.map +1 -1
  52. package/dist/model/RWSDLField.js +79 -81
  53. package/dist/model/RWSDLField.js.map +1 -0
  54. package/dist/model/RWService.d.ts +4 -4
  55. package/dist/model/RWService.d.ts.map +1 -1
  56. package/dist/model/RWService.js +76 -76
  57. package/dist/model/RWService.js.map +1 -0
  58. package/dist/model/RWServiceFunction.d.ts +4 -4
  59. package/dist/model/RWServiceFunction.d.ts.map +1 -1
  60. package/dist/model/RWServiceFunction.js +95 -97
  61. package/dist/model/RWServiceFunction.js.map +1 -0
  62. package/dist/model/RWTOML.d.ts +3 -3
  63. package/dist/model/RWTOML.d.ts.map +1 -1
  64. package/dist/model/RWTOML.js +53 -55
  65. package/dist/model/RWTOML.js.map +1 -0
  66. package/dist/model/index.d.ts +2 -2
  67. package/dist/model/index.d.ts.map +1 -1
  68. package/dist/model/index.js +3 -20
  69. package/dist/model/index.js.map +1 -0
  70. package/dist/model/util/pageMutationUsage.d.ts +18 -0
  71. package/dist/model/util/pageMutationUsage.d.ts.map +1 -0
  72. package/dist/model/util/pageMutationUsage.js +256 -0
  73. package/dist/model/util/pageMutationUsage.js.map +1 -0
  74. package/dist/model/util/process_env.js +44 -62
  75. package/dist/model/util/process_env.js.map +1 -0
  76. package/dist/nodes.d.ts +2 -2
  77. package/dist/nodes.d.ts.map +1 -1
  78. package/dist/nodes.js +171 -164
  79. package/dist/nodes.js.map +1 -0
  80. package/dist/util.js +23 -33
  81. package/dist/util.js.map +1 -0
  82. package/dist/x/Array.d.ts.map +1 -1
  83. package/dist/x/Array.js +15 -25
  84. package/dist/x/Array.js.map +1 -0
  85. package/dist/x/Location.d.ts +1 -1
  86. package/dist/x/Location.d.ts.map +1 -1
  87. package/dist/x/Location.js +11 -17
  88. package/dist/x/Location.js.map +1 -0
  89. package/dist/x/Position.js +18 -29
  90. package/dist/x/Position.js.map +1 -0
  91. package/dist/x/Range.d.ts +1 -1
  92. package/dist/x/Range.d.ts.map +1 -1
  93. package/dist/x/Range.js +17 -22
  94. package/dist/x/Range.js.map +1 -0
  95. package/dist/x/URL.js +59 -75
  96. package/dist/x/URL.js.map +1 -0
  97. package/dist/x/child_process.d.ts +1 -1
  98. package/dist/x/child_process.d.ts.map +1 -1
  99. package/dist/x/child_process.js +35 -49
  100. package/dist/x/child_process.js.map +1 -0
  101. package/dist/x/decorators.d.ts +2 -2
  102. package/dist/x/decorators.d.ts.map +1 -1
  103. package/dist/x/decorators.js +46 -26
  104. package/dist/x/decorators.js.map +1 -0
  105. package/dist/x/diagnostics.d.ts +3 -3
  106. package/dist/x/diagnostics.d.ts.map +1 -1
  107. package/dist/x/diagnostics.js +163 -259
  108. package/dist/x/diagnostics.js.map +1 -0
  109. package/dist/x/path.js +36 -55
  110. package/dist/x/path.js.map +1 -0
  111. package/dist/x/prisma.d.ts +2 -2
  112. package/dist/x/prisma.d.ts.map +1 -1
  113. package/dist/x/prisma.js +32 -55
  114. package/dist/x/prisma.js.map +1 -0
  115. package/dist/x/ts-morph.js +34 -45
  116. package/dist/x/ts-morph.js.map +1 -0
  117. package/package.json +46 -22
  118. package/LICENSE +0 -21
package/dist/nodes.js CHANGED
@@ -1,175 +1,182 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.FileNode = exports.BaseNode = void 0;
9
- var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/json/stringify"));
10
- var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/promise"));
11
- var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/map"));
12
- var _flat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/flat"));
13
- var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/filter"));
14
- var _startsWith = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/starts-with"));
15
- var _getOwnPropertyDescriptor = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/object/get-own-property-descriptor"));
16
- var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/applyDecoratedDescriptor"));
17
- var _nodeFs = require("node:fs");
18
- var _nodePath = require("node:path");
19
- var _Array = require("./x/Array");
20
- var _decorators = require("./x/decorators");
21
- var _path = require("./x/path");
22
- var _Range = require("./x/Range");
23
- var _tsMorph = require("./x/ts-morph");
24
- var _URL = require("./x/URL");
25
- var _dec, _dec2, _dec3, _dec4, _dec5, _class, _dec6, _dec7, _dec8, _dec9, _dec0, _dec1, _dec10, _class2;
26
- let BaseNode = exports.BaseNode = (_dec = (0, _decorators.memo)(), _dec2 = (0, _decorators.memo)(), _dec3 = (0, _decorators.memo)(_stringify.default), _dec4 = (0, _decorators.lazy)(), _dec5 = (0, _decorators.memo)(), _class = class BaseNode {
27
- constructor() {
28
- this.exists = true;
29
- }
30
- /**
31
- * Each node MUST have a unique ID.
32
- * IDs have meaningful information.
33
- *
34
- * examples:
35
- * - /path/to/project
36
- * - /path/to/project/web/src/Routes.js
37
- * - /path/to/project/web/src/Routes.js /route1
38
- */
39
- /**
40
- * Returns the children of this node.
41
- * Override this.
42
- */
43
- children() {
44
- return [];
45
- }
46
- _children() {
47
- return (0, _Array.ArrayLike_normalize)(this.children());
48
- }
49
-
50
- /**
51
- * Diagnostics for this node (must not include children's diagnostics).
52
- * Override this.
53
- */
54
- diagnostics() {
55
- return [];
56
- }
57
- _diagnostics() {
58
- return (0, _Array.ArrayLike_normalize)(this.diagnostics());
59
- }
60
-
61
- /**
62
- * Collects diagnostics for this node and all descendants.
63
- * This is what you'll use to gather all the project diagnostics.
64
- */
65
- async collectDiagnostics(uri) {
66
- // TODO: catch runtime errors and add them as diagnostics
67
- // TODO: we can parallelize this further
68
- if (uri && this.bailOutOnCollection(uri)) {
69
- return [];
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { existsSync, readFileSync } from 'node:fs';
8
+ import { basename } from 'node:path';
9
+ import { ArrayLike_normalize } from './x/Array.js';
10
+ import { lazy, memo } from './x/decorators.js';
11
+ import { basenameNoExt } from './x/path.js';
12
+ import { Range_create } from './x/Range.js';
13
+ import { createTSMSourceFile_cached } from './x/ts-morph.js';
14
+ import { URL_file } from './x/URL.js';
15
+ export class BaseNode {
16
+ exists = true;
17
+ /**
18
+ * Returns the children of this node.
19
+ * Override this.
20
+ */
21
+ children() {
22
+ return [];
70
23
  }
71
- try {
72
- var _context;
73
- const d1 = await this._diagnostics();
74
- const dd = await _promise.default.all((0, _map.default)(_context = await this._children()).call(_context, c => c.collectDiagnostics(uri)));
75
- const d2 = (0, _flat.default)(dd).call(dd);
76
- let all = [...d1, ...d2];
77
- if (uri) {
78
- all = (0, _filter.default)(all).call(all, x => x.uri === uri);
79
- }
80
- return all;
81
- } catch (e) {
82
- const uri = this.closestContainingUri;
83
- if (!uri) {
84
- throw e;
85
- }
86
- const range = (0, _Range.Range_create)(0, 0, 0, 0);
87
- return [{
88
- uri,
89
- diagnostic: {
90
- message: e + '',
91
- range
24
+ _children() {
25
+ return ArrayLike_normalize(this.children());
26
+ }
27
+ /**
28
+ * Diagnostics for this node (must not include children's diagnostics).
29
+ * Override this.
30
+ */
31
+ diagnostics() {
32
+ return [];
33
+ }
34
+ _diagnostics() {
35
+ return ArrayLike_normalize(this.diagnostics());
36
+ }
37
+ /**
38
+ * Collects diagnostics for this node and all descendants.
39
+ * This is what you'll use to gather all the project diagnostics.
40
+ */
41
+ async collectDiagnostics(uri) {
42
+ // TODO: catch runtime errors and add them as diagnostics
43
+ // TODO: we can parallelize this further
44
+ if (uri && this.bailOutOnCollection(uri)) {
45
+ return [];
46
+ }
47
+ try {
48
+ const d1 = await this._diagnostics();
49
+ const dd = await Promise.all((await this._children()).map((c) => c.collectDiagnostics(uri)));
50
+ const d2 = dd.flat();
51
+ let all = [...d1, ...d2];
52
+ if (uri) {
53
+ all = all.filter((x) => x.uri === uri);
54
+ }
55
+ return all;
56
+ }
57
+ catch (e) {
58
+ const uri = this.closestContainingUri;
59
+ if (!uri) {
60
+ throw e;
61
+ }
62
+ const range = Range_create(0, 0, 0, 0);
63
+ return [
64
+ {
65
+ uri,
66
+ diagnostic: { message: e + '', range },
67
+ },
68
+ ];
69
+ }
70
+ }
71
+ bailOutOnCollection(uri) {
72
+ if (this.id === uri) {
73
+ return false;
92
74
  }
93
- }];
75
+ if (uri.startsWith(this.id)) {
76
+ return false;
77
+ }
78
+ return true;
94
79
  }
95
- }
96
- bailOutOnCollection(uri) {
97
- if (this.id === uri) {
98
- return false;
80
+ get closestContainingUri() {
81
+ const { uri } = this;
82
+ if (uri) {
83
+ return uri;
84
+ }
85
+ if (this.parent) {
86
+ return this.parent.closestContainingUri;
87
+ }
88
+ return undefined;
99
89
  }
100
- if ((0, _startsWith.default)(uri).call(uri, this.id)) {
101
- return false;
90
+ /**
91
+ * Finds a node by ID.
92
+ * The default algorithm tries to be economic and only create the necessary
93
+ * intermediate nodes.
94
+ * Subclasses can override this to add further optimizations.
95
+ * @param id
96
+ */
97
+ async findNode(id) {
98
+ id = URL_file(id);
99
+ if (this.id === id) {
100
+ return this;
101
+ }
102
+ if (id.startsWith(this.id)) {
103
+ for (const c of await this._children()) {
104
+ // depth first search by default
105
+ const cc = await c.findNode(id);
106
+ if (cc) {
107
+ return cc;
108
+ }
109
+ }
110
+ }
111
+ return undefined;
112
+ }
113
+ }
114
+ __decorate([
115
+ memo()
116
+ ], BaseNode.prototype, "_children", null);
117
+ __decorate([
118
+ memo()
119
+ ], BaseNode.prototype, "_diagnostics", null);
120
+ __decorate([
121
+ memo((...args) => JSON.stringify(args))
122
+ ], BaseNode.prototype, "collectDiagnostics", null);
123
+ __decorate([
124
+ lazy()
125
+ ], BaseNode.prototype, "closestContainingUri", null);
126
+ __decorate([
127
+ memo()
128
+ ], BaseNode.prototype, "findNode", null);
129
+ export class FileNode extends BaseNode {
130
+ get uri() {
131
+ return URL_file(this.filePath);
102
132
  }
103
- return true;
104
- }
105
- get closestContainingUri() {
106
- const {
107
- uri
108
- } = this;
109
- if (uri) {
110
- return uri;
133
+ /**
134
+ * the ID of a FileNode is its file:// uri.
135
+ */
136
+ get id() {
137
+ return this.uri;
111
138
  }
112
- if (this.parent) {
113
- return this.parent.closestContainingUri;
139
+ get text() {
140
+ return readFileSync(this.filePath, { encoding: 'utf8' }).toString();
114
141
  }
115
- return undefined;
116
- }
117
-
118
- /**
119
- * Finds a node by ID.
120
- * The default algorithm tries to be economic and only create the necessary
121
- * intermediate nodes.
122
- * Subclasses can override this to add further optimizations.
123
- * @param id
124
- */
125
- async findNode(id) {
126
- id = (0, _URL.URL_file)(id);
127
- if (this.id === id) {
128
- return this;
142
+ get fileExists() {
143
+ return existsSync(this.filePath);
129
144
  }
130
- if ((0, _startsWith.default)(id).call(id, this.id)) {
131
- for (const c of await this._children()) {
132
- // depth first search by default
133
- const cc = await c.findNode(id);
134
- if (cc) {
135
- return cc;
145
+ /**
146
+ * parsed ts-morph source file
147
+ */
148
+ get sf() {
149
+ if (typeof this.text === 'undefined') {
150
+ throw new Error('undefined file ' + this.filePath);
136
151
  }
137
- }
152
+ return createTSMSourceFile_cached(this.filePath, this.text);
153
+ }
154
+ get basenameNoExt() {
155
+ return basenameNoExt(this.filePath);
138
156
  }
139
- return undefined;
140
- }
141
- }, (0, _applyDecoratedDescriptor2.default)(_class.prototype, "_children", [_dec], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "_children"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "_diagnostics", [_dec2], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "_diagnostics"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "collectDiagnostics", [_dec3], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "collectDiagnostics"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "closestContainingUri", [_dec4], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "closestContainingUri"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "findNode", [_dec5], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "findNode"), _class.prototype), _class);
142
- let FileNode = exports.FileNode = (_dec6 = (0, _decorators.lazy)(), _dec7 = (0, _decorators.lazy)(), _dec8 = (0, _decorators.lazy)(), _dec9 = (0, _decorators.lazy)(), _dec0 = (0, _decorators.lazy)(), _dec1 = (0, _decorators.lazy)(), _dec10 = (0, _decorators.lazy)(), _class2 = class FileNode extends BaseNode {
143
- get uri() {
144
- return (0, _URL.URL_file)(this.filePath);
145
- }
146
- /**
147
- * the ID of a FileNode is its file:// uri.
148
- */
149
- get id() {
150
- return this.uri;
151
- }
152
- get text() {
153
- return (0, _nodeFs.readFileSync)(this.filePath, {
154
- encoding: 'utf8'
155
- }).toString();
156
- }
157
- get fileExists() {
158
- return (0, _nodeFs.existsSync)(this.filePath);
159
- }
160
- /**
161
- * parsed ts-morph source file
162
- */
163
- get sf() {
164
- if (typeof this.text === 'undefined') {
165
- throw new Error('undefined file ' + this.filePath);
157
+ get basename() {
158
+ return basename(this.filePath);
166
159
  }
167
- return (0, _tsMorph.createTSMSourceFile_cached)(this.filePath, this.text);
168
- }
169
- get basenameNoExt() {
170
- return (0, _path.basenameNoExt)(this.filePath);
171
- }
172
- get basename() {
173
- return (0, _nodePath.basename)(this.filePath);
174
- }
175
- }, (0, _applyDecoratedDescriptor2.default)(_class2.prototype, "uri", [_dec6], (0, _getOwnPropertyDescriptor.default)(_class2.prototype, "uri"), _class2.prototype), (0, _applyDecoratedDescriptor2.default)(_class2.prototype, "id", [_dec7], (0, _getOwnPropertyDescriptor.default)(_class2.prototype, "id"), _class2.prototype), (0, _applyDecoratedDescriptor2.default)(_class2.prototype, "text", [_dec8], (0, _getOwnPropertyDescriptor.default)(_class2.prototype, "text"), _class2.prototype), (0, _applyDecoratedDescriptor2.default)(_class2.prototype, "fileExists", [_dec9], (0, _getOwnPropertyDescriptor.default)(_class2.prototype, "fileExists"), _class2.prototype), (0, _applyDecoratedDescriptor2.default)(_class2.prototype, "sf", [_dec0], (0, _getOwnPropertyDescriptor.default)(_class2.prototype, "sf"), _class2.prototype), (0, _applyDecoratedDescriptor2.default)(_class2.prototype, "basenameNoExt", [_dec1], (0, _getOwnPropertyDescriptor.default)(_class2.prototype, "basenameNoExt"), _class2.prototype), (0, _applyDecoratedDescriptor2.default)(_class2.prototype, "basename", [_dec10], (0, _getOwnPropertyDescriptor.default)(_class2.prototype, "basename"), _class2.prototype), _class2);
160
+ }
161
+ __decorate([
162
+ lazy()
163
+ ], FileNode.prototype, "uri", null);
164
+ __decorate([
165
+ lazy()
166
+ ], FileNode.prototype, "id", null);
167
+ __decorate([
168
+ lazy()
169
+ ], FileNode.prototype, "text", null);
170
+ __decorate([
171
+ lazy()
172
+ ], FileNode.prototype, "fileExists", null);
173
+ __decorate([
174
+ lazy()
175
+ ], FileNode.prototype, "sf", null);
176
+ __decorate([
177
+ lazy()
178
+ ], FileNode.prototype, "basenameNoExt", null);
179
+ __decorate([
180
+ lazy()
181
+ ], FileNode.prototype, "basename", null);
182
+ //# sourceMappingURL=nodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodes.js","sourceRoot":"","sources":["../src/nodes.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAIpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAElD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIrC,MAAM,OAAgB,QAAQ;IAa5B,MAAM,GAAG,IAAI,CAAA;IACb;;;OAGG;IACH,QAAQ;QACN,OAAO,EAAE,CAAA;IACX,CAAC;IACe,SAAS;QACvB,OAAO,mBAAmB,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC7C,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO,EAAE,CAAA;IACX,CAAC;IACe,YAAY;QAC1B,OAAO,mBAAmB,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;IAChD,CAAC;IAED;;;OAGG;IAEG,AAAN,KAAK,CAAC,kBAAkB,CAAC,GAAY;QACnC,yDAAyD;QACzD,wCAAwC;QACxC,IAAI,GAAG,IAAI,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC;YACzC,OAAO,EAAE,CAAA;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,EAAE;QACZ,OAAO,IAAI,CAAC,GAAG,CAAA;IACjB,CAAC;IACO,IAAI,IAAI;QACd,OAAO,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAA;IACrE,CAAC;IACO,IAAI,UAAU;QACpB,OAAO,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAClC,CAAC;IACD;;OAEG;IACK,IAAI,EAAE;QACZ,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAA;QACpD,CAAC;QACD,OAAO,0BAA0B,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;IAC7D,CAAC;IACO,IAAI,aAAa;QACvB,OAAO,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACrC,CAAC;IACO,IAAI,QAAQ;QAClB,OAAO,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAChC,CAAC;CACF;AA9BS;IAAP,IAAI,EAAE;mCAEN;AAIO;IAAP,IAAI,EAAE;kCAEN;AACO;IAAP,IAAI,EAAE;oCAEN;AACO;IAAP,IAAI,EAAE;0CAEN;AAIO;IAAP,IAAI,EAAE;kCAKN;AACO;IAAP,IAAI,EAAE;6CAEN;AACO;IAAP,IAAI,EAAE;wCAEN"}
package/dist/util.js CHANGED
@@ -1,34 +1,24 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.validateRoutePath = validateRoutePath;
9
- var _startsWith = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/starts-with"));
10
- var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/includes"));
11
- var _matchAll = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/match-all"));
12
- function validateRoutePath(path) {
13
- // copied from https://github.com/cedarjs/cedar/blob/master/packages/router/src/util.js
14
- // Check that path begins with a slash.
15
- if (!(0, _startsWith.default)(path).call(path, '/')) {
16
- throw new Error(`Route path does not begin with a slash: "${path}"`);
17
- }
18
- if ((0, _includes.default)(path).call(path, ' ')) {
19
- throw new Error(`Route path contains spaces: "${path}"`);
20
- }
21
-
22
- // Check for duplicate named params.
23
- const matches = (0, _matchAll.default)(path).call(path, /\{([^}]+)\}/g);
24
- const memo = {};
25
- for (const match of matches) {
26
- // Extract the param's name to make sure there aren't any duplicates
27
- const param = match[1].split(':')[0];
28
- if (memo[param]) {
29
- throw new Error(`Route path contains duplicate parameter: "${path}"`);
30
- } else {
31
- memo[param] = true;
1
+ export function validateRoutePath(path) {
2
+ // copied from https://github.com/cedarjs/cedar/blob/master/packages/router/src/util.js
3
+ // Check that path begins with a slash.
4
+ if (!path.startsWith('/')) {
5
+ throw new Error(`Route path does not begin with a slash: "${path}"`);
32
6
  }
33
- }
34
- }
7
+ if (path.includes(' ')) {
8
+ throw new Error(`Route path contains spaces: "${path}"`);
9
+ }
10
+ // Check for duplicate named params.
11
+ const matches = path.matchAll(/\{([^}]+)\}/g);
12
+ const memo = {};
13
+ for (const match of matches) {
14
+ // Extract the param's name to make sure there aren't any duplicates
15
+ const param = match[1].split(':')[0];
16
+ if (memo[param]) {
17
+ throw new Error(`Route path contains duplicate parameter: "${path}"`);
18
+ }
19
+ else {
20
+ memo[param] = true;
21
+ }
22
+ }
23
+ }
24
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,uFAAuF;IACvF,uCAAuC;IACvC,IAAI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{"version":3,"file":"Array.d.ts","sourceRoot":"","sources":["../../src/x/Array.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,CAAC,CAAC,IACrB,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,CAAA;AAEpE,wBAAsB,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAW1E;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,gBAAgB,CAAC,CAAC,CAAC,OAEnD"}
package/dist/x/Array.js CHANGED
@@ -1,26 +1,16 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.ArrayLike_normalize = ArrayLike_normalize;
9
- exports.iter = iter;
10
- var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/promise"));
11
- var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/array/from"));
12
- async function ArrayLike_normalize(x) {
13
- if (x instanceof _promise.default) {
14
- return x;
15
- }
16
- if (x === null) {
17
- return [];
18
- }
19
- if (typeof x === 'undefined') {
20
- return [];
21
- }
22
- return [...x];
1
+ export async function ArrayLike_normalize(x) {
2
+ if (x instanceof Promise) {
3
+ return x;
4
+ }
5
+ if (x === null) {
6
+ return [];
7
+ }
8
+ if (typeof x === 'undefined') {
9
+ return [];
10
+ }
11
+ return [...x];
23
12
  }
24
- function iter(f) {
25
- return (0, _from.default)(f());
26
- }
13
+ export function iter(f) {
14
+ return Array.from(f());
15
+ }
16
+ //# sourceMappingURL=Array.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Array.js","sourceRoot":"","sources":["../../src/x/Array.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAI,CAAe;IAC1D,IAAI,CAAC,YAAY,OAAO,EAAE,CAAC;QACzB,OAAO,CAAC,CAAA;IACV,CAAC;IACD,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QACf,OAAO,EAAE,CAAA;IACX,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,WAAW,EAAE,CAAC;QAC7B,OAAO,EAAE,CAAA;IACX,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;AACf,CAAC;AAED,MAAM,UAAU,IAAI,CAAI,CAA4B;IAClD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAA;AACxB,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Range } from './Range';
1
+ import type { Range } from './Range.js';
2
2
  export type DocumentUri = string;
3
3
  export interface Location {
4
4
  uri: DocumentUri;
@@ -1 +1 @@
1
- {"version":3,"file":"Location.d.ts","sourceRoot":"","sources":["../../src/x/Location.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAA;AAEhC,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,WAAW,CAAA;IAChB,KAAK,EAAE,KAAK,CAAA;CACb;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,GAAG,QAAQ,CAExE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,QAAQ,CASzD"}
1
+ {"version":3,"file":"Location.d.ts","sourceRoot":"","sources":["../../src/x/Location.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAA;AAEhC,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,WAAW,CAAA;IAChB,KAAK,EAAE,KAAK,CAAA;CACb;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,GAAG,QAAQ,CAExE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,QAAQ,CASzD"}
@@ -1,18 +1,12 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
- _Object$defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.Location_create = Location_create;
8
- exports.Location_is = Location_is;
9
- function Location_create(uri, range) {
10
- return {
11
- uri,
12
- range
13
- };
1
+ export function Location_create(uri, range) {
2
+ return { uri, range };
14
3
  }
15
- function Location_is(value) {
16
- const candidate = value;
17
- return candidate && typeof candidate.uri === 'string' && typeof candidate.range === 'object' && candidate.range.start !== undefined && candidate.range.end !== undefined;
18
- }
4
+ export function Location_is(value) {
5
+ const candidate = value;
6
+ return (candidate &&
7
+ typeof candidate.uri === 'string' &&
8
+ typeof candidate.range === 'object' &&
9
+ candidate.range.start !== undefined &&
10
+ candidate.range.end !== undefined);
11
+ }
12
+ //# sourceMappingURL=Location.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Location.js","sourceRoot":"","sources":["../../src/x/Location.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,eAAe,CAAC,GAAgB,EAAE,KAAY;IAC5D,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAAA;AACvB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAU;IACpC,MAAM,SAAS,GAAG,KAAiB,CAAA;IACnC,OAAO,CACL,SAAS;QACT,OAAO,SAAS,CAAC,GAAG,KAAK,QAAQ;QACjC,OAAO,SAAS,CAAC,KAAK,KAAK,QAAQ;QACnC,SAAS,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS;QACnC,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,SAAS,CAClC,CAAA;AACH,CAAC"}
@@ -1,35 +1,24 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
- _Object$defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.Position_compare = Position_compare;
8
- exports.Position_create = Position_create;
9
- function Position_create(line, character) {
10
- return {
11
- line,
12
- character
13
- };
1
+ export function Position_create(line, character) {
2
+ return { line, character };
14
3
  }
15
-
16
4
  /**
17
5
  * p1 is greater|smaller|equal than/to p2
18
6
  * @param p1
19
7
  * @param p2
20
8
  */
21
- function Position_compare(p1, p2) {
22
- if (p1.line > p2.line) {
23
- return 'greater';
24
- }
25
- if (p2.line > p1.line) {
26
- return 'smaller';
27
- }
28
- if (p1.character > p2.character) {
29
- return 'greater';
30
- }
31
- if (p2.character > p1.character) {
32
- return 'smaller';
33
- }
34
- return 'equal';
35
- }
9
+ export function Position_compare(p1, p2) {
10
+ if (p1.line > p2.line) {
11
+ return 'greater';
12
+ }
13
+ if (p2.line > p1.line) {
14
+ return 'smaller';
15
+ }
16
+ if (p1.character > p2.character) {
17
+ return 'greater';
18
+ }
19
+ if (p2.character > p1.character) {
20
+ return 'smaller';
21
+ }
22
+ return 'equal';
23
+ }
24
+ //# sourceMappingURL=Position.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Position.js","sourceRoot":"","sources":["../../src/x/Position.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,SAAiB;IAC7D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAA;AAC5B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC9B,EAAY,EACZ,EAAY;IAEZ,IAAI,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC;QACtB,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC;QACtB,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,EAAE,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC;QAChC,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,EAAE,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC;QAChC,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
package/dist/x/Range.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Position } from './Position';
1
+ import type { Position } from './Position.js';
2
2
  export interface Range {
3
3
  start: Position;
4
4
  end: Position;
@@ -1 +1 @@
1
- {"version":3,"file":"Range.d.ts","sourceRoot":"","sources":["../../src/x/Range.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAG1C,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,QAAQ,CAAA;IACf,GAAG,EAAE,QAAQ,CAAA;CACd;AAED,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,KAAK,CAAA;AACR,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,GAAG,KAAK,CAAA"}
1
+ {"version":3,"file":"Range.d.ts","sourceRoot":"","sources":["../../src/x/Range.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAG7C,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,QAAQ,CAAA;IACf,GAAG,EAAE,QAAQ,CAAA;CACd;AAED,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,KAAK,CAAA;AACR,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,GAAG,KAAK,CAAA"}
package/dist/x/Range.js CHANGED
@@ -1,22 +1,17 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
- _Object$defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.Range_create = Range_create;
8
- var _Position = require("./Position");
9
- function Range_create(one, two, three, four) {
10
- if (typeof one === 'number' && typeof two === 'number' && typeof three === 'number' && typeof four === 'number') {
11
- return {
12
- start: (0, _Position.Position_create)(one, two),
13
- end: (0, _Position.Position_create)(three, four)
14
- };
15
- } else if (typeof one === 'object' && typeof two === 'object') {
16
- return {
17
- start: one,
18
- end: two
19
- };
20
- }
21
- throw new Error('Invalid arguments to Range_create');
22
- }
1
+ import { Position_create } from './Position.js';
2
+ export function Range_create(one, two, three, four) {
3
+ if (typeof one === 'number' &&
4
+ typeof two === 'number' &&
5
+ typeof three === 'number' &&
6
+ typeof four === 'number') {
7
+ return {
8
+ start: Position_create(one, two),
9
+ end: Position_create(three, four),
10
+ };
11
+ }
12
+ else if (typeof one === 'object' && typeof two === 'object') {
13
+ return { start: one, end: two };
14
+ }
15
+ throw new Error('Invalid arguments to Range_create');
16
+ }
17
+ //# sourceMappingURL=Range.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Range.js","sourceRoot":"","sources":["../../src/x/Range.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAc/C,MAAM,UAAU,YAAY,CAC1B,GAAsB,EACtB,GAAsB,EACtB,KAAc,EACd,IAAa;IAEb,IACE,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,IAAI,KAAK,QAAQ,EACxB,CAAC;QACD,OAAO;YACL,KAAK,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC;YAChC,GAAG,EAAE,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC;SAClC,CAAA;IACH,CAAC;SAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC9D,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;IACjC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;AACtD,CAAC"}