@cedarjs/structure 2.8.1-next.116 → 2.8.1
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.
- package/README.md +1 -1
- package/dist/errors.js +15 -9
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +67 -40
- package/dist/model/RWCell.d.ts +4 -4
- package/dist/model/RWCell.d.ts.map +1 -1
- package/dist/model/RWCell.js +103 -111
- package/dist/model/RWComponent.d.ts +2 -2
- package/dist/model/RWComponent.d.ts.map +1 -1
- package/dist/model/RWComponent.js +41 -46
- package/dist/model/RWEnvHelper.d.ts +4 -4
- package/dist/model/RWEnvHelper.d.ts.map +1 -1
- package/dist/model/RWEnvHelper.js +205 -212
- package/dist/model/RWFunction.d.ts +2 -2
- package/dist/model/RWFunction.d.ts.map +1 -1
- package/dist/model/RWFunction.js +15 -10
- package/dist/model/RWLayout.d.ts +2 -2
- package/dist/model/RWLayout.d.ts.map +1 -1
- package/dist/model/RWLayout.js +15 -10
- package/dist/model/RWPage.d.ts +3 -3
- package/dist/model/RWPage.d.ts.map +1 -1
- package/dist/model/RWPage.js +57 -61
- package/dist/model/RWProject.d.ts +17 -11
- package/dist/model/RWProject.d.ts.map +1 -1
- package/dist/model/RWProject.js +164 -218
- package/dist/model/RWRoute.d.ts +5 -5
- package/dist/model/RWRoute.d.ts.map +1 -1
- package/dist/model/RWRoute.js +262 -312
- package/dist/model/RWRouter.d.ts +4 -4
- package/dist/model/RWRouter.d.ts.map +1 -1
- package/dist/model/RWRouter.js +126 -130
- package/dist/model/RWSDL.d.ts +5 -5
- package/dist/model/RWSDL.d.ts.map +1 -1
- package/dist/model/RWSDL.js +84 -96
- package/dist/model/RWSDLField.d.ts +6 -6
- package/dist/model/RWSDLField.d.ts.map +1 -1
- package/dist/model/RWSDLField.js +81 -79
- package/dist/model/RWService.d.ts +4 -4
- package/dist/model/RWService.d.ts.map +1 -1
- package/dist/model/RWService.js +76 -76
- package/dist/model/RWServiceFunction.d.ts +4 -4
- package/dist/model/RWServiceFunction.d.ts.map +1 -1
- package/dist/model/RWServiceFunction.js +97 -95
- package/dist/model/RWTOML.d.ts +3 -3
- package/dist/model/RWTOML.d.ts.map +1 -1
- package/dist/model/RWTOML.js +55 -53
- package/dist/model/index.d.ts +2 -2
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +20 -3
- package/dist/model/util/process_env.js +62 -44
- package/dist/nodes.d.ts +2 -2
- package/dist/nodes.d.ts.map +1 -1
- package/dist/nodes.js +164 -171
- package/dist/util.js +33 -23
- package/dist/x/Array.js +25 -15
- package/dist/x/Location.d.ts +1 -1
- package/dist/x/Location.d.ts.map +1 -1
- package/dist/x/Location.js +17 -11
- package/dist/x/Position.js +29 -18
- package/dist/x/Range.d.ts +1 -1
- package/dist/x/Range.d.ts.map +1 -1
- package/dist/x/Range.js +22 -17
- package/dist/x/URL.js +75 -59
- package/dist/x/child_process.d.ts +1 -1
- package/dist/x/child_process.d.ts.map +1 -1
- package/dist/x/child_process.js +49 -35
- package/dist/x/decorators.d.ts +2 -2
- package/dist/x/decorators.d.ts.map +1 -1
- package/dist/x/decorators.js +26 -46
- package/dist/x/diagnostics.d.ts +3 -3
- package/dist/x/diagnostics.d.ts.map +1 -1
- package/dist/x/diagnostics.js +259 -163
- package/dist/x/path.js +55 -36
- package/dist/x/prisma.d.ts +2 -2
- package/dist/x/prisma.d.ts.map +1 -1
- package/dist/x/prisma.js +55 -32
- package/dist/x/ts-morph.js +45 -34
- package/package.json +17 -38
- package/dist/errors.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/model/RWCell.js.map +0 -1
- package/dist/model/RWComponent.js.map +0 -1
- package/dist/model/RWEnvHelper.js.map +0 -1
- package/dist/model/RWFunction.js.map +0 -1
- package/dist/model/RWLayout.js.map +0 -1
- package/dist/model/RWPage.js.map +0 -1
- package/dist/model/RWProject.js.map +0 -1
- package/dist/model/RWRoute.js.map +0 -1
- package/dist/model/RWRouter.js.map +0 -1
- package/dist/model/RWSDL.js.map +0 -1
- package/dist/model/RWSDLField.js.map +0 -1
- package/dist/model/RWService.js.map +0 -1
- package/dist/model/RWServiceFunction.js.map +0 -1
- package/dist/model/RWTOML.js.map +0 -1
- package/dist/model/index.js.map +0 -1
- package/dist/model/util/process_env.js.map +0 -1
- package/dist/nodes.js.map +0 -1
- package/dist/util.js.map +0 -1
- package/dist/x/Array.js.map +0 -1
- package/dist/x/Location.js.map +0 -1
- package/dist/x/Position.js.map +0 -1
- package/dist/x/Range.js.map +0 -1
- package/dist/x/URL.js.map +0 -1
- package/dist/x/child_process.js.map +0 -1
- package/dist/x/decorators.js.map +0 -1
- package/dist/x/diagnostics.js.map +0 -1
- package/dist/x/path.js.map +0 -1
- package/dist/x/prisma.js.map +0 -1
- package/dist/x/ts-morph.js.map +0 -1
package/dist/util.js
CHANGED
|
@@ -1,24 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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;
|
|
6
32
|
}
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
33
|
+
}
|
|
34
|
+
}
|
package/dist/x/Array.js
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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];
|
|
12
23
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=Array.js.map
|
|
24
|
+
function iter(f) {
|
|
25
|
+
return (0, _from.default)(f());
|
|
26
|
+
}
|
package/dist/x/Location.d.ts
CHANGED
package/dist/x/Location.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Location.d.ts","sourceRoot":"","sources":["../../src/x/Location.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,
|
|
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"}
|
package/dist/x/Location.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
};
|
|
3
14
|
}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
typeof candidate.range === 'object' &&
|
|
9
|
-
candidate.range.start !== undefined &&
|
|
10
|
-
candidate.range.end !== undefined);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=Location.js.map
|
|
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
|
+
}
|
package/dist/x/Position.js
CHANGED
|
@@ -1,24 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
};
|
|
3
14
|
}
|
|
15
|
+
|
|
4
16
|
/**
|
|
5
17
|
* p1 is greater|smaller|equal than/to p2
|
|
6
18
|
* @param p1
|
|
7
19
|
* @param p2
|
|
8
20
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=Position.js.map
|
|
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
|
+
}
|
package/dist/x/Range.d.ts
CHANGED
package/dist/x/Range.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Range.d.ts","sourceRoot":"","sources":["../../src/x/Range.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
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"}
|
package/dist/x/Range.js
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
}
|
package/dist/x/URL.js
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
|
|
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.URL_file = URL_file;
|
|
9
|
+
exports.URL_toFile = URL_toFile;
|
|
10
|
+
var _startsWith = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/starts-with"));
|
|
11
|
+
var _url = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/url"));
|
|
12
|
+
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/index-of"));
|
|
13
|
+
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/includes"));
|
|
14
|
+
var _path = require("path");
|
|
2
15
|
/**
|
|
3
16
|
* Creates a file:// URL
|
|
4
17
|
* Works with linux and windows paths
|
|
@@ -6,34 +19,36 @@ import { isAbsolute, join, normalize, sep as path_sep } from 'node:path';
|
|
|
6
19
|
* TODO: rename to URL_fromFile
|
|
7
20
|
* @param filePath
|
|
8
21
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
function URL_file(filePath, ...parts) {
|
|
23
|
+
if ((0, _startsWith.default)(filePath).call(filePath, FILE_SCHEME)) {
|
|
24
|
+
filePath = filePath.substr(FILE_SCHEME.length);
|
|
25
|
+
}
|
|
26
|
+
if (parts.length > 0) {
|
|
27
|
+
filePath = (0, _path.join)(filePath, ...parts);
|
|
28
|
+
}
|
|
29
|
+
return new _url.default(FILE_SCHEME + (0, _path.normalize)(filePath)).href;
|
|
17
30
|
}
|
|
31
|
+
|
|
18
32
|
/**
|
|
19
33
|
*
|
|
20
34
|
* @param uriOrFilePath
|
|
21
35
|
* @param sep separator string, defaults to `require('path').sep`
|
|
22
36
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
function URL_toFile(uriOrFilePath, sep = _path.sep) {
|
|
38
|
+
if (typeof uriOrFilePath !== 'string') {
|
|
39
|
+
throw new Error('arg error');
|
|
40
|
+
}
|
|
41
|
+
if ((0, _startsWith.default)(uriOrFilePath).call(uriOrFilePath, FILE_SCHEME)) {
|
|
42
|
+
return fileUriToPath(uriOrFilePath, sep);
|
|
43
|
+
}
|
|
44
|
+
const p = (0, _path.normalize)(uriOrFilePath);
|
|
45
|
+
if (!(0, _path.isAbsolute)(p)) {
|
|
46
|
+
throw new Error('absolute path expected: ' + p);
|
|
47
|
+
}
|
|
48
|
+
return p;
|
|
35
49
|
}
|
|
36
50
|
const FILE_SCHEME = 'file://';
|
|
51
|
+
|
|
37
52
|
/**
|
|
38
53
|
* based on https://github.com/TooTallNate/file-uri-to-path/blob/master/src/index.ts
|
|
39
54
|
* main changes:
|
|
@@ -43,41 +58,42 @@ const FILE_SCHEME = 'file://';
|
|
|
43
58
|
* @param uri
|
|
44
59
|
* @param sep
|
|
45
60
|
*/
|
|
46
|
-
function fileUriToPath(uri, sep =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
61
|
+
function fileUriToPath(uri, sep = _path.sep) {
|
|
62
|
+
var _context;
|
|
63
|
+
if (typeof uri !== 'string' || uri.length <= 7 || !(0, _startsWith.default)(uri).call(uri, FILE_SCHEME)) {
|
|
64
|
+
throw new TypeError('must pass in a file:// URI to convert to a file path');
|
|
65
|
+
}
|
|
66
|
+
const rest = decodeURIComponent(uri.substring(7));
|
|
67
|
+
const firstSlash = (0, _indexOf.default)(rest).call(rest, '/');
|
|
68
|
+
let host = rest.substring(0, firstSlash);
|
|
69
|
+
let path = rest.substring(firstSlash + 1);
|
|
70
|
+
|
|
71
|
+
// 2. Scheme Definition
|
|
72
|
+
// As a special case, <host> can be the string "localhost" or the empty
|
|
73
|
+
// string; this is interpreted as "the machine from which the URL is
|
|
74
|
+
// being interpreted".
|
|
75
|
+
if (host === 'localhost') {
|
|
76
|
+
host = '';
|
|
77
|
+
}
|
|
78
|
+
if (host) {
|
|
79
|
+
host = sep + sep + host;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// 3.2 Drives, drive letters, mount points, file system root
|
|
83
|
+
// Drive letters are mapped into the top of a file URI in various ways,
|
|
84
|
+
// depending on the implementation; some applications substitute
|
|
85
|
+
// vertical bar ("|") for the colon after the drive letter, yielding
|
|
86
|
+
// "file:///c|/tmp/test.txt". In some cases, the colon is left
|
|
87
|
+
// unchanged, as in "file:///c:/tmp/test.txt". In other cases, the
|
|
88
|
+
// colon is simply omitted, as in "file:///c/tmp/test.txt".
|
|
89
|
+
path = path.replace(/^(.+)\|/, '$1:');
|
|
90
|
+
const parts = path.split('/');
|
|
91
|
+
|
|
92
|
+
// if the first segment is NOT a windows drive
|
|
93
|
+
// we insert an extra empty segment
|
|
94
|
+
// this will result in an initial slash (unix style)
|
|
95
|
+
if (!(0, _includes.default)(_context = parts[0]).call(_context, ':')) {
|
|
96
|
+
parts.unshift('');
|
|
97
|
+
}
|
|
98
|
+
return parts.join(sep);
|
|
99
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"child_process.d.ts","sourceRoot":"","sources":["../../src/x/child_process.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,
|
|
1
|
+
{"version":3,"file":"child_process.d.ts","sourceRoot":"","sources":["../../src/x/child_process.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,eAAe,CAAA;AAE9C,MAAM,MAAM,QAAQ,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAA;AAE9E,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,CAAC,EAAE,aAAa,CAAC,YAAY,GAAG;IAClC,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;IAC5B,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;CAC7B,GACA,kBAAkB,CAAC,QAAQ,CAAC,CA6B9B;AAED,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAAA;AAEvE,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,CAAC,EAC1C,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,EACxB,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GACb,kBAAkB,CAAC,CAAC,CAAC,CAIvB"}
|
package/dist/x/child_process.js
CHANGED
|
@@ -1,37 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime-corejs3/helpers/interopRequireWildcard").default;
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
6
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.CancellablePromise_then = CancellablePromise_then;
|
|
10
|
+
exports.spawnCancellable = spawnCancellable;
|
|
11
|
+
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/promise"));
|
|
12
|
+
var child_process = _interopRequireWildcard(require("child_process"));
|
|
13
|
+
function spawnCancellable(cmd, args, opts) {
|
|
14
|
+
let cp;
|
|
15
|
+
const promise = new _promise.default((resolve, reject) => {
|
|
16
|
+
cp = child_process.spawn(cmd, args, opts);
|
|
17
|
+
let stderr = '',
|
|
18
|
+
stdout = '';
|
|
19
|
+
cp.stdout.on('data', data => {
|
|
20
|
+
stdout += data;
|
|
21
|
+
opts?.stdout_cb?.(data);
|
|
21
22
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
cp.stderr.on('data', data => {
|
|
24
|
+
stderr += data;
|
|
25
|
+
opts?.stderr_cb?.(data);
|
|
26
|
+
});
|
|
27
|
+
cp.on('close', code => {
|
|
28
|
+
resolve({
|
|
29
|
+
stdout,
|
|
30
|
+
stderr,
|
|
31
|
+
code
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
cp.on('error', err => {
|
|
35
|
+
reject(err);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
promise.cancel = () => {
|
|
39
|
+
try {
|
|
40
|
+
cp.kill();
|
|
41
|
+
} catch {
|
|
42
|
+
// intentionally left empty
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
return promise;
|
|
36
46
|
}
|
|
37
|
-
|
|
47
|
+
function CancellablePromise_then(p, f) {
|
|
48
|
+
const p2 = p.then(f);
|
|
49
|
+
p2.cancel = p.cancel;
|
|
50
|
+
return p2;
|
|
51
|
+
}
|
package/dist/x/decorators.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { LazyGetter as lazy } from 'lazy-get-decorator';
|
|
2
|
+
export { Debounce as debounce, Memoize as memo } from 'lodash-decorators';
|
|
3
3
|
//# sourceMappingURL=decorators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/x/decorators.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/x/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,QAAQ,IAAI,QAAQ,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAA"}
|
package/dist/x/decorators.js
CHANGED
|
@@ -1,46 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (!this.__memoCache) {
|
|
28
|
-
this.__memoCache = new Map();
|
|
29
|
-
}
|
|
30
|
-
const cacheKey = _key;
|
|
31
|
-
if (!this.__memoCache.has(cacheKey)) {
|
|
32
|
-
this.__memoCache.set(cacheKey, new Map());
|
|
33
|
-
}
|
|
34
|
-
const methodCache = this.__memoCache.get(cacheKey);
|
|
35
|
-
const argsKey = keySerializer(...args);
|
|
36
|
-
if (methodCache.has(argsKey)) {
|
|
37
|
-
return methodCache.get(argsKey);
|
|
38
|
-
}
|
|
39
|
-
const result = original.apply(this, args);
|
|
40
|
-
methodCache.set(argsKey, result);
|
|
41
|
-
return result;
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=decorators.js.map
|
|
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
|
+
_Object$defineProperty(exports, "debounce", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _lodashDecorators.Debounce;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
_Object$defineProperty(exports, "lazy", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return _lazyGetDecorator.LazyGetter;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
_Object$defineProperty(exports, "memo", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _lodashDecorators.Memoize;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var _lazyGetDecorator = require("lazy-get-decorator");
|
|
26
|
+
var _lodashDecorators = require("lodash-decorators");
|
package/dist/x/diagnostics.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as tsm from 'ts-morph';
|
|
2
|
-
import type { Location } from './Location
|
|
3
|
-
import type { Position } from './Position
|
|
4
|
-
import type { Range } from './Range
|
|
2
|
+
import type { Location } from './Location';
|
|
3
|
+
import type { Position } from './Position';
|
|
4
|
+
import type { Range } from './Range';
|
|
5
5
|
export type DocumentUri = string;
|
|
6
6
|
export declare enum DiagnosticSeverity {
|
|
7
7
|
Error = 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/x/diagnostics.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAE/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/x/diagnostics.ts"],"names":[],"mappings":"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"}
|