cdk8s 2.70.101 → 2.70.102
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/lib/api-object.js +1 -1
- package/lib/app.js +1 -1
- package/lib/chart.js +1 -1
- package/lib/cron.js +1 -1
- package/lib/dependency.js +2 -2
- package/lib/duration.js +1 -1
- package/lib/helm.js +1 -1
- package/lib/include.js +1 -1
- package/lib/json-patch.js +1 -1
- package/lib/lazy.js +1 -1
- package/lib/metadata.js +1 -1
- package/lib/names.js +1 -1
- package/lib/resolve.js +4 -4
- package/lib/size.js +1 -1
- package/lib/testing.js +1 -1
- package/lib/yaml.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
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bundled": {
|
|
10
10
|
"fast-json-patch": "^3.1.1",
|
|
11
11
|
"follow-redirects": "^1.16.0",
|
|
12
|
-
"yaml": "2.9.
|
|
12
|
+
"yaml": "2.9.1"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"constructs": "^10"
|
|
@@ -4471,6 +4471,6 @@
|
|
|
4471
4471
|
"symbolId": "src/app:YamlOutputType"
|
|
4472
4472
|
}
|
|
4473
4473
|
},
|
|
4474
|
-
"version": "2.70.
|
|
4475
|
-
"fingerprint": "
|
|
4474
|
+
"version": "2.70.102",
|
|
4475
|
+
"fingerprint": "ZlgnepLeljLwFNgDaSSz401Hf5KqXTUxFZA3v1bUtjo="
|
|
4476
4476
|
}
|
package/lib/api-object.js
CHANGED
|
@@ -11,7 +11,7 @@ const resolve_1 = require("./resolve");
|
|
|
11
11
|
const API_OBJECT_SYMBOL = Symbol.for('cdk8s.ApiObject');
|
|
12
12
|
class ApiObject extends constructs_1.Construct {
|
|
13
13
|
props;
|
|
14
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ApiObject", version: "2.70.
|
|
14
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ApiObject", version: "2.70.102" };
|
|
15
15
|
/**
|
|
16
16
|
* Return whether the given object is an `ApiObject`.
|
|
17
17
|
*
|
package/lib/app.js
CHANGED
|
@@ -71,7 +71,7 @@ class SynthRequestCache {
|
|
|
71
71
|
* Represents a cdk8s application.
|
|
72
72
|
*/
|
|
73
73
|
class App extends constructs_1.Construct {
|
|
74
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.App", version: "2.70.
|
|
74
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.App", version: "2.70.102" };
|
|
75
75
|
/**
|
|
76
76
|
* Synthesize a single chart.
|
|
77
77
|
*
|
package/lib/chart.js
CHANGED
|
@@ -9,7 +9,7 @@ const names_1 = require("./names");
|
|
|
9
9
|
const CHART_SYMBOL = Symbol.for('cdk8s.Chart');
|
|
10
10
|
const CRONJOB = 'CronJob';
|
|
11
11
|
class Chart extends constructs_1.Construct {
|
|
12
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Chart", version: "2.70.
|
|
12
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Chart", version: "2.70.102" };
|
|
13
13
|
/**
|
|
14
14
|
* Return whether the given object is a Chart.
|
|
15
15
|
*
|
package/lib/cron.js
CHANGED
|
@@ -6,7 +6,7 @@ const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
|
|
6
6
|
* Represents a cron schedule
|
|
7
7
|
*/
|
|
8
8
|
class Cron {
|
|
9
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Cron", version: "2.70.
|
|
9
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Cron", version: "2.70.102" };
|
|
10
10
|
/**
|
|
11
11
|
* Create a cron schedule which runs every minute
|
|
12
12
|
*/
|
package/lib/dependency.js
CHANGED
|
@@ -16,7 +16,7 @@ const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
class DependencyGraph {
|
|
19
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.DependencyGraph", version: "2.70.
|
|
19
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.DependencyGraph", version: "2.70.102" };
|
|
20
20
|
_fosterParent;
|
|
21
21
|
constructor(node) {
|
|
22
22
|
this._fosterParent = new DependencyVertex();
|
|
@@ -81,7 +81,7 @@ exports.DependencyGraph = DependencyGraph;
|
|
|
81
81
|
* The value of each vertex is an `IConstruct` that is accessible via the `.value` getter.
|
|
82
82
|
*/
|
|
83
83
|
class DependencyVertex {
|
|
84
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.DependencyVertex", version: "2.70.
|
|
84
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.DependencyVertex", version: "2.70.102" };
|
|
85
85
|
_value;
|
|
86
86
|
_children = new Set();
|
|
87
87
|
_parents = new Set();
|
package/lib/duration.js
CHANGED
|
@@ -10,7 +10,7 @@ const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
12
|
class Duration {
|
|
13
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Duration", version: "2.70.
|
|
13
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Duration", version: "2.70.102" };
|
|
14
14
|
/**
|
|
15
15
|
* Create a Duration representing an amount of milliseconds
|
|
16
16
|
*
|
package/lib/helm.js
CHANGED
|
@@ -49,7 +49,7 @@ const MAX_HELM_BUFFER = 10 * 1024 * 1024;
|
|
|
49
49
|
* Use this construct to import an existing Helm chart and incorporate it into your constructs.
|
|
50
50
|
*/
|
|
51
51
|
class Helm extends include_1.Include {
|
|
52
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Helm", version: "2.70.
|
|
52
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Helm", version: "2.70.102" };
|
|
53
53
|
/**
|
|
54
54
|
* The helm release name.
|
|
55
55
|
*/
|
package/lib/include.js
CHANGED
|
@@ -13,7 +13,7 @@ const yaml_1 = require("./yaml");
|
|
|
13
13
|
* from the manifest.
|
|
14
14
|
*/
|
|
15
15
|
class Include extends constructs_1.Construct {
|
|
16
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Include", version: "2.70.
|
|
16
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Include", version: "2.70.102" };
|
|
17
17
|
constructor(scope, id, props) {
|
|
18
18
|
super(scope, id);
|
|
19
19
|
const objects = yaml_1.Yaml.load(props.url);
|
package/lib/json-patch.js
CHANGED
|
@@ -22,7 +22,7 @@ const fast_json_patch_1 = require("fast-json-patch");
|
|
|
22
22
|
*/
|
|
23
23
|
class JsonPatch {
|
|
24
24
|
operation;
|
|
25
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.JsonPatch", version: "2.70.
|
|
25
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.JsonPatch", version: "2.70.102" };
|
|
26
26
|
/**
|
|
27
27
|
* Applies a set of JSON-Patch (RFC-6902) operations to `document` and returns the result.
|
|
28
28
|
* @param document The document to patch
|
package/lib/lazy.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.Lazy = void 0;
|
|
|
4
4
|
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
|
5
5
|
class Lazy {
|
|
6
6
|
producer;
|
|
7
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Lazy", version: "2.70.
|
|
7
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Lazy", version: "2.70.102" };
|
|
8
8
|
static any(producer) {
|
|
9
9
|
return new Lazy(producer);
|
|
10
10
|
}
|
package/lib/metadata.js
CHANGED
|
@@ -8,7 +8,7 @@ const resolve_1 = require("./resolve");
|
|
|
8
8
|
* Object metadata.
|
|
9
9
|
*/
|
|
10
10
|
class ApiObjectMetadataDefinition {
|
|
11
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ApiObjectMetadataDefinition", version: "2.70.
|
|
11
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ApiObjectMetadataDefinition", version: "2.70.102" };
|
|
12
12
|
/**
|
|
13
13
|
* The name of the API object.
|
|
14
14
|
*
|
package/lib/names.js
CHANGED
|
@@ -44,7 +44,7 @@ const HASH_LEN = 8;
|
|
|
44
44
|
* Utilities for generating unique and stable names.
|
|
45
45
|
*/
|
|
46
46
|
class Names {
|
|
47
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Names", version: "2.70.
|
|
47
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Names", version: "2.70.102" };
|
|
48
48
|
/**
|
|
49
49
|
* Generates a unique and stable name compatible DNS_LABEL from RFC-1123 from
|
|
50
50
|
* a path.
|
package/lib/resolve.js
CHANGED
|
@@ -12,7 +12,7 @@ class ResolutionContext {
|
|
|
12
12
|
obj;
|
|
13
13
|
key;
|
|
14
14
|
value;
|
|
15
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ResolutionContext", version: "2.70.
|
|
15
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ResolutionContext", version: "2.70.102" };
|
|
16
16
|
/**
|
|
17
17
|
* The replaced value that was set via the `replaceValue` method.
|
|
18
18
|
*/
|
|
@@ -52,7 +52,7 @@ exports.ResolutionContext = ResolutionContext;
|
|
|
52
52
|
* Resolvers instanecs of `Lazy`.
|
|
53
53
|
*/
|
|
54
54
|
class LazyResolver {
|
|
55
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.LazyResolver", version: "2.70.
|
|
55
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.LazyResolver", version: "2.70.102" };
|
|
56
56
|
resolve(context) {
|
|
57
57
|
if (context.value instanceof lazy_1.Lazy) {
|
|
58
58
|
const resolved = context.value.produce();
|
|
@@ -65,7 +65,7 @@ exports.LazyResolver = LazyResolver;
|
|
|
65
65
|
* Resolves implicit tokens.
|
|
66
66
|
*/
|
|
67
67
|
class ImplicitTokenResolver {
|
|
68
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ImplicitTokenResolver", version: "2.70.
|
|
68
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ImplicitTokenResolver", version: "2.70.102" };
|
|
69
69
|
resolve(context) {
|
|
70
70
|
if (typeof (context.value.resolve) === 'function') {
|
|
71
71
|
const resolved = context.value.resolve();
|
|
@@ -80,7 +80,7 @@ exports.ImplicitTokenResolver = ImplicitTokenResolver;
|
|
|
80
80
|
* E.g IntOrString, Quantity, ...
|
|
81
81
|
*/
|
|
82
82
|
class NumberStringUnionResolver {
|
|
83
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.NumberStringUnionResolver", version: "2.70.
|
|
83
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.NumberStringUnionResolver", version: "2.70.102" };
|
|
84
84
|
static TYPES = ['number', 'string'];
|
|
85
85
|
resolve(context) {
|
|
86
86
|
if (context.value.constructor === Object) {
|
package/lib/size.js
CHANGED
|
@@ -11,7 +11,7 @@ const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
|
|
11
11
|
* When the amount is passed as a token, unit conversion is not possible.
|
|
12
12
|
*/
|
|
13
13
|
class Size {
|
|
14
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Size", version: "2.70.
|
|
14
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Size", version: "2.70.102" };
|
|
15
15
|
/**
|
|
16
16
|
* Create a Storage representing an amount kibibytes.
|
|
17
17
|
* 1 KiB = 1024 bytes
|
package/lib/testing.js
CHANGED
|
@@ -44,7 +44,7 @@ const chart_1 = require("./chart");
|
|
|
44
44
|
* Testing utilities for cdk8s applications.
|
|
45
45
|
*/
|
|
46
46
|
class Testing {
|
|
47
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Testing", version: "2.70.
|
|
47
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Testing", version: "2.70.102" };
|
|
48
48
|
/**
|
|
49
49
|
* Returns an app for testing with the following properties:
|
|
50
50
|
* - Output directory is a temp dir.
|
package/lib/yaml.js
CHANGED
|
@@ -49,7 +49,7 @@ const yamlSchemaVersion = '1.1';
|
|
|
49
49
|
* YAML utilities.
|
|
50
50
|
*/
|
|
51
51
|
class Yaml {
|
|
52
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Yaml", version: "2.70.
|
|
52
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Yaml", version: "2.70.102" };
|
|
53
53
|
/**
|
|
54
54
|
* @deprecated use `stringify(doc[, doc, ...])`
|
|
55
55
|
*/
|
|
@@ -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
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"organization": false
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@cdk8s/projen-common": "^0.1.
|
|
47
|
+
"@cdk8s/projen-common": "^0.1.28",
|
|
48
48
|
"@stylistic/eslint-plugin": "^2",
|
|
49
49
|
"@types/follow-redirects": "^1.14.4",
|
|
50
50
|
"@types/jest": "^30",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"jsii-pacmak": "^1.140.0",
|
|
65
65
|
"jsii-rosetta": "6.0.x",
|
|
66
66
|
"json-schema-to-typescript": "^15.0.4",
|
|
67
|
-
"projen": "^0.103.
|
|
67
|
+
"projen": "^0.103.20",
|
|
68
68
|
"ts-jest": "^29",
|
|
69
69
|
"ts-node": "^10.9.2",
|
|
70
70
|
"typescript": "6.0.x"
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"fast-json-patch": "^3.1.1",
|
|
77
77
|
"follow-redirects": "^1.16.0",
|
|
78
|
-
"yaml": "2.9.
|
|
78
|
+
"yaml": "2.9.1"
|
|
79
79
|
},
|
|
80
80
|
"bundledDependencies": [
|
|
81
81
|
"fast-json-patch",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"publishConfig": {
|
|
105
105
|
"access": "public"
|
|
106
106
|
},
|
|
107
|
-
"version": "2.70.
|
|
107
|
+
"version": "2.70.102",
|
|
108
108
|
"jest": {
|
|
109
109
|
"coverageProvider": "v8",
|
|
110
110
|
"testMatch": [
|