@burdenoff/website-sdk 2026.514.4 → 2026.514.5
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/components/pricing.js +23 -9
- package/dist/components/pricing.js.map +1 -1
- package/dist/components/pricing.mjs +23 -9
- package/dist/components/pricing.mjs.map +1 -1
- package/dist/index.js +23 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1481,27 +1481,41 @@ function getMetadataForPlan(planName, planMetadata) {
|
|
|
1481
1481
|
ctaType: "signup"
|
|
1482
1482
|
};
|
|
1483
1483
|
}
|
|
1484
|
+
function humanizeQuotaName(name) {
|
|
1485
|
+
const parts = name.split(".");
|
|
1486
|
+
const resource = parts.length >= 3 ? parts[parts.length - 2] : parts[parts.length - 1];
|
|
1487
|
+
return resource.replace(/[-_]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
1488
|
+
}
|
|
1484
1489
|
function transformQuotaToFeature(quota) {
|
|
1485
1490
|
const { name, limits } = quota;
|
|
1486
1491
|
if (!limits || typeof limits !== "object") {
|
|
1487
|
-
return name;
|
|
1492
|
+
return humanizeQuotaName(name);
|
|
1488
1493
|
}
|
|
1489
1494
|
const limitsObj = limits;
|
|
1490
1495
|
const value = limitsObj.value;
|
|
1491
1496
|
const unit = limitsObj.unit;
|
|
1492
1497
|
const type = limitsObj.type;
|
|
1493
1498
|
const description = limitsObj.description;
|
|
1494
|
-
if (
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
return
|
|
1499
|
+
if (typeof description === "string" && description) {
|
|
1500
|
+
if (type === "number" && typeof value === "number") {
|
|
1501
|
+
return `${value.toLocaleString()} ${description}`;
|
|
1502
|
+
}
|
|
1503
|
+
return description;
|
|
1504
|
+
}
|
|
1505
|
+
if (typeof unit === "string" && unit) {
|
|
1506
|
+
if (typeof value === "number") {
|
|
1507
|
+
return `${value.toLocaleString()} ${unit}`;
|
|
1508
|
+
}
|
|
1509
|
+
return `${unit}`;
|
|
1510
|
+
}
|
|
1511
|
+
const label = humanizeQuotaName(name);
|
|
1512
|
+
if (type === "boolean") {
|
|
1513
|
+
return label;
|
|
1499
1514
|
}
|
|
1500
1515
|
if (typeof value === "number") {
|
|
1501
|
-
|
|
1502
|
-
return `${name}: ${formattedValue} ${unit || ""}`.trim();
|
|
1516
|
+
return `${value.toLocaleString()} ${label}`;
|
|
1503
1517
|
}
|
|
1504
|
-
return
|
|
1518
|
+
return label;
|
|
1505
1519
|
}
|
|
1506
1520
|
function extractDisplayFeatures(features, planName, fallbackFeatures) {
|
|
1507
1521
|
const quotaFeatures = features.filter((f) => f.quota).map((f) => transformQuotaToFeature(f.quota));
|