cdklabs-projen-project-types 0.6.15 → 0.6.16
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/.jsii +3 -3
- package/.yarn/install-state.gz +0 -0
- package/lib/cdk.js +2 -2
- package/lib/cdklabs.js +3 -3
- package/lib/check-gha-expressions.js +1 -1
- package/lib/jsii.js +1 -1
- package/lib/rosetta.js +1 -1
- package/lib/yarn/constraints.js +1 -1
- package/lib/yarn/jsii-build.js +1 -1
- package/lib/yarn/monorepo-release.js +1 -1
- package/lib/yarn/monorepo.js +2 -2
- package/lib/yarn/typescript-workspace-release.js +1 -1
- package/lib/yarn/typescript-workspace.js +1 -1
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +19 -18
- package/node_modules/yaml/browser/dist/nodes/Alias.js +25 -23
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +19 -18
- package/node_modules/yaml/dist/nodes/Alias.js +25 -23
- package/node_modules/yaml/package.json +1 -1
- package/package.json +4 -4
package/.jsii
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
]
|
|
9
9
|
},
|
|
10
10
|
"bundled": {
|
|
11
|
-
"yaml": "^2.9.
|
|
11
|
+
"yaml": "^2.9.1"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"constructs": "^10.0.0",
|
|
@@ -15971,6 +15971,6 @@
|
|
|
15971
15971
|
"usedFeatures": [
|
|
15972
15972
|
"class-covariant-overrides"
|
|
15973
15973
|
],
|
|
15974
|
-
"version": "0.6.
|
|
15975
|
-
"fingerprint": "
|
|
15974
|
+
"version": "0.6.16",
|
|
15975
|
+
"fingerprint": "qVCFOPmS4WCxQGHSzSf849mYb14mnhnnGY2WEA1Q2zs="
|
|
15976
15976
|
}
|
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/lib/cdk.js
CHANGED
|
@@ -12,7 +12,7 @@ const rosetta_1 = require("./rosetta");
|
|
|
12
12
|
* @pjid cdk-construct-lib
|
|
13
13
|
*/
|
|
14
14
|
class CdkConstructLibrary extends projen_1.awscdk.AwsCdkConstructLibrary {
|
|
15
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.CdkConstructLibrary", version: "0.6.
|
|
15
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.CdkConstructLibrary", version: "0.6.16" };
|
|
16
16
|
static stabilityRequirements(options) {
|
|
17
17
|
const errors = [];
|
|
18
18
|
if (!options.publishToPypi) {
|
|
@@ -61,7 +61,7 @@ exports.CdkConstructLibrary = CdkConstructLibrary;
|
|
|
61
61
|
* @pjid cdk-ts-proj
|
|
62
62
|
*/
|
|
63
63
|
class CdkTypeScriptProject extends projen_1.typescript.TypeScriptProject {
|
|
64
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.CdkTypeScriptProject", version: "0.6.
|
|
64
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.CdkTypeScriptProject", version: "0.6.16" };
|
|
65
65
|
private;
|
|
66
66
|
constructor(options) {
|
|
67
67
|
const opts = (0, common_options_1.withCommonOptionsDefaults)(options);
|
package/lib/cdklabs.js
CHANGED
|
@@ -112,7 +112,7 @@ function createNpmPublishingDefaults() {
|
|
|
112
112
|
* @pjid cdklabs-construct-lib
|
|
113
113
|
*/
|
|
114
114
|
class CdklabsConstructLibrary extends cdk_1.CdkConstructLibrary {
|
|
115
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.CdklabsConstructLibrary", version: "0.6.
|
|
115
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.CdklabsConstructLibrary", version: "0.6.16" };
|
|
116
116
|
constructor(options) {
|
|
117
117
|
const cdklabsPublishingDefaultProps = (options.cdklabsPublishingDefaults ?? true) ?
|
|
118
118
|
createCdklabsPublishingDefaults(options.name, options.jsiiTargetLanguages) : {};
|
|
@@ -134,7 +134,7 @@ exports.CdklabsConstructLibrary = CdklabsConstructLibrary;
|
|
|
134
134
|
* @pjid cdklabs-ts-proj
|
|
135
135
|
*/
|
|
136
136
|
class CdklabsTypeScriptProject extends cdk_1.CdkTypeScriptProject {
|
|
137
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.CdklabsTypeScriptProject", version: "0.6.
|
|
137
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.CdklabsTypeScriptProject", version: "0.6.16" };
|
|
138
138
|
constructor(options) {
|
|
139
139
|
// the leftmost object is mutated and returned by deepMerge
|
|
140
140
|
const mergedOptions = (0, util_1.deepMerge)([
|
|
@@ -154,7 +154,7 @@ exports.CdklabsTypeScriptProject = CdklabsTypeScriptProject;
|
|
|
154
154
|
* @pjid cdklabs-jsii-proj
|
|
155
155
|
*/
|
|
156
156
|
class CdklabsJsiiProject extends jsii_1.CdkJsiiProject {
|
|
157
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.CdklabsJsiiProject", version: "0.6.
|
|
157
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.CdklabsJsiiProject", version: "0.6.16" };
|
|
158
158
|
constructor(options) {
|
|
159
159
|
const cdklabsPublishingDefaultProps = (options.cdklabsPublishingDefaults ?? true) ?
|
|
160
160
|
createCdklabsPublishingDefaults(options.name, options.jsiiTargetLanguages) : {};
|
|
@@ -12,7 +12,7 @@ const projen_1 = require("projen");
|
|
|
12
12
|
* Automatically added to all of our project types.
|
|
13
13
|
*/
|
|
14
14
|
class CheckGhaExpressions extends projen_1.Component {
|
|
15
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.CheckGhaExpressions", version: "0.6.
|
|
15
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.CheckGhaExpressions", version: "0.6.16" };
|
|
16
16
|
constructor(project) {
|
|
17
17
|
super(project, 'gha-variable-checker');
|
|
18
18
|
}
|
package/lib/jsii.js
CHANGED
|
@@ -10,7 +10,7 @@ const common_options_1 = require("./common-options");
|
|
|
10
10
|
* @pjid cdk-jsii-proj
|
|
11
11
|
*/
|
|
12
12
|
class CdkJsiiProject extends projen_1.cdk.JsiiProject {
|
|
13
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.CdkJsiiProject", version: "0.6.
|
|
13
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.CdkJsiiProject", version: "0.6.16" };
|
|
14
14
|
private;
|
|
15
15
|
constructor(options) {
|
|
16
16
|
const opts = (0, common_options_1.withCommonOptionsDefaults)({
|
package/lib/rosetta.js
CHANGED
|
@@ -10,7 +10,7 @@ const projen_1 = require("projen");
|
|
|
10
10
|
* ensure that rosetta will run successfully
|
|
11
11
|
*/
|
|
12
12
|
class Rosetta extends projen_1.Component {
|
|
13
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.Rosetta", version: "0.6.
|
|
13
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.Rosetta", version: "0.6.16" };
|
|
14
14
|
constructor(project, options = {}) {
|
|
15
15
|
super(project);
|
|
16
16
|
const strict = options.strict ?? true;
|
package/lib/yarn/constraints.js
CHANGED
|
@@ -5,7 +5,7 @@ const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
|
|
5
5
|
const projen_1 = require("projen");
|
|
6
6
|
const DEV_DEP_TYPES = [projen_1.DependencyType.BUILD, projen_1.DependencyType.DEVENV, projen_1.DependencyType.TEST];
|
|
7
7
|
class Constraints extends projen_1.Component {
|
|
8
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.yarn.Constraints", version: "0.6.
|
|
8
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.yarn.Constraints", version: "0.6.16" };
|
|
9
9
|
packages;
|
|
10
10
|
constructor(project, options) {
|
|
11
11
|
super(project);
|
package/lib/yarn/jsii-build.js
CHANGED
|
@@ -11,7 +11,7 @@ const rosetta_1 = require("../rosetta");
|
|
|
11
11
|
* adding monorepo-appropriate defaults (Rosetta, composite, pypiClassifiers).
|
|
12
12
|
*/
|
|
13
13
|
class WorkspaceJsiiBuild {
|
|
14
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.yarn.WorkspaceJsiiBuild", version: "0.6.
|
|
14
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.yarn.WorkspaceJsiiBuild", version: "0.6.16" };
|
|
15
15
|
options;
|
|
16
16
|
constructor(options = {}) {
|
|
17
17
|
this.options = options;
|
|
@@ -47,7 +47,7 @@ const LATEST_COMMIT_OUTPUT = 'latest_commit';
|
|
|
47
47
|
const ALL_PACKAGES_INPUT = '*all packages*';
|
|
48
48
|
class MonorepoRelease extends projen_1.Component {
|
|
49
49
|
options;
|
|
50
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.yarn.MonorepoRelease", version: "0.6.
|
|
50
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.yarn.MonorepoRelease", version: "0.6.16" };
|
|
51
51
|
/**
|
|
52
52
|
* Returns the `MonorepoReleaseWorkflow` component of a project or `undefined` if the project
|
|
53
53
|
* does not have a MonorepoReleaseWorkflow component.
|
package/lib/yarn/monorepo.js
CHANGED
|
@@ -47,7 +47,7 @@ const MONOREPO_SYM = Symbol.for('cdklabs-projen-project-types.yarn.Monorepo');
|
|
|
47
47
|
*/
|
|
48
48
|
class Monorepo extends projen_1.typescript.TypeScriptProject {
|
|
49
49
|
settings;
|
|
50
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.yarn.Monorepo", version: "0.6.
|
|
50
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.yarn.Monorepo", version: "0.6.16" };
|
|
51
51
|
static isMonorepo(x) {
|
|
52
52
|
return Boolean(x && typeof x === 'object' && MONOREPO_SYM in x);
|
|
53
53
|
}
|
|
@@ -325,7 +325,7 @@ function getObjFromFile(project, file) {
|
|
|
325
325
|
* @pjid cdklabs-yarn-monorepo
|
|
326
326
|
*/
|
|
327
327
|
class CdkLabsMonorepo extends Monorepo {
|
|
328
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.yarn.CdkLabsMonorepo", version: "0.6.
|
|
328
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.yarn.CdkLabsMonorepo", version: "0.6.16" };
|
|
329
329
|
constructor(options) {
|
|
330
330
|
super({
|
|
331
331
|
projenrcTs: true,
|
|
@@ -39,7 +39,7 @@ const path = __importStar(require("node:path"));
|
|
|
39
39
|
const projen_1 = require("projen");
|
|
40
40
|
const gather_versions_task_1 = require("./gather-versions.task");
|
|
41
41
|
class WorkspaceRelease extends projen_1.Component {
|
|
42
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.yarn.WorkspaceRelease", version: "0.6.
|
|
42
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.yarn.WorkspaceRelease", version: "0.6.16" };
|
|
43
43
|
publisher;
|
|
44
44
|
version;
|
|
45
45
|
workspace;
|
|
@@ -8,7 +8,7 @@ const projen_1 = require("projen");
|
|
|
8
8
|
* A TypeScript workspace in a `yarn.Monorepo`
|
|
9
9
|
*/
|
|
10
10
|
class TypeScriptWorkspace extends projen_1.typescript.TypeScriptProject {
|
|
11
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.yarn.TypeScriptWorkspace", version: "0.6.
|
|
11
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdklabs-projen-project-types.yarn.TypeScriptWorkspace", version: "0.6.16" };
|
|
12
12
|
workspaceDirectory;
|
|
13
13
|
bundledDeps = [];
|
|
14
14
|
isPrivatePackage;
|
|
@@ -64,46 +64,47 @@ function plainValue(source, onError) {
|
|
|
64
64
|
}
|
|
65
65
|
if (badChar)
|
|
66
66
|
onError(0, 'BAD_SCALAR_START', `Plain value cannot start with ${badChar}`);
|
|
67
|
-
return
|
|
67
|
+
return unfoldLines(source);
|
|
68
68
|
}
|
|
69
69
|
function singleQuotedValue(source, onError) {
|
|
70
70
|
if (source[source.length - 1] !== "'" || source.length === 1)
|
|
71
71
|
onError(source.length, 'MISSING_CHAR', "Missing closing 'quote");
|
|
72
|
-
return
|
|
72
|
+
return unfoldLines(source.slice(1, -1)).replace(/''/g, "'");
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function unfoldLines(source) {
|
|
75
|
+
const line = /(.*?)\r?\n/sy;
|
|
76
|
+
let match = line.exec(source);
|
|
77
|
+
if (!match)
|
|
78
|
+
return source;
|
|
75
79
|
/**
|
|
76
|
-
* The negative
|
|
80
|
+
* The negative lookbehinds in these RegExps are to
|
|
77
81
|
* prevent causing a polynomial search time in certain cases.
|
|
78
82
|
*
|
|
79
|
-
* The try-catch is for Safari
|
|
83
|
+
* The try-catch is for Safari < 16.4 and other old browsers:
|
|
80
84
|
* https://caniuse.com/js-regexp-lookbehind
|
|
81
85
|
*/
|
|
82
|
-
let
|
|
86
|
+
let trimEnd, trimBoth;
|
|
83
87
|
try {
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
trimEnd = new RegExp('(?<![ \t])[ \t]+$');
|
|
89
|
+
trimBoth = new RegExp('^[ \t]+|(?<![ \t])[ \t]+$', 'g');
|
|
86
90
|
}
|
|
87
91
|
catch {
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
trimEnd = /[ \t]+$/;
|
|
93
|
+
trimBoth = /^[ \t]+|[ \t]+$/g;
|
|
90
94
|
}
|
|
91
|
-
let
|
|
92
|
-
if (!match)
|
|
93
|
-
return source;
|
|
94
|
-
let res = match[1];
|
|
95
|
+
let res = match[1].replace(trimEnd, '');
|
|
95
96
|
let sep = ' ';
|
|
96
|
-
let pos =
|
|
97
|
-
line.lastIndex = pos;
|
|
97
|
+
let pos = line.lastIndex;
|
|
98
98
|
while ((match = line.exec(source))) {
|
|
99
|
-
|
|
99
|
+
const lm = match[1].replace(trimBoth, '');
|
|
100
|
+
if (lm === '') {
|
|
100
101
|
if (sep === '\n')
|
|
101
102
|
res += sep;
|
|
102
103
|
else
|
|
103
104
|
sep = '\n';
|
|
104
105
|
}
|
|
105
106
|
else {
|
|
106
|
-
res += sep +
|
|
107
|
+
res += sep + lm;
|
|
107
108
|
sep = ' ';
|
|
108
109
|
}
|
|
109
110
|
pos = line.lastIndex;
|
|
@@ -43,38 +43,40 @@ class Alias extends NodeBase {
|
|
|
43
43
|
if (node.anchor === this.source)
|
|
44
44
|
found = node;
|
|
45
45
|
}
|
|
46
|
+
if (found && ctx) {
|
|
47
|
+
const { anchors, doc, maxAliasCount } = ctx;
|
|
48
|
+
let data = anchors.get(found);
|
|
49
|
+
if (!data) {
|
|
50
|
+
// Resolve anchors for Node.prototype.toJS()
|
|
51
|
+
toJS(found, null, ctx);
|
|
52
|
+
data = anchors.get(found);
|
|
53
|
+
}
|
|
54
|
+
/* istanbul ignore if */
|
|
55
|
+
if (data?.res === undefined) {
|
|
56
|
+
const msg = 'This should not happen: Alias anchor was not resolved?';
|
|
57
|
+
throw new ReferenceError(msg);
|
|
58
|
+
}
|
|
59
|
+
if (maxAliasCount >= 0) {
|
|
60
|
+
data.count += 1;
|
|
61
|
+
if (data.aliasCount === 0)
|
|
62
|
+
data.aliasCount = getAliasCount(doc, found, anchors);
|
|
63
|
+
if (data.count * data.aliasCount > maxAliasCount) {
|
|
64
|
+
const msg = 'Excessive alias count indicates a resource exhaustion attack';
|
|
65
|
+
throw new ReferenceError(msg);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
46
69
|
return found;
|
|
47
70
|
}
|
|
48
71
|
toJSON(_arg, ctx) {
|
|
49
72
|
if (!ctx)
|
|
50
73
|
return { source: this.source };
|
|
51
|
-
const
|
|
52
|
-
const source = this.resolve(doc, ctx);
|
|
74
|
+
const source = this.resolve(ctx.doc, ctx);
|
|
53
75
|
if (!source) {
|
|
54
76
|
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
55
77
|
throw new ReferenceError(msg);
|
|
56
78
|
}
|
|
57
|
-
|
|
58
|
-
if (!data) {
|
|
59
|
-
// Resolve anchors for Node.prototype.toJS()
|
|
60
|
-
toJS(source, null, ctx);
|
|
61
|
-
data = anchors.get(source);
|
|
62
|
-
}
|
|
63
|
-
/* istanbul ignore if */
|
|
64
|
-
if (data?.res === undefined) {
|
|
65
|
-
const msg = 'This should not happen: Alias anchor was not resolved?';
|
|
66
|
-
throw new ReferenceError(msg);
|
|
67
|
-
}
|
|
68
|
-
if (maxAliasCount >= 0) {
|
|
69
|
-
data.count += 1;
|
|
70
|
-
if (data.aliasCount === 0)
|
|
71
|
-
data.aliasCount = getAliasCount(doc, source, anchors);
|
|
72
|
-
if (data.count * data.aliasCount > maxAliasCount) {
|
|
73
|
-
const msg = 'Excessive alias count indicates a resource exhaustion attack';
|
|
74
|
-
throw new ReferenceError(msg);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return data.res;
|
|
79
|
+
return ctx.anchors.get(source).res;
|
|
78
80
|
}
|
|
79
81
|
toString(ctx, _onComment, _onChompKeep) {
|
|
80
82
|
const src = `*${this.source}`;
|
|
@@ -66,46 +66,47 @@ function plainValue(source, onError) {
|
|
|
66
66
|
}
|
|
67
67
|
if (badChar)
|
|
68
68
|
onError(0, 'BAD_SCALAR_START', `Plain value cannot start with ${badChar}`);
|
|
69
|
-
return
|
|
69
|
+
return unfoldLines(source);
|
|
70
70
|
}
|
|
71
71
|
function singleQuotedValue(source, onError) {
|
|
72
72
|
if (source[source.length - 1] !== "'" || source.length === 1)
|
|
73
73
|
onError(source.length, 'MISSING_CHAR', "Missing closing 'quote");
|
|
74
|
-
return
|
|
74
|
+
return unfoldLines(source.slice(1, -1)).replace(/''/g, "'");
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function unfoldLines(source) {
|
|
77
|
+
const line = /(.*?)\r?\n/sy;
|
|
78
|
+
let match = line.exec(source);
|
|
79
|
+
if (!match)
|
|
80
|
+
return source;
|
|
77
81
|
/**
|
|
78
|
-
* The negative
|
|
82
|
+
* The negative lookbehinds in these RegExps are to
|
|
79
83
|
* prevent causing a polynomial search time in certain cases.
|
|
80
84
|
*
|
|
81
|
-
* The try-catch is for Safari
|
|
85
|
+
* The try-catch is for Safari < 16.4 and other old browsers:
|
|
82
86
|
* https://caniuse.com/js-regexp-lookbehind
|
|
83
87
|
*/
|
|
84
|
-
let
|
|
88
|
+
let trimEnd, trimBoth;
|
|
85
89
|
try {
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
trimEnd = new RegExp('(?<![ \t])[ \t]+$');
|
|
91
|
+
trimBoth = new RegExp('^[ \t]+|(?<![ \t])[ \t]+$', 'g');
|
|
88
92
|
}
|
|
89
93
|
catch {
|
|
90
|
-
|
|
91
|
-
|
|
94
|
+
trimEnd = /[ \t]+$/;
|
|
95
|
+
trimBoth = /^[ \t]+|[ \t]+$/g;
|
|
92
96
|
}
|
|
93
|
-
let
|
|
94
|
-
if (!match)
|
|
95
|
-
return source;
|
|
96
|
-
let res = match[1];
|
|
97
|
+
let res = match[1].replace(trimEnd, '');
|
|
97
98
|
let sep = ' ';
|
|
98
|
-
let pos =
|
|
99
|
-
line.lastIndex = pos;
|
|
99
|
+
let pos = line.lastIndex;
|
|
100
100
|
while ((match = line.exec(source))) {
|
|
101
|
-
|
|
101
|
+
const lm = match[1].replace(trimBoth, '');
|
|
102
|
+
if (lm === '') {
|
|
102
103
|
if (sep === '\n')
|
|
103
104
|
res += sep;
|
|
104
105
|
else
|
|
105
106
|
sep = '\n';
|
|
106
107
|
}
|
|
107
108
|
else {
|
|
108
|
-
res += sep +
|
|
109
|
+
res += sep + lm;
|
|
109
110
|
sep = ' ';
|
|
110
111
|
}
|
|
111
112
|
pos = line.lastIndex;
|
|
@@ -45,38 +45,40 @@ class Alias extends Node.NodeBase {
|
|
|
45
45
|
if (node.anchor === this.source)
|
|
46
46
|
found = node;
|
|
47
47
|
}
|
|
48
|
+
if (found && ctx) {
|
|
49
|
+
const { anchors, doc, maxAliasCount } = ctx;
|
|
50
|
+
let data = anchors.get(found);
|
|
51
|
+
if (!data) {
|
|
52
|
+
// Resolve anchors for Node.prototype.toJS()
|
|
53
|
+
toJS.toJS(found, null, ctx);
|
|
54
|
+
data = anchors.get(found);
|
|
55
|
+
}
|
|
56
|
+
/* istanbul ignore if */
|
|
57
|
+
if (data?.res === undefined) {
|
|
58
|
+
const msg = 'This should not happen: Alias anchor was not resolved?';
|
|
59
|
+
throw new ReferenceError(msg);
|
|
60
|
+
}
|
|
61
|
+
if (maxAliasCount >= 0) {
|
|
62
|
+
data.count += 1;
|
|
63
|
+
if (data.aliasCount === 0)
|
|
64
|
+
data.aliasCount = getAliasCount(doc, found, anchors);
|
|
65
|
+
if (data.count * data.aliasCount > maxAliasCount) {
|
|
66
|
+
const msg = 'Excessive alias count indicates a resource exhaustion attack';
|
|
67
|
+
throw new ReferenceError(msg);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
48
71
|
return found;
|
|
49
72
|
}
|
|
50
73
|
toJSON(_arg, ctx) {
|
|
51
74
|
if (!ctx)
|
|
52
75
|
return { source: this.source };
|
|
53
|
-
const
|
|
54
|
-
const source = this.resolve(doc, ctx);
|
|
76
|
+
const source = this.resolve(ctx.doc, ctx);
|
|
55
77
|
if (!source) {
|
|
56
78
|
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
57
79
|
throw new ReferenceError(msg);
|
|
58
80
|
}
|
|
59
|
-
|
|
60
|
-
if (!data) {
|
|
61
|
-
// Resolve anchors for Node.prototype.toJS()
|
|
62
|
-
toJS.toJS(source, null, ctx);
|
|
63
|
-
data = anchors.get(source);
|
|
64
|
-
}
|
|
65
|
-
/* istanbul ignore if */
|
|
66
|
-
if (data?.res === undefined) {
|
|
67
|
-
const msg = 'This should not happen: Alias anchor was not resolved?';
|
|
68
|
-
throw new ReferenceError(msg);
|
|
69
|
-
}
|
|
70
|
-
if (maxAliasCount >= 0) {
|
|
71
|
-
data.count += 1;
|
|
72
|
-
if (data.aliasCount === 0)
|
|
73
|
-
data.aliasCount = getAliasCount(doc, source, anchors);
|
|
74
|
-
if (data.count * data.aliasCount > maxAliasCount) {
|
|
75
|
-
const msg = 'Excessive alias count indicates a resource exhaustion attack';
|
|
76
|
-
throw new ReferenceError(msg);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return data.res;
|
|
81
|
+
return ctx.anchors.get(source).res;
|
|
80
82
|
}
|
|
81
83
|
toString(ctx, _onComment, _onChompKeep) {
|
|
82
84
|
const src = `*${this.source}`;
|
package/package.json
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@types/node": "^18",
|
|
43
43
|
"@typescript-eslint/eslint-plugin": "^8",
|
|
44
44
|
"@typescript-eslint/parser": "^8",
|
|
45
|
-
"commit-and-tag-version": "^
|
|
45
|
+
"commit-and-tag-version": "^13",
|
|
46
46
|
"constructs": "^10.0.0",
|
|
47
47
|
"eslint": "^9",
|
|
48
48
|
"eslint-import-resolver-typescript": "^3.10.1",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"jsii-pacmak": "^1.140.0",
|
|
56
56
|
"jsii-reflect": "^1.140.0",
|
|
57
57
|
"jsii-rosetta": "~5.9",
|
|
58
|
-
"projen": "^0.103.
|
|
58
|
+
"projen": "^0.103.25",
|
|
59
59
|
"ts-jest": "^29",
|
|
60
60
|
"ts-node": "^10.9.2",
|
|
61
61
|
"typescript": "~5.9"
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"projen": ">=0.101.15 <1.0.0"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"yaml": "^2.9.
|
|
68
|
+
"yaml": "^2.9.1"
|
|
69
69
|
},
|
|
70
70
|
"bundledDependencies": [
|
|
71
71
|
"yaml"
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"version": "0.6.
|
|
86
|
+
"version": "0.6.16",
|
|
87
87
|
"packageManager": "yarn@4.13.0",
|
|
88
88
|
"jest": {
|
|
89
89
|
"coverageProvider": "v8",
|