@grafana/plugin-ui 0.17.5 → 0.17.6
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.
|
@@ -1275,16 +1275,21 @@ function requireLoader() {
|
|
|
1275
1275
|
state.result += _result;
|
|
1276
1276
|
}
|
|
1277
1277
|
}
|
|
1278
|
+
function chargeMergeWork(state) {
|
|
1279
|
+
state.totalMergeKeys++;
|
|
1280
|
+
if (state.maxTotalMergeKeys !== -1 && state.totalMergeKeys > state.maxTotalMergeKeys) {
|
|
1281
|
+
throwError(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1278
1284
|
function mergeMappings(state, destination, source, overridableKeys) {
|
|
1279
1285
|
if (!common2.isObject(source)) {
|
|
1280
1286
|
throwError(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
1281
1287
|
}
|
|
1288
|
+
chargeMergeWork(state);
|
|
1282
1289
|
const sourceKeys = Object.keys(source);
|
|
1283
1290
|
for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
|
1284
1291
|
const key = sourceKeys[index];
|
|
1285
|
-
|
|
1286
|
-
throwError(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
|
|
1287
|
-
}
|
|
1292
|
+
chargeMergeWork(state);
|
|
1288
1293
|
if (!_hasOwnProperty.call(destination, key)) {
|
|
1289
1294
|
setProperty(destination, key, source[key]);
|
|
1290
1295
|
overridableKeys[key] = true;
|
|
@@ -1312,6 +1317,9 @@ function requireLoader() {
|
|
|
1312
1317
|
}
|
|
1313
1318
|
if (keyTag === "tag:yaml.org,2002:merge") {
|
|
1314
1319
|
if (Array.isArray(valueNode)) {
|
|
1320
|
+
if (valueNode.length > 100) {
|
|
1321
|
+
throwError(state, "abnormal merge sequence size");
|
|
1322
|
+
}
|
|
1315
1323
|
for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {
|
|
1316
1324
|
mergeMappings(state, _result, valueNode[index], overridableKeys);
|
|
1317
1325
|
}
|