@pdfvector/util 0.0.13 → 0.0.14

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.
@@ -24,4 +24,5 @@ export declare const planDefinitions: Record<PlanKey, PlanDefinition>;
24
24
  export declare const planKeys: [PlanKey, ...PlanKey[]];
25
25
  export declare function isPlanKey(value: string): value is PlanKey;
26
26
  export declare function capitalizeKey(key: string): string;
27
+ export declare function getPlanLabel(key: string): string;
27
28
  export declare function formatPlanLabel(plan: Plan): string;
package/.tsc/lib/plan.js CHANGED
@@ -26,10 +26,15 @@ export function isPlanKey(value) {
26
26
  export function capitalizeKey(key) {
27
27
  return key.charAt(0).toUpperCase() + key.slice(1);
28
28
  }
29
+ export function getPlanLabel(key) {
30
+ if (isPlanKey(key))
31
+ return planDefinitions[key].label;
32
+ if (key.startsWith("enterprise-"))
33
+ return "Enterprise (Custom)";
34
+ return capitalizeKey(key);
35
+ }
29
36
  export function formatPlanLabel(plan) {
30
- const label = isPlanKey(plan.key)
31
- ? planDefinitions[plan.key].label
32
- : capitalizeKey(plan.key);
37
+ const label = getPlanLabel(plan.key);
33
38
  const parts = ["the", label];
34
39
  if (plan.key !== "free")
35
40
  parts.push(plan.annual ? "annual" : "monthly");
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @pdfvector/util
2
2
 
3
+ ## 0.0.14
4
+ ### Patch Changes
5
+
6
+
7
+
8
+ - [#106](https://github.com/phuctm97/pdfvector/pull/106) [`8d496e1`](https://github.com/phuctm97/pdfvector/commit/8d496e136d7058dbd6524d6b5c12d716bc7b39a1) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Update plan key display
9
+
3
10
  ## 0.0.13
4
11
  ### Patch Changes
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfvector/util",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "type": "module",
5
5
  "main": ".tsc/lib/index.js",
6
6
  "files": [