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