@prorobotech/openapi-k8s-toolkit 1.2.0-alpha.10 → 1.2.0-alpha.11
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.
|
@@ -34143,13 +34143,53 @@ const convertStorage = (value, from, to, opts) => {
|
|
|
34143
34143
|
if (bytes < 0) return -1;
|
|
34144
34144
|
return convertBytes(bytes, to, opts);
|
|
34145
34145
|
};
|
|
34146
|
+
const normalizeAutoNumber$1 = (raw) => {
|
|
34147
|
+
let s = raw.trim();
|
|
34148
|
+
s = s.replace(/[\s\u00A0\u202F_]/g, "");
|
|
34149
|
+
s = s.replace(/'/g, "");
|
|
34150
|
+
const hasDot = s.includes(".");
|
|
34151
|
+
const hasComma = s.includes(",");
|
|
34152
|
+
if (hasDot && hasComma) {
|
|
34153
|
+
const lastDot = s.lastIndexOf(".");
|
|
34154
|
+
const lastComma = s.lastIndexOf(",");
|
|
34155
|
+
const decimal = lastDot > lastComma ? "." : ",";
|
|
34156
|
+
const group = decimal === "." ? "," : ".";
|
|
34157
|
+
s = s.split(group).join("");
|
|
34158
|
+
if (decimal === ",") s = s.replace(/,/g, ".");
|
|
34159
|
+
return s;
|
|
34160
|
+
}
|
|
34161
|
+
if (hasComma && !hasDot) {
|
|
34162
|
+
const parts = s.split(",");
|
|
34163
|
+
if (parts.length > 2) {
|
|
34164
|
+
return parts.join("");
|
|
34165
|
+
}
|
|
34166
|
+
const [intPart, fracPart = ""] = parts;
|
|
34167
|
+
if (fracPart.length === 3 && intPart.length >= 1) {
|
|
34168
|
+
return intPart + fracPart;
|
|
34169
|
+
}
|
|
34170
|
+
return intPart + (fracPart ? "." + fracPart : "");
|
|
34171
|
+
}
|
|
34172
|
+
if (hasDot && !hasComma) {
|
|
34173
|
+
const parts = s.split(".");
|
|
34174
|
+
if (parts.length > 2) {
|
|
34175
|
+
return parts.join("");
|
|
34176
|
+
}
|
|
34177
|
+
const [intPart, fracPart = ""] = parts;
|
|
34178
|
+
if (fracPart.length === 3 && intPart.length >= 1) {
|
|
34179
|
+
return intPart + fracPart;
|
|
34180
|
+
}
|
|
34181
|
+
return intPart + (fracPart ? "." + fracPart : "");
|
|
34182
|
+
}
|
|
34183
|
+
return s;
|
|
34184
|
+
};
|
|
34146
34185
|
const parseValueWithUnit = (input) => {
|
|
34147
34186
|
const trimmed = input.trim();
|
|
34148
34187
|
if (!trimmed) return null;
|
|
34149
|
-
const match = trimmed.match(/^([+-]?\d
|
|
34188
|
+
const match = trimmed.match(/^([+-]?\d(?:[\d\s\u00A0\u202F.,'_]*\d)?)(?:\s*([a-zA-Z]+))?$/);
|
|
34150
34189
|
if (!match) return null;
|
|
34151
|
-
const [,
|
|
34152
|
-
const
|
|
34190
|
+
const [, numPartRaw, unitPart] = match;
|
|
34191
|
+
const normalized = normalizeAutoNumber$1(numPartRaw);
|
|
34192
|
+
const value = Number(normalized);
|
|
34153
34193
|
if (!Number.isFinite(value)) return null;
|
|
34154
34194
|
if (unitPart) {
|
|
34155
34195
|
return { value, unit: unitPart };
|
|
@@ -34246,18 +34286,72 @@ const convertCompute = (value, from, to, opts) => {
|
|
|
34246
34286
|
if (cores < 0) return -1;
|
|
34247
34287
|
return convertCores(cores, to, opts);
|
|
34248
34288
|
};
|
|
34289
|
+
const isDigits = (s) => /^\d+$/.test(s);
|
|
34290
|
+
const isValidThousandGrouping = (parts) => {
|
|
34291
|
+
if (parts.length < 3) return false;
|
|
34292
|
+
if (parts.some((p) => p.length === 0)) return false;
|
|
34293
|
+
if (!parts.every(isDigits)) return false;
|
|
34294
|
+
if (parts[0].length < 1 || parts[0].length > 3) return false;
|
|
34295
|
+
for (let i = 1; i < parts.length; i++) {
|
|
34296
|
+
if (parts[i].length !== 3) return false;
|
|
34297
|
+
}
|
|
34298
|
+
return true;
|
|
34299
|
+
};
|
|
34300
|
+
const normalizeAutoNumber = (raw) => {
|
|
34301
|
+
let s = raw.trim();
|
|
34302
|
+
s = s.replace(/[\s\u00A0\u202F_]/g, "");
|
|
34303
|
+
s = s.replace(/'/g, "");
|
|
34304
|
+
const hasDot = s.includes(".");
|
|
34305
|
+
const hasComma = s.includes(",");
|
|
34306
|
+
if (hasDot && hasComma) {
|
|
34307
|
+
const lastDot = s.lastIndexOf(".");
|
|
34308
|
+
const lastComma = s.lastIndexOf(",");
|
|
34309
|
+
const decimal = lastDot > lastComma ? "." : ",";
|
|
34310
|
+
const group = decimal === "." ? "," : ".";
|
|
34311
|
+
s = s.split(group).join("");
|
|
34312
|
+
if (decimal === ",") s = s.replace(/,/g, ".");
|
|
34313
|
+
return s;
|
|
34314
|
+
}
|
|
34315
|
+
if (hasComma && !hasDot) {
|
|
34316
|
+
const parts = s.split(",");
|
|
34317
|
+
if (parts.length > 2) {
|
|
34318
|
+
if (!isValidThousandGrouping(parts)) return null;
|
|
34319
|
+
return parts.join("");
|
|
34320
|
+
}
|
|
34321
|
+
const [intPart, fracPart = ""] = parts;
|
|
34322
|
+
if (!isDigits(intPart || "0") || fracPart && !isDigits(fracPart)) return null;
|
|
34323
|
+
if (fracPart.length === 3 && intPart.length >= 1) {
|
|
34324
|
+
return intPart + fracPart;
|
|
34325
|
+
}
|
|
34326
|
+
return intPart + (fracPart ? "." + fracPart : "");
|
|
34327
|
+
}
|
|
34328
|
+
if (hasDot && !hasComma) {
|
|
34329
|
+
const parts = s.split(".");
|
|
34330
|
+
if (parts.length > 2) {
|
|
34331
|
+
if (!isValidThousandGrouping(parts)) return null;
|
|
34332
|
+
return parts.join("");
|
|
34333
|
+
}
|
|
34334
|
+
const [intPart, fracPart = ""] = parts;
|
|
34335
|
+
if (!isDigits(intPart || "0") || fracPart && !isDigits(fracPart)) return null;
|
|
34336
|
+
if (fracPart.length === 3 && intPart.length >= 1) {
|
|
34337
|
+
return intPart + fracPart;
|
|
34338
|
+
}
|
|
34339
|
+
return intPart + (fracPart ? "." + fracPart : "");
|
|
34340
|
+
}
|
|
34341
|
+
if (!isDigits(s.replace(/^[+-]/, ""))) return null;
|
|
34342
|
+
return s;
|
|
34343
|
+
};
|
|
34249
34344
|
const parseCoresWithUnit = (input) => {
|
|
34250
34345
|
const trimmed = input.trim();
|
|
34251
34346
|
if (!trimmed) return null;
|
|
34252
|
-
const match = trimmed.match(/^([+-]?\d
|
|
34347
|
+
const match = trimmed.match(/^([+-]?\d(?:[\d\s\u00A0\u202F.,'_]*\d)?)(?:\s*([a-zA-Zµ]+))?$/);
|
|
34253
34348
|
if (!match) return null;
|
|
34254
|
-
const [,
|
|
34255
|
-
const
|
|
34349
|
+
const [, numPartRaw, unitPart] = match;
|
|
34350
|
+
const normalized = normalizeAutoNumber(numPartRaw);
|
|
34351
|
+
if (!normalized) return null;
|
|
34352
|
+
const value = Number(normalized);
|
|
34256
34353
|
if (!Number.isFinite(value)) return null;
|
|
34257
|
-
|
|
34258
|
-
return { value, unit: unitPart };
|
|
34259
|
-
}
|
|
34260
|
-
return { value };
|
|
34354
|
+
return unitPart ? { value, unit: unitPart } : { value };
|
|
34261
34355
|
};
|
|
34262
34356
|
|
|
34263
34357
|
const DynamicRendererInner = ({
|
|
@@ -47156,7 +47250,6 @@ const getEnrichedColumns = ({
|
|
|
47156
47250
|
const isSortersAndFiltersDisabled = possibleAdditionalPrinterColumnsCustomSortersAndFiltersType === "disabled";
|
|
47157
47251
|
const isSortersAndFiltersCPU = possibleAdditionalPrinterColumnsCustomSortersAndFiltersType === "cpu";
|
|
47158
47252
|
const isSortersAndFiltersMemory = possibleAdditionalPrinterColumnsCustomSortersAndFiltersType === "memory";
|
|
47159
|
-
console.log(`key: ${el.key}, isSortersAndFiltersMemory: ${isSortersAndFiltersMemory}`);
|
|
47160
47253
|
const possibleUndefinedValue = additionalPrinterColumnsUndefinedValues?.find(({ key }) => key === el.key)?.value;
|
|
47161
47254
|
const possibleTrimLength = additionalPrinterColumnsTrimLengths?.find(({ key }) => key === el.key)?.value;
|
|
47162
47255
|
const possibleColWidth = additionalPrinterColumnsColWidths?.find(({ key }) => key === el.key)?.value;
|
|
@@ -47172,7 +47265,6 @@ const getEnrichedColumns = ({
|
|
|
47172
47265
|
};
|
|
47173
47266
|
const getMemoryInBytes = (record) => {
|
|
47174
47267
|
const text = getCellTextFromDOM(record);
|
|
47175
|
-
console.log(`text from cell ${text}`);
|
|
47176
47268
|
if (!text) return 0;
|
|
47177
47269
|
const parsed = parseValueWithUnit(text);
|
|
47178
47270
|
if (!parsed) return 0;
|
|
@@ -47273,7 +47365,6 @@ const getEnrichedColumns = ({
|
|
|
47273
47365
|
if (isSortersAndFiltersMemory) {
|
|
47274
47366
|
const aBytes = getMemoryInBytes(a);
|
|
47275
47367
|
const bBytes = getMemoryInBytes(b);
|
|
47276
|
-
console.log(`isSortersAndFiltersMemory ${aBytes}/${bBytes}`);
|
|
47277
47368
|
return safeNumericCompare(aBytes, bBytes);
|
|
47278
47369
|
}
|
|
47279
47370
|
if (isSortersAndFiltersCPU) {
|