@grafana/plugin-ui 0.17.5 → 0.17.8
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/dist/cjs/index.cjs
CHANGED
|
@@ -21447,16 +21447,21 @@ function requireLoader() {
|
|
|
21447
21447
|
state.result += _result;
|
|
21448
21448
|
}
|
|
21449
21449
|
}
|
|
21450
|
+
function chargeMergeWork(state) {
|
|
21451
|
+
state.totalMergeKeys++;
|
|
21452
|
+
if (state.maxTotalMergeKeys !== -1 && state.totalMergeKeys > state.maxTotalMergeKeys) {
|
|
21453
|
+
throwError(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
|
|
21454
|
+
}
|
|
21455
|
+
}
|
|
21450
21456
|
function mergeMappings(state, destination, source, overridableKeys) {
|
|
21451
21457
|
if (!common2.isObject(source)) {
|
|
21452
21458
|
throwError(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
21453
21459
|
}
|
|
21460
|
+
chargeMergeWork(state);
|
|
21454
21461
|
const sourceKeys = Object.keys(source);
|
|
21455
21462
|
for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
|
21456
21463
|
const key = sourceKeys[index];
|
|
21457
|
-
|
|
21458
|
-
throwError(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
|
|
21459
|
-
}
|
|
21464
|
+
chargeMergeWork(state);
|
|
21460
21465
|
if (!_hasOwnProperty.call(destination, key)) {
|
|
21461
21466
|
setProperty(destination, key, source[key]);
|
|
21462
21467
|
overridableKeys[key] = true;
|
|
@@ -21484,6 +21489,9 @@ function requireLoader() {
|
|
|
21484
21489
|
}
|
|
21485
21490
|
if (keyTag === "tag:yaml.org,2002:merge") {
|
|
21486
21491
|
if (Array.isArray(valueNode)) {
|
|
21492
|
+
if (valueNode.length > 100) {
|
|
21493
|
+
throwError(state, "abnormal merge sequence size");
|
|
21494
|
+
}
|
|
21487
21495
|
for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {
|
|
21488
21496
|
mergeMappings(state, _result, valueNode[index], overridableKeys);
|
|
21489
21497
|
}
|