@ubnt/store.core 10.0.0-pre-alpha.0 → 10.0.0-pre-alpha.2

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.
Files changed (152) hide show
  1. package/lib/_virtual/_virtual_multi-entry.js +10 -14
  2. package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
  3. package/lib/_virtual/_virtual_multi-entry.mjs +10 -14
  4. package/lib/_virtual/_virtual_multi-entry.mjs.map +1 -1
  5. package/lib/assets/attention.svg +5 -5
  6. package/lib/assets/attention2.svg +5 -5
  7. package/lib/assets/express7.jpg +0 -0
  8. package/lib/assets/express72.jpg +0 -0
  9. package/lib/assets/minus4.svg +8 -8
  10. package/lib/assets/minus5.svg +8 -8
  11. package/lib/assets/plus3.svg +9 -9
  12. package/lib/assets/plus4.svg +9 -9
  13. package/lib/assets/ucgMax.jpg +0 -0
  14. package/lib/assets/ucgMax2.jpg +0 -0
  15. package/lib/assets/ucgUltra.jpg +0 -0
  16. package/lib/assets/ucgUltra2.jpg +0 -0
  17. package/lib/assets/udmPro.jpg +0 -0
  18. package/lib/assets/udmPro2.jpg +0 -0
  19. package/lib/assets/udmProMax.jpg +0 -0
  20. package/lib/assets/udmProMax2.jpg +0 -0
  21. package/lib/assets/udmProSpecial.jpg +0 -0
  22. package/lib/assets/udmProSpecial2.jpg +0 -0
  23. package/lib/assets/udr2.jpg +0 -0
  24. package/lib/assets/udr3.jpg +0 -0
  25. package/lib/assets/udr7.jpg +0 -0
  26. package/lib/assets/udr72.jpg +0 -0
  27. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/express7.jpg.js +5 -5
  28. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/express7.jpg.mjs +2 -2
  29. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.js +5 -5
  30. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.mjs +2 -2
  31. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.js +5 -5
  32. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.mjs +2 -2
  33. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.js +5 -5
  34. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.mjs +2 -2
  35. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.js +5 -5
  36. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.mjs +2 -2
  37. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.js +5 -5
  38. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.mjs +2 -2
  39. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr.jpg.js +5 -5
  40. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr.jpg.mjs +2 -2
  41. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr7.jpg.js +5 -5
  42. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr7.jpg.mjs +2 -2
  43. package/lib/components/ModelCompareV3/assets/Consoles/express7.jpg.js +1 -1
  44. package/lib/components/ModelCompareV3/assets/Consoles/express7.jpg.mjs +2 -2
  45. package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.js +1 -1
  46. package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.mjs +2 -2
  47. package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.js +1 -1
  48. package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.mjs +2 -2
  49. package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.js +1 -1
  50. package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.mjs +2 -2
  51. package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.js +1 -1
  52. package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.mjs +2 -2
  53. package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.js +1 -1
  54. package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.mjs +2 -2
  55. package/lib/components/ModelCompareV3/assets/Consoles/udr.jpg.js +1 -1
  56. package/lib/components/ModelCompareV3/assets/Consoles/udr.jpg.mjs +2 -2
  57. package/lib/components/ModelCompareV3/assets/Consoles/udr7.jpg.js +1 -1
  58. package/lib/components/ModelCompareV3/assets/Consoles/udr7.jpg.mjs +2 -2
  59. package/lib/components/ModelCompareV3/data/CloudGateways.js +21 -21
  60. package/lib/components/ModelCompareV3/data/CloudGateways.mjs +14 -14
  61. package/lib/components/ModelCompareV3/data/products/express7.js +1 -1
  62. package/lib/components/ModelCompareV3/data/products/express7.mjs +1 -1
  63. package/lib/components/ModelCompareV3/data/products/ucgMax.js +1 -1
  64. package/lib/components/ModelCompareV3/data/products/ucgMax.mjs +1 -1
  65. package/lib/components/ModelCompareV3/data/products/ucgUltra.js +1 -1
  66. package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs +1 -1
  67. package/lib/components/ModelCompareV3/data/products/udmPro.js +1 -1
  68. package/lib/components/ModelCompareV3/data/products/udmPro.mjs +1 -1
  69. package/lib/components/ModelCompareV3/data/products/udmProMax.js +1 -1
  70. package/lib/components/ModelCompareV3/data/products/udmProMax.mjs +1 -1
  71. package/lib/components/ModelCompareV3/data/products/udmProSpecial.js +1 -1
  72. package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs +1 -1
  73. package/lib/components/ModelCompareV3/data/products/udr.js +1 -1
  74. package/lib/components/ModelCompareV3/data/products/udr.mjs +1 -1
  75. package/lib/components/ModelCompareV3/data/products/udr7.js +1 -1
  76. package/lib/components/ModelCompareV3/data/products/udr7.mjs +1 -1
  77. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
  78. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
  79. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.js +2 -2
  80. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.mjs +2 -2
  81. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
  82. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
  83. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.js +1 -1
  84. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.mjs +2 -2
  85. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.js +1 -1
  86. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.mjs +2 -2
  87. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
  88. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
  89. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
  90. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
  91. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
  92. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
  93. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.js +1 -1
  94. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.mjs +2 -2
  95. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.js +1 -1
  96. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.mjs +2 -2
  97. package/lib/utils/index.d.ts +1 -3
  98. package/lib/utils/index.js +6 -10
  99. package/lib/utils/index.js.map +1 -1
  100. package/lib/utils/index.mjs +6 -10
  101. package/lib/utils/index.mjs.map +1 -1
  102. package/lib/utils/money/allocators/fixedAmount.js +44 -0
  103. package/lib/utils/money/allocators/fixedAmount.js.map +1 -0
  104. package/lib/utils/money/allocators/fixedAmount.mjs +42 -0
  105. package/lib/utils/money/allocators/fixedAmount.mjs.map +1 -0
  106. package/lib/utils/money/allocators/productAmount.js +75 -0
  107. package/lib/utils/money/allocators/productAmount.js.map +1 -0
  108. package/lib/utils/money/allocators/productAmount.mjs +73 -0
  109. package/lib/utils/money/allocators/productAmount.mjs.map +1 -0
  110. package/lib/utils/money/exchangeRate.js +27 -0
  111. package/lib/utils/money/exchangeRate.js.map +1 -0
  112. package/lib/utils/money/exchangeRate.mjs +23 -0
  113. package/lib/utils/money/exchangeRate.mjs.map +1 -0
  114. package/lib/utils/money/format.js +101 -0
  115. package/lib/utils/money/format.js.map +1 -0
  116. package/lib/utils/money/format.mjs +96 -0
  117. package/lib/utils/money/format.mjs.map +1 -0
  118. package/lib/utils/money/index.js +56 -0
  119. package/lib/utils/money/index.js.map +1 -0
  120. package/lib/utils/money/index.mjs +11 -0
  121. package/lib/utils/money/index.mjs.map +1 -0
  122. package/lib/utils/money/shipping.js +8 -0
  123. package/lib/utils/money/shipping.js.map +1 -0
  124. package/lib/utils/money/shipping.mjs +6 -0
  125. package/lib/utils/money/shipping.mjs.map +1 -0
  126. package/lib/utils/money/tax.js +59 -0
  127. package/lib/utils/money/tax.js.map +1 -0
  128. package/lib/utils/money/tax.mjs +51 -0
  129. package/lib/utils/money/tax.mjs.map +1 -0
  130. package/lib/utils/money/tax.private.js +56 -0
  131. package/lib/utils/money/tax.private.js.map +1 -0
  132. package/lib/utils/money/tax.private.mjs +52 -0
  133. package/lib/utils/money/tax.private.mjs.map +1 -0
  134. package/lib/utils/money/types.js +3 -0
  135. package/lib/utils/money/types.js.map +1 -0
  136. package/lib/utils/money/types.mjs +2 -0
  137. package/lib/utils/money/types.mjs.map +1 -0
  138. package/package.json +1 -1
  139. package/lib/utils/collectionSlug.d.ts +0 -5
  140. package/lib/utils/collectionSlug.js +0 -13
  141. package/lib/utils/collectionSlug.js.map +0 -1
  142. package/lib/utils/collectionSlug.mjs +0 -12
  143. package/lib/utils/collectionSlug.mjs.map +0 -1
  144. package/lib/utils/collectionSlug.test.d.ts +0 -1
  145. package/lib/utils/variant.d.ts +0 -8
  146. package/lib/utils/variant.test.d.ts +0 -1
  147. package/lib/utils/wattage.d.ts +0 -11
  148. package/lib/utils/wattage.js +0 -20
  149. package/lib/utils/wattage.js.map +0 -1
  150. package/lib/utils/wattage.mjs +0 -18
  151. package/lib/utils/wattage.mjs.map +0 -1
  152. package/lib/utils/wattage.test.d.ts +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tax.private.mjs","sources":["../../../src/utils/money/tax.private.ts"],"sourcesContent":["// #############################################################################\n// Internal helper functions not for consumption outside of store.core!\n// Wrote as separate files so that they can be easily unit tested without exposing them\n// #############################################################################\nimport { add, dinero, subtract } from \"dinero.js\";\n\nimport { FixedAmountAllocator } from \"./allocators/fixedAmount\";\nimport { Round } from \"./constants\";\nimport { amount, getDinero, getDineroCurrency } from \"./misc\";\nimport type {\n Dino,\n LineItemSummary,\n SingleLineItemSummary,\n TaxRate,\n} from \"./types\";\n\n/**\n * Reverse engineer the taxable amount from \"whole item\" taxable amount into \"per item\" taxable amount for custom tax\n * rate calculations\n */\nexport const allocatePerItemTaxableAmount = (\n itemSummary: LineItemSummary,\n): SingleLineItemSummary[] => {\n /**\n * If the item quantity is 1, we can just return the item summary as is\n */\n if (itemSummary.quantity === 1) {\n return [itemSummary as SingleLineItemSummary];\n }\n\n // Reverse engineer price before discount\n const preDiscountAmount = add(\n getDinero(itemSummary.taxableAmount, itemSummary.currency),\n getDinero(itemSummary.discountAmount, itemSummary.currency),\n );\n\n const allocator = new FixedAmountAllocator({\n initialAllocateAmount: itemSummary.discountAmount,\n initialTotalAmount: amount(preDiscountAmount),\n currency: itemSummary.currency,\n });\n\n // Iterate over the amount of qty to reverse engineer the discount price\n return Array.from({ length: itemSummary.quantity }, () => {\n const discountAllocatedAmount = allocator.allocate(\n itemSummary.itemPrice,\n itemSummary.currency,\n );\n\n const taxableAmount = subtract(\n getDinero(itemSummary.itemPrice, itemSummary.currency),\n discountAllocatedAmount,\n );\n\n return {\n itemPrice: itemSummary.itemPrice,\n taxableAmount: amount(taxableAmount),\n discountAmount: amount(discountAllocatedAmount),\n currency: itemSummary.currency,\n quantity: 1,\n } as SingleLineItemSummary;\n });\n};\n\nexport const calculateWholeQtyLineItemTax = (\n itemSummary: LineItemSummary,\n taxRate: TaxRate,\n): Dino => {\n // Nothing to calculate\n if (taxRate === 0) {\n return getDinero(0, itemSummary.currency);\n }\n\n /**\n * Historically we calculate the tax by using dinero allocation, but we did not have control over how we round things.\n * So instead as we are already working with currency in cents we can multiply and round it ourselves.\n */\n return dinero({\n amount: Round.Financial(itemSummary.taxableAmount * taxRate),\n currency: getDineroCurrency(itemSummary.currency),\n });\n};\n\nexport const calculatePerQtyLineItemTax = (\n itemSummary: LineItemSummary,\n taxRate: TaxRate,\n): Dino => {\n // Nothing to calculate\n if (taxRate === 0) {\n return getDinero(0, itemSummary.currency);\n }\n\n // Split the item summary into per individual item qty summaries\n const singleItemSummaries = allocatePerItemTaxableAmount(itemSummary);\n\n // Calculate individual item qty tax and sum them up\n let totalTaxAmount = getDinero(0, itemSummary.currency);\n\n singleItemSummaries.forEach((itemSummary) => {\n // Probably a bit confusing at first, but calling the whole qty tax calculation function here as we can safely use\n // it as item summary is always a single item summary here\n const taxAmount = calculateWholeQtyLineItemTax(itemSummary, taxRate);\n totalTaxAmount = add(totalTaxAmount, taxAmount);\n });\n\n return totalTaxAmount;\n};\n"],"names":["allocatePerItemTaxableAmount","itemSummary","quantity","preDiscountAmount","add","getDinero","taxableAmount","currency","discountAmount","allocator","FixedAmountAllocator","initialAllocateAmount","initialTotalAmount","amount","Array","from","length","discountAllocatedAmount","allocate","itemPrice","subtract","calculateWholeQtyLineItemTax","taxRate","dinero","Round","Financial","getDineroCurrency","calculatePerQtyLineItemTax","singleItemSummaries","totalTaxAmount","forEach","taxAmount"],"mappings":";;;;;AAoBa,MAAAA,4BAAA,GACXC,WAC4B,IAAA;EAIxB,IAAAA,WAAA,CAAYC,aAAa,CAAG,EAAA;IAC9B,OAAO,CAACD,WAAoC,CAAA;EAAA;EAI9C,MAAME,iBAAoB,GAAAC,GAAA,CACxBC,SAAU,CAAAJ,WAAA,CAAYK,aAAe,EAAAL,WAAA,CAAYM,QAAQ,CAAA,EACzDF,SAAU,CAAAJ,WAAA,CAAYO,cAAgB,EAAAP,WAAA,CAAYM,QAAQ,CAC5D,CAAA;EAEM,MAAAE,SAAA,GAAY,IAAIC,oBAAqB,CAAA;IACzCC,uBAAuBV,WAAY,CAAAO,cAAA;IACnCI,kBAAA,EAAoBC,OAAOV,iBAAiB,CAAA;IAC5CI,UAAUN,WAAY,CAAAM;EAAA,CACvB,CAAA;EAGD,OAAOO,MAAMC,IAAK,CAAA;IAAEC,QAAQf,WAAY,CAAAC;EAAA,GAAY,MAAM;IACxD,MAAMe,0BAA0BR,SAAU,CAAAS,QAAA,CACxCjB,WAAY,CAAAkB,SAAA,EACZlB,WAAY,CAAAM,QACd,CAAA;IAEA,MAAMD,aAAgB,GAAAc,QAAA,CACpBf,SAAU,CAAAJ,WAAA,CAAYkB,SAAW,EAAAlB,WAAA,CAAYM,QAAQ,CAAA,EACrDU,uBACF,CAAA;IAEO,OAAA;MACLE,WAAWlB,WAAY,CAAAkB,SAAA;MACvBb,aAAA,EAAeO,OAAOP,aAAa,CAAA;MACnCE,cAAA,EAAgBK,OAAOI,uBAAuB,CAAA;MAC9CV,UAAUN,WAAY,CAAAM,QAAA;MACtBL,QAAU,EAAA;IACZ,CAAA;EAAA,CACD,CAAA;AACH,CAAA;AAEa,MAAAmB,4BAAA,GAA+BA,CAC1CpB,WAAA,EACAqB,OACS,KAAA;EAET,IAAIA,YAAY,CAAG,EAAA;IACV,OAAAjB,SAAA,CAAU,CAAG,EAAAJ,WAAA,CAAYM,QAAQ,CAAA;EAAA;EAO1C,OAAOgB,MAAO,CAAA;IACZV,MAAQ,EAAAW,KAAA,CAAMC,SAAU,CAAAxB,WAAA,CAAYK,gBAAgBgB,OAAO,CAAA;IAC3Df,QAAA,EAAUmB,iBAAkB,CAAAzB,WAAA,CAAYM,QAAQ;EAAA,CACjD,CAAA;AACH,CAAA;AAEa,MAAAoB,0BAAA,GAA6BA,CACxC1B,WAAA,EACAqB,OACS,KAAA;EAET,IAAIA,YAAY,CAAG,EAAA;IACV,OAAAjB,SAAA,CAAU,CAAG,EAAAJ,WAAA,CAAYM,QAAQ,CAAA;EAAA;EAIpC,MAAAqB,mBAAA,GAAsB5B,6BAA6BC,WAAW,CAAA;EAGpE,IAAI4B,cAAiB,GAAAxB,SAAA,CAAU,CAAG,EAAAJ,WAAA,CAAYM,QAAQ,CAAA;EAElCqB,mBAAA,CAAAE,OAAA,CAAS7B,YAAgB,IAAA;IAGrC,MAAA8B,SAAA,GAAYV,4BAA6BpB,CAAAA,YAAAA,EAAaqB,OAAO,CAAA;IAClDO,cAAA,GAAAzB,GAAA,CAAIyB,gBAAgBE,SAAS,CAAA;EAAA,CAC/C,CAAA;EAEM,OAAAF,cAAA;AACT,CAAA;"}
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+ "use strict";
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubnt/store.core",
3
- "version": "10.0.0-pre-alpha.0",
3
+ "version": "10.0.0-pre-alpha.2",
4
4
  "description": "",
5
5
  "sideEffects": false,
6
6
  "scripts": {
@@ -1,5 +0,0 @@
1
- import type { Nullish } from "../types";
2
- /**
3
- * Extracts the collection slug from a path
4
- */
5
- export declare const getCollectionSlugFromPath: (path: Nullish<string>) => string;
@@ -1,13 +0,0 @@
1
- 'use strict';
2
- "use strict";
3
-
4
- const COLLECTION_SLUG_REGEX = /(\/)?collections\/(.*)/;
5
- const getCollectionSlugFromPath = path => {
6
- if (!path) {
7
- return "";
8
- }
9
- const match = COLLECTION_SLUG_REGEX.exec(path);
10
- return match?.[2] ?? "";
11
- };
12
- exports.getCollectionSlugFromPath = getCollectionSlugFromPath;
13
- //# sourceMappingURL=collectionSlug.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collectionSlug.js","sources":["../../src/utils/collectionSlug.ts"],"sourcesContent":["import type { Nullish } from \"../types\";\n\nconst COLLECTION_SLUG_REGEX = /(\\/)?collections\\/(.*)/;\n\n/**\n * Extracts the collection slug from a path\n */\nexport const getCollectionSlugFromPath = (path: Nullish<string>): string => {\n if (!path) {\n return \"\";\n }\n\n const match = COLLECTION_SLUG_REGEX.exec(path);\n return match?.[2] ?? \"\";\n};\n"],"names":["COLLECTION_SLUG_REGEX","getCollectionSlugFromPath","path","match","exec"],"mappings":";;;AAEA,MAAMA,qBAAwB,GAAA,wBAAA;AAKjB,MAAAC,yBAAA,GAA6BC,IAAkC,IAAA;EAC1E,IAAI,CAACA,IAAM,EAAA;IACF,OAAA,EAAA;EAAA;EAGH,MAAAC,KAAA,GAAQH,qBAAsB,CAAAI,IAAA,CAAKF,IAAI,CAAA;EACtC,OAAAC,KAAA,GAAQ,CAAC,CAAK,IAAA,EAAA;AACvB,CAAA;"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- const COLLECTION_SLUG_REGEX = /(\/)?collections\/(.*)/;
4
- const getCollectionSlugFromPath = path => {
5
- if (!path) {
6
- return "";
7
- }
8
- const match = COLLECTION_SLUG_REGEX.exec(path);
9
- return match?.[2] ?? "";
10
- };
11
- export { getCollectionSlugFromPath };
12
- //# sourceMappingURL=collectionSlug.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collectionSlug.mjs","sources":["../../src/utils/collectionSlug.ts"],"sourcesContent":["import type { Nullish } from \"../types\";\n\nconst COLLECTION_SLUG_REGEX = /(\\/)?collections\\/(.*)/;\n\n/**\n * Extracts the collection slug from a path\n */\nexport const getCollectionSlugFromPath = (path: Nullish<string>): string => {\n if (!path) {\n return \"\";\n }\n\n const match = COLLECTION_SLUG_REGEX.exec(path);\n return match?.[2] ?? \"\";\n};\n"],"names":["COLLECTION_SLUG_REGEX","getCollectionSlugFromPath","path","match","exec"],"mappings":";;AAEA,MAAMA,qBAAwB,GAAA,wBAAA;AAKjB,MAAAC,yBAAA,GAA6BC,IAAkC,IAAA;EAC1E,IAAI,CAACA,IAAM,EAAA;IACF,OAAA,EAAA;EAAA;EAGH,MAAAC,KAAA,GAAQH,qBAAsB,CAAAI,IAAA,CAAKF,IAAI,CAAA;EACtC,OAAAC,KAAA,GAAQ,CAAC,CAAK,IAAA,EAAA;AACvB,CAAA;"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * Removes the regional (and other) SKU postfix from the SKU.
3
- */
4
- export declare const removeRegionalSkuPostfix: (sku?: string) => string | undefined;
5
- /**
6
- * Returns the SKU text with the extra label if it exists.
7
- */
8
- export declare const getSkuText: (sku?: string, extraLabel?: string) => string | undefined;
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- /**
2
- * Get the PoE wattage from a tag
3
- * @example "poe:100w" => "100W"
4
- */
5
- export declare const getPoeWattageFromTag: (tagName: string | undefined) => string | undefined;
6
- /**
7
- * Finds first PoE wattage tag and returns the wattage
8
- */
9
- export declare const getPoeWattageFromTags: (tags: {
10
- name: string;
11
- }[]) => string | undefined;
@@ -1,20 +0,0 @@
1
- 'use strict';
2
- "use strict";
3
-
4
- const POE_WATTAGE_REGEX = /poe:(\d+)w/i;
5
- const getPoeWattageFromTag = tagName => {
6
- if (!tagName) return void 0;
7
- const wattage = POE_WATTAGE_REGEX.exec(tagName)?.[1];
8
- if (!wattage?.length) return void 0;
9
- return `${wattage}W`;
10
- };
11
- const getPoeWattageFromTags = tags => {
12
- for (const tag of tags) {
13
- const watts = getPoeWattageFromTag(tag.name);
14
- if (watts) return watts;
15
- }
16
- return void 0;
17
- };
18
- exports.getPoeWattageFromTag = getPoeWattageFromTag;
19
- exports.getPoeWattageFromTags = getPoeWattageFromTags;
20
- //# sourceMappingURL=wattage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wattage.js","sources":["../../src/utils/wattage.ts"],"sourcesContent":["// #############################################################################\n// PoE Wattage Tags\n// #############################################################################\n\nconst POE_WATTAGE_REGEX = /poe:(\\d+)w/i;\n\n/**\n * Get the PoE wattage from a tag\n * @example \"poe:100w\" => \"100W\"\n */\nexport const getPoeWattageFromTag = (tagName: string | undefined) => {\n // If there is no wattage tag, return undefined\n if (!tagName) return undefined;\n\n // Get the wattage from the tag\n const wattage = POE_WATTAGE_REGEX.exec(tagName)?.[1];\n\n // If there is no wattage, return undefined\n if (!wattage?.length) return undefined;\n\n // Return the wattage\n return `${wattage}W`;\n};\n\n/**\n * Finds first PoE wattage tag and returns the wattage\n */\nexport const getPoeWattageFromTags = (\n tags: { name: string }[],\n): string | undefined => {\n for (const tag of tags) {\n const watts = getPoeWattageFromTag(tag.name);\n\n if (watts) return watts;\n }\n\n return undefined;\n};\n"],"names":["POE_WATTAGE_REGEX","getPoeWattageFromTag","tagName","wattage","exec","length","getPoeWattageFromTags","tags","tag","watts","name"],"mappings":";;;AAIA,MAAMA,iBAAoB,GAAA,aAAA;AAMb,MAAAC,oBAAA,GAAwBC,OAAgC,IAAA;EAE/D,IAAA,CAACA,SAAgB,OAAA,KAAA,CAAA;EAGrB,MAAMC,OAAU,GAAAH,iBAAA,CAAkBI,IAAK,CAAAF,OAAO,IAAI,CAAC,CAAA;EAG/C,IAAA,CAACC,OAAS,EAAAE,MAAA,EAAe,OAAA,KAAA,CAAA;EAG7B,OAAO,GAAGF,OAAO,GAAA;AACnB,CAAA;AAKa,MAAAG,qBAAA,GACXC,IACuB,IAAA;EACvB,KAAA,MAAWC,OAAOD,IAAM,EAAA;IAChB,MAAAE,KAAA,GAAQR,oBAAqB,CAAAO,GAAA,CAAIE,IAAI,CAAA;IAE3C,IAAID,OAAc,OAAAA,KAAA;EAAA;EAGb,OAAA,KAAA,CAAA;AACT,CAAA;;"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- const POE_WATTAGE_REGEX = /poe:(\d+)w/i;
4
- const getPoeWattageFromTag = tagName => {
5
- if (!tagName) return void 0;
6
- const wattage = POE_WATTAGE_REGEX.exec(tagName)?.[1];
7
- if (!wattage?.length) return void 0;
8
- return `${wattage}W`;
9
- };
10
- const getPoeWattageFromTags = tags => {
11
- for (const tag of tags) {
12
- const watts = getPoeWattageFromTag(tag.name);
13
- if (watts) return watts;
14
- }
15
- return void 0;
16
- };
17
- export { getPoeWattageFromTag, getPoeWattageFromTags };
18
- //# sourceMappingURL=wattage.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wattage.mjs","sources":["../../src/utils/wattage.ts"],"sourcesContent":["// #############################################################################\n// PoE Wattage Tags\n// #############################################################################\n\nconst POE_WATTAGE_REGEX = /poe:(\\d+)w/i;\n\n/**\n * Get the PoE wattage from a tag\n * @example \"poe:100w\" => \"100W\"\n */\nexport const getPoeWattageFromTag = (tagName: string | undefined) => {\n // If there is no wattage tag, return undefined\n if (!tagName) return undefined;\n\n // Get the wattage from the tag\n const wattage = POE_WATTAGE_REGEX.exec(tagName)?.[1];\n\n // If there is no wattage, return undefined\n if (!wattage?.length) return undefined;\n\n // Return the wattage\n return `${wattage}W`;\n};\n\n/**\n * Finds first PoE wattage tag and returns the wattage\n */\nexport const getPoeWattageFromTags = (\n tags: { name: string }[],\n): string | undefined => {\n for (const tag of tags) {\n const watts = getPoeWattageFromTag(tag.name);\n\n if (watts) return watts;\n }\n\n return undefined;\n};\n"],"names":["POE_WATTAGE_REGEX","getPoeWattageFromTag","tagName","wattage","exec","length","getPoeWattageFromTags","tags","tag","watts","name"],"mappings":";;AAIA,MAAMA,iBAAoB,GAAA,aAAA;AAMb,MAAAC,oBAAA,GAAwBC,OAAgC,IAAA;EAE/D,IAAA,CAACA,SAAgB,OAAA,KAAA,CAAA;EAGrB,MAAMC,OAAU,GAAAH,iBAAA,CAAkBI,IAAK,CAAAF,OAAO,IAAI,CAAC,CAAA;EAG/C,IAAA,CAACC,OAAS,EAAAE,MAAA,EAAe,OAAA,KAAA,CAAA;EAG7B,OAAO,GAAGF,OAAO,GAAA;AACnB,CAAA;AAKa,MAAAG,qBAAA,GACXC,IACuB,IAAA;EACvB,KAAA,MAAWC,OAAOD,IAAM,EAAA;IAChB,MAAAE,KAAA,GAAQR,oBAAqB,CAAAO,GAAA,CAAIE,IAAI,CAAA;IAE3C,IAAID,OAAc,OAAAA,KAAA;EAAA;EAGb,OAAA,KAAA,CAAA;AACT,CAAA;"}
@@ -1 +0,0 @@
1
- export {};