@ubnt/store.core 11.26.0-custom-tax.0 → 11.26.0
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/CHANGELOG.md +6 -1
- package/lib/_virtual/_virtual_multi-entry.js +0 -2
- package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
- package/lib/_virtual/_virtual_multi-entry.mjs +0 -2
- package/lib/_virtual/_virtual_multi-entry.mjs.map +1 -1
- package/lib/assets/ai-360.jpg +0 -0
- package/lib/assets/ai-3602.jpg +0 -0
- package/lib/assets/ai-theta.jpg +0 -0
- package/lib/assets/ai-theta2.jpg +0 -0
- package/lib/assets/attention.svg +1 -1
- package/lib/assets/attention2.svg +1 -1
- package/lib/assets/bullet2.svg +1 -1
- package/lib/assets/bullet3.svg +1 -1
- package/lib/assets/door-hub.jpg +0 -0
- package/lib/assets/door-hub2.jpg +0 -0
- package/lib/assets/floodlight.svg +1 -1
- package/lib/assets/floodlight2.svg +1 -1
- package/lib/assets/g2-reader.jpg +0 -0
- package/lib/assets/g2-reader2.jpg +0 -0
- package/lib/assets/g3-reader-pro.jpg +0 -0
- package/lib/assets/g3-reader-pro2.jpg +0 -0
- package/lib/assets/g3-starter-kit-pro.jpg +0 -0
- package/lib/assets/g3-starter-kit-pro2.jpg +0 -0
- package/lib/assets/g3-starter-kit.jpg +0 -0
- package/lib/assets/g3-starter-kit2.jpg +0 -0
- package/lib/assets/g4-instant.jpg +0 -0
- package/lib/assets/g4-instant2.jpg +0 -0
- package/lib/assets/g4-ptz.jpg +0 -0
- package/lib/assets/g4-ptz2.jpg +0 -0
- package/lib/assets/g5-dome-ultra.jpg +0 -0
- package/lib/assets/g5-dome-ultra2.jpg +0 -0
- package/lib/assets/g5-ptz.jpg +0 -0
- package/lib/assets/g5-ptz2.jpg +0 -0
- package/lib/assets/globe.svg +1 -1
- package/lib/assets/globe2.svg +1 -1
- package/lib/assets/intercom.jpg +0 -0
- package/lib/assets/intercom2.jpg +0 -0
- package/lib/assets/interior-design.svg +1 -1
- package/lib/assets/interior-design2.svg +1 -1
- package/lib/assets/minus4.svg +1 -1
- package/lib/assets/minus5.svg +1 -1
- package/lib/assets/pause.svg +1 -1
- package/lib/assets/pause2.svg +1 -1
- package/lib/assets/plus4.svg +1 -1
- package/lib/assets/plus5.svg +1 -1
- package/lib/assets/power.svg +1 -1
- package/lib/assets/power2.svg +1 -1
- package/lib/assets/ptz2.svg +1 -1
- package/lib/assets/ptz3.svg +1 -1
- package/lib/assets/rack.svg +1 -1
- package/lib/assets/rack2.svg +1 -1
- package/lib/assets/udr.jpg +0 -0
- package/lib/assets/udr2.jpg +0 -0
- package/lib/assets/udr3.jpg +0 -0
- package/lib/assets/udw.jpg +0 -0
- package/lib/assets/udw2.jpg +0 -0
- package/lib/assets/umr.jpg +0 -0
- package/lib/assets/umr2.jpg +0 -0
- package/lib/components/Explore/ExploreData.js +3 -3
- package/lib/components/Explore/ExploreData.mjs +3 -3
- package/lib/components/Explore/assets/udr.jpg.js +1 -1
- package/lib/components/Explore/assets/udr.jpg.mjs +2 -2
- package/lib/components/Explore/assets/udw.jpg.js +1 -1
- package/lib/components/Explore/assets/udw.jpg.mjs +2 -2
- package/lib/components/Explore/assets/umr.jpg.js +1 -1
- package/lib/components/Explore/assets/umr.jpg.mjs +2 -2
- package/lib/components/Header/Header.js +1 -1
- package/lib/components/Header/Header.mjs +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.js +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.js.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.mjs +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.js +1 -1
- package/lib/components/Header/ProHeader/ProHeader.mjs +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.js +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.mjs +1 -1
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.js +1 -1
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.mjs +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.js +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.js +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.mjs +2 -2
- package/lib/components/VideoPlayerNew/VideoPlayer.js +1 -1
- package/lib/components/VideoPlayerNew/VideoPlayer.mjs +1 -1
- package/lib/components/VideoPlayerNew/assets/pause.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/pause.svg.mjs +2 -2
- package/lib/constants/icons/header/globe.svg.js +1 -1
- package/lib/constants/icons/header/globe.svg.mjs +2 -2
- package/lib/constants/icons/header/index.js +1 -1
- package/lib/constants/icons/header/index.mjs +1 -1
- package/lib/constants/icons/menu/floodlight.svg.js +5 -5
- package/lib/constants/icons/menu/floodlight.svg.mjs +2 -2
- package/lib/constants/icons/menu/index.js +9 -9
- package/lib/constants/icons/menu/index.mjs +3 -3
- package/lib/constants/icons/menu/power.svg.js +5 -5
- package/lib/constants/icons/menu/power.svg.mjs +2 -2
- package/lib/constants/icons/menu/rack.svg.js +5 -5
- package/lib/constants/icons/menu/rack.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Bullet/bullet.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/bullet.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Compact/g4-instant.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Compact/g4-instant.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udr.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udw.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udw.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/udr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/udr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-360.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-360.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/g5-dome-ultra.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/g5-dome-ultra.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g2-reader.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g2-reader.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/intercom.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/intercom.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Interior/ai-theta.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Interior/ai-theta.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/MobileRouters/umr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/MobileRouters/umr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/PTZ/g4-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/PTZ/g4-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/PTZ/g5-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/PTZ/g5-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/floodlight.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/floodlight.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/globe.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/globe.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/interior-design.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/interior-design.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/power.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/power.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/bullet.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/bullet.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/compact/g4-instant.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/compact/g4-instant.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-360.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-360.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-dome-ultra.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-dome-ultra.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g2-reader.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g2-reader.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/intercom.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/intercom.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/interior-design/ai-theta.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/interior-design/ai-theta.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g4-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g4-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g5-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g5-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/interior-design.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/interior-design.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/ptz.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/ptz.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/ptz.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/ptz.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/rack.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/rack.svg.mjs +2 -2
- package/lib/constants/modelCompareData/data/CloudGateways.js +1 -1
- package/lib/constants/modelCompareData/data/CloudGateways.mjs +1 -1
- package/lib/constants/modelCompareData/data/DreamMachineConsolev4.js +4 -4
- package/lib/constants/modelCompareData/data/DreamMachineConsolev4.mjs +3 -3
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Bullet.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Bullet.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/InteriorDesign.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/InteriorDesign.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Ptz.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Ptz.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/bullet.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/bullet.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/interiorDesign.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/interiorDesign.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/ptz.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/ptz.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/ai360.js +2 -2
- package/lib/constants/modelCompareData/data/products/ai360.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/doorHub.js +2 -2
- package/lib/constants/modelCompareData/data/products/doorHub.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g2Reader.js +2 -2
- package/lib/constants/modelCompareData/data/products/g2Reader.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderPro.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderPro.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKit.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKit.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKitPro.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKitPro.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g4Instant.js +2 -2
- package/lib/constants/modelCompareData/data/products/g4Instant.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g4Ptz.js +2 -2
- package/lib/constants/modelCompareData/data/products/g4Ptz.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g5DomeUltra.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5DomeUltra.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g5Ptz.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5Ptz.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/intercom.js +2 -2
- package/lib/constants/modelCompareData/data/products/intercom.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/theta.js +2 -2
- package/lib/constants/modelCompareData/data/products/theta.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/udr.js +1 -1
- package/lib/constants/modelCompareData/data/products/udr.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/udw.js +1 -1
- package/lib/constants/modelCompareData/data/products/udw.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/umr.js +1 -1
- package/lib/constants/modelCompareData/data/products/umr.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/accessPowerMethod.js +1 -1
- package/lib/constants/modelCompareData/data/properties/accessPowerMethod.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/availability.js +1 -1
- package/lib/constants/modelCompareData/data/properties/availability.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/builtInFloodlight.js +1 -1
- package/lib/constants/modelCompareData/data/properties/builtInFloodlight.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/dcPowerOutput.js +1 -1
- package/lib/constants/modelCompareData/data/properties/dcPowerOutput.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/mounting.js +1 -1
- package/lib/constants/modelCompareData/data/properties/mounting.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/unasPowerMethod.js +1 -1
- package/lib/constants/modelCompareData/data/properties/unasPowerMethod.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/webMode.js +1 -1
- package/lib/constants/modelCompareData/data/properties/webMode.mjs +1 -1
- package/lib/contexts/MenuContext/mapping.js +3 -3
- package/lib/contexts/MenuContext/mapping.mjs +2 -2
- package/lib/contexts/MicrositeMenuContext/mapping.js +3 -3
- package/lib/contexts/MicrositeMenuContext/mapping.mjs +2 -2
- package/lib/utils/address.d.ts +67 -1
- package/lib/utils/address.js +2 -1
- package/lib/utils/address.js.map +1 -1
- package/lib/utils/address.mjs +2 -1
- package/lib/utils/address.mjs.map +1 -1
- package/lib/utils/array.d.ts +0 -6
- package/lib/utils/array.js +0 -9
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/array.mjs +1 -9
- package/lib/utils/array.mjs.map +1 -1
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.js +0 -2
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/index.mjs +0 -2
- package/lib/utils/index.mjs.map +1 -1
- package/lib/utils/money/index.d.ts +0 -1
- package/lib/utils/money/index.js +0 -2
- package/lib/utils/money/index.js.map +1 -1
- package/lib/utils/money/index.mjs +0 -1
- package/lib/utils/money/index.mjs.map +1 -1
- package/lib/utils/money/tax.d.ts +3 -6
- package/lib/utils/money/tax.js +10 -3
- package/lib/utils/money/tax.js.map +1 -1
- package/lib/utils/money/tax.mjs +13 -6
- package/lib/utils/money/tax.mjs.map +1 -1
- package/lib/utils/money/tax.private.d.ts +2 -7
- package/lib/utils/money/tax.private.js +6 -21
- package/lib/utils/money/tax.private.js.map +1 -1
- package/lib/utils/money/tax.private.mjs +8 -22
- package/lib/utils/money/tax.private.mjs.map +1 -1
- package/package.json +1 -1
- package/lib/utils/map.d.ts +0 -51
- package/lib/utils/map.js +0 -97
- package/lib/utils/map.js.map +0 -1
- package/lib/utils/map.mjs +0 -95
- package/lib/utils/map.mjs.map +0 -1
- package/lib/utils/map.test.d.ts +0 -1
- package/lib/utils/money/allocators/totalAmount.d.ts +0 -14
- package/lib/utils/money/allocators/totalAmount.js +0 -35
- package/lib/utils/money/allocators/totalAmount.js.map +0 -1
- package/lib/utils/money/allocators/totalAmount.mjs +0 -33
- package/lib/utils/money/allocators/totalAmount.mjs.map +0 -1
- package/lib/utils/money/allocators/totalAmount.test.d.ts +0 -1
package/package.json
CHANGED
package/lib/utils/map.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type-safe key parser that ensures all properties of the key are used
|
|
3
|
-
*/
|
|
4
|
-
export type KeyParser<Key> = (key: Key) => string;
|
|
5
|
-
/**
|
|
6
|
-
* Type-safe KeyMap implementation with compile-time validation
|
|
7
|
-
*/
|
|
8
|
-
export declare class KeyMap<Key, Value> {
|
|
9
|
-
#private;
|
|
10
|
-
constructor(parser: KeyParser<Key>, entries?: readonly (readonly [Key, Value])[] | null | undefined, validator?: (key: Key) => void);
|
|
11
|
-
/**
|
|
12
|
-
* Get a value by key with runtime validation
|
|
13
|
-
*/
|
|
14
|
-
get(key: Key): Value | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* Set a value by key with runtime validation
|
|
17
|
-
*/
|
|
18
|
-
set(key: Key, value: Value): void;
|
|
19
|
-
/**
|
|
20
|
-
* Check if a key exists with runtime validation
|
|
21
|
-
*/
|
|
22
|
-
has(key: Key): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Get all values
|
|
25
|
-
*/
|
|
26
|
-
values(): IterableIterator<Value>;
|
|
27
|
-
/**
|
|
28
|
-
* Get all keys (returns stringified keys)
|
|
29
|
-
*/
|
|
30
|
-
keys(): IterableIterator<string>;
|
|
31
|
-
/**
|
|
32
|
-
* Get all entries (returns stringified keys)
|
|
33
|
-
*/
|
|
34
|
-
entries(): IterableIterator<[string, Value]>;
|
|
35
|
-
/**
|
|
36
|
-
* Get the size of the map
|
|
37
|
-
*/
|
|
38
|
-
get size(): number;
|
|
39
|
-
/**
|
|
40
|
-
* Clear all entries
|
|
41
|
-
*/
|
|
42
|
-
clear(): void;
|
|
43
|
-
/**
|
|
44
|
-
* Delete an entry by key
|
|
45
|
-
*/
|
|
46
|
-
delete(key: Key): boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Create a KeyMap for database composite keys with automatic validation
|
|
49
|
-
*/
|
|
50
|
-
static createForCompositeKey<Key extends Record<string, string | number>, Value>(keyFieldObject: Record<keyof Key, true>, entries?: readonly (readonly [Key, Value])[] | null | undefined): KeyMap<Key, Value>;
|
|
51
|
-
}
|
package/lib/utils/map.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var array = require('./array.js');
|
|
4
|
-
"use strict";
|
|
5
|
-
class KeyMap {
|
|
6
|
-
#map;
|
|
7
|
-
#keyParser;
|
|
8
|
-
#keyValidator;
|
|
9
|
-
constructor(parser, entries, validator) {
|
|
10
|
-
this.#keyParser = parser;
|
|
11
|
-
this.#keyValidator = validator || (() => {});
|
|
12
|
-
this.#map = Array.isArray(entries) ? new Map(entries.map(([key, value]) => {
|
|
13
|
-
this.#keyValidator(key);
|
|
14
|
-
return [this.#keyParser(key), value];
|
|
15
|
-
})) : /* @__PURE__ */new Map();
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Get a value by key with runtime validation
|
|
19
|
-
*/
|
|
20
|
-
get(key) {
|
|
21
|
-
this.#keyValidator(key);
|
|
22
|
-
return this.#map.get(this.#keyParser(key));
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Set a value by key with runtime validation
|
|
26
|
-
*/
|
|
27
|
-
set(key, value) {
|
|
28
|
-
this.#keyValidator(key);
|
|
29
|
-
this.#map.set(this.#keyParser(key), value);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Check if a key exists with runtime validation
|
|
33
|
-
*/
|
|
34
|
-
has(key) {
|
|
35
|
-
this.#keyValidator(key);
|
|
36
|
-
return this.#map.has(this.#keyParser(key));
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Get all values
|
|
40
|
-
*/
|
|
41
|
-
values() {
|
|
42
|
-
return this.#map.values();
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Get all keys (returns stringified keys)
|
|
46
|
-
*/
|
|
47
|
-
keys() {
|
|
48
|
-
return this.#map.keys();
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Get all entries (returns stringified keys)
|
|
52
|
-
*/
|
|
53
|
-
entries() {
|
|
54
|
-
return this.#map.entries();
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Get the size of the map
|
|
58
|
-
*/
|
|
59
|
-
get size() {
|
|
60
|
-
return this.#map.size;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Clear all entries
|
|
64
|
-
*/
|
|
65
|
-
clear() {
|
|
66
|
-
this.#map.clear();
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Delete an entry by key
|
|
70
|
-
*/
|
|
71
|
-
delete(key) {
|
|
72
|
-
this.#keyValidator(key);
|
|
73
|
-
return this.#map.delete(this.#keyParser(key));
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Create a KeyMap for database composite keys with automatic validation
|
|
77
|
-
*/
|
|
78
|
-
static createForCompositeKey(keyFieldObject, entries) {
|
|
79
|
-
const keyFields = array.createArrayFromInterfaceKeys(keyFieldObject);
|
|
80
|
-
const parser = key => {
|
|
81
|
-
return keyFields.map(field => String(key[field])).join("_");
|
|
82
|
-
};
|
|
83
|
-
const validator = key => {
|
|
84
|
-
for (const field of keyFields) {
|
|
85
|
-
if (!(field in key)) {
|
|
86
|
-
throw new Error(`Missing required key field: ${String(field)}`);
|
|
87
|
-
}
|
|
88
|
-
if (key[field] == null) {
|
|
89
|
-
throw new Error(`Key field ${String(field)} cannot be null or undefined`);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
return new KeyMap(parser, entries, validator);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
exports.KeyMap = KeyMap;
|
|
97
|
-
//# sourceMappingURL=map.js.map
|
package/lib/utils/map.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","sources":["../../src/utils/map.ts"],"sourcesContent":["import { createArrayFromInterfaceKeys } from \"./array\";\n\n/**\n * Type-safe key parser that ensures all properties of the key are used\n */\nexport type KeyParser<Key> = (key: Key) => string;\n\n/**\n * Type-safe KeyMap implementation with compile-time validation\n */\nexport class KeyMap<Key, Value> {\n #map: Map<string, Value>;\n #keyParser: KeyParser<Key>;\n #keyValidator: (key: Key) => void;\n\n constructor(\n parser: KeyParser<Key>,\n entries?: readonly (readonly [Key, Value])[] | null | undefined,\n validator?: (key: Key) => void,\n ) {\n this.#keyParser = parser;\n this.#keyValidator = validator || (() => {});\n this.#map = Array.isArray(entries)\n ? new Map(\n entries.map(([key, value]) => {\n this.#keyValidator(key);\n return [this.#keyParser(key), value];\n }),\n )\n : new Map();\n }\n\n /**\n * Get a value by key with runtime validation\n */\n get(key: Key): Value | undefined {\n this.#keyValidator(key);\n return this.#map.get(this.#keyParser(key));\n }\n\n /**\n * Set a value by key with runtime validation\n */\n set(key: Key, value: Value): void {\n this.#keyValidator(key);\n this.#map.set(this.#keyParser(key), value);\n }\n\n /**\n * Check if a key exists with runtime validation\n */\n has(key: Key): boolean {\n this.#keyValidator(key);\n return this.#map.has(this.#keyParser(key));\n }\n\n /**\n * Get all values\n */\n values(): IterableIterator<Value> {\n return this.#map.values();\n }\n\n /**\n * Get all keys (returns stringified keys)\n */\n keys(): IterableIterator<string> {\n return this.#map.keys();\n }\n\n /**\n * Get all entries (returns stringified keys)\n */\n entries(): IterableIterator<[string, Value]> {\n return this.#map.entries();\n }\n\n /**\n * Get the size of the map\n */\n get size(): number {\n return this.#map.size;\n }\n\n /**\n * Clear all entries\n */\n clear(): void {\n this.#map.clear();\n }\n\n /**\n * Delete an entry by key\n */\n delete(key: Key): boolean {\n this.#keyValidator(key);\n return this.#map.delete(this.#keyParser(key));\n }\n\n /**\n * Create a KeyMap for database composite keys with automatic validation\n */\n static createForCompositeKey<\n Key extends Record<string, string | number>,\n Value,\n >(\n keyFieldObject: Record<keyof Key, true>,\n entries?: readonly (readonly [Key, Value])[] | null | undefined,\n ): KeyMap<Key, Value> {\n const keyFields = createArrayFromInterfaceKeys(keyFieldObject);\n\n const parser: KeyParser<Key> = (key) => {\n return keyFields.map((field) => String(key[field])).join(\"_\");\n };\n\n const validator = (key: Key) => {\n for (const field of keyFields) {\n if (!(field in key)) {\n throw new Error(`Missing required key field: ${String(field)}`);\n }\n if (key[field] == null) {\n throw new Error(\n `Key field ${String(field)} cannot be null or undefined`,\n );\n }\n }\n };\n\n return new KeyMap(parser, entries, validator);\n }\n}\n"],"names":["KeyMap","map","keyParser","keyValidator","constructor","parser","entries","validator","Array","isArray","Map","key","value","get","set","has","values","keys","size","clear","delete","createForCompositeKey","keyFieldObject","keyFields","createArrayFromInterfaceKeys","field","String","join","Error"],"mappings":";;;;AAUO,MAAMA,MAAA,CAAmB;EAC9B,CAAAC,GAAA;EACA,CAAAC,SAAA;EACA,CAAAC,YAAA;EAEAC,WAAAA,CACEC,MAAA,EACAC,OAAA,EACAC,SAAA,EACA;IACA,IAAA,CAAK,CAAAL,SAAA,GAAaG,MAAA;IAClB,IAAA,CAAK,CAAAF,YAAA,GAAgBI,cAAc,MAAM,CAAC,CAAA,CAAA;IAC1C,IAAA,CAAK,CAAAN,GAAA,GAAOO,KAAA,CAAMC,OAAA,CAAQH,OAAO,IAC7B,IAAII,GAAA,CACFJ,QAAQL,GAAA,CAAI,CAAC,CAACU,GAAA,EAAKC,KAAK,CAA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4
|
-
#map;
|
|
5
|
-
#keyParser;
|
|
6
|
-
#keyValidator;
|
|
7
|
-
constructor(parser, entries, validator) {
|
|
8
|
-
this.#keyParser = parser;
|
|
9
|
-
this.#keyValidator = validator || (() => {});
|
|
10
|
-
this.#map = Array.isArray(entries) ? new Map(entries.map(([key, value]) => {
|
|
11
|
-
this.#keyValidator(key);
|
|
12
|
-
return [this.#keyParser(key), value];
|
|
13
|
-
})) : /* @__PURE__ */new Map();
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Get a value by key with runtime validation
|
|
17
|
-
*/
|
|
18
|
-
get(key) {
|
|
19
|
-
this.#keyValidator(key);
|
|
20
|
-
return this.#map.get(this.#keyParser(key));
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Set a value by key with runtime validation
|
|
24
|
-
*/
|
|
25
|
-
set(key, value) {
|
|
26
|
-
this.#keyValidator(key);
|
|
27
|
-
this.#map.set(this.#keyParser(key), value);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Check if a key exists with runtime validation
|
|
31
|
-
*/
|
|
32
|
-
has(key) {
|
|
33
|
-
this.#keyValidator(key);
|
|
34
|
-
return this.#map.has(this.#keyParser(key));
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Get all values
|
|
38
|
-
*/
|
|
39
|
-
values() {
|
|
40
|
-
return this.#map.values();
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Get all keys (returns stringified keys)
|
|
44
|
-
*/
|
|
45
|
-
keys() {
|
|
46
|
-
return this.#map.keys();
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Get all entries (returns stringified keys)
|
|
50
|
-
*/
|
|
51
|
-
entries() {
|
|
52
|
-
return this.#map.entries();
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Get the size of the map
|
|
56
|
-
*/
|
|
57
|
-
get size() {
|
|
58
|
-
return this.#map.size;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Clear all entries
|
|
62
|
-
*/
|
|
63
|
-
clear() {
|
|
64
|
-
this.#map.clear();
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Delete an entry by key
|
|
68
|
-
*/
|
|
69
|
-
delete(key) {
|
|
70
|
-
this.#keyValidator(key);
|
|
71
|
-
return this.#map.delete(this.#keyParser(key));
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Create a KeyMap for database composite keys with automatic validation
|
|
75
|
-
*/
|
|
76
|
-
static createForCompositeKey(keyFieldObject, entries) {
|
|
77
|
-
const keyFields = createArrayFromInterfaceKeys(keyFieldObject);
|
|
78
|
-
const parser = key => {
|
|
79
|
-
return keyFields.map(field => String(key[field])).join("_");
|
|
80
|
-
};
|
|
81
|
-
const validator = key => {
|
|
82
|
-
for (const field of keyFields) {
|
|
83
|
-
if (!(field in key)) {
|
|
84
|
-
throw new Error(`Missing required key field: ${String(field)}`);
|
|
85
|
-
}
|
|
86
|
-
if (key[field] == null) {
|
|
87
|
-
throw new Error(`Key field ${String(field)} cannot be null or undefined`);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
return new KeyMap(parser, entries, validator);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
export { KeyMap };
|
|
95
|
-
//# sourceMappingURL=map.mjs.map
|
package/lib/utils/map.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map.mjs","sources":["../../src/utils/map.ts"],"sourcesContent":["import { createArrayFromInterfaceKeys } from \"./array\";\n\n/**\n * Type-safe key parser that ensures all properties of the key are used\n */\nexport type KeyParser<Key> = (key: Key) => string;\n\n/**\n * Type-safe KeyMap implementation with compile-time validation\n */\nexport class KeyMap<Key, Value> {\n #map: Map<string, Value>;\n #keyParser: KeyParser<Key>;\n #keyValidator: (key: Key) => void;\n\n constructor(\n parser: KeyParser<Key>,\n entries?: readonly (readonly [Key, Value])[] | null | undefined,\n validator?: (key: Key) => void,\n ) {\n this.#keyParser = parser;\n this.#keyValidator = validator || (() => {});\n this.#map = Array.isArray(entries)\n ? new Map(\n entries.map(([key, value]) => {\n this.#keyValidator(key);\n return [this.#keyParser(key), value];\n }),\n )\n : new Map();\n }\n\n /**\n * Get a value by key with runtime validation\n */\n get(key: Key): Value | undefined {\n this.#keyValidator(key);\n return this.#map.get(this.#keyParser(key));\n }\n\n /**\n * Set a value by key with runtime validation\n */\n set(key: Key, value: Value): void {\n this.#keyValidator(key);\n this.#map.set(this.#keyParser(key), value);\n }\n\n /**\n * Check if a key exists with runtime validation\n */\n has(key: Key): boolean {\n this.#keyValidator(key);\n return this.#map.has(this.#keyParser(key));\n }\n\n /**\n * Get all values\n */\n values(): IterableIterator<Value> {\n return this.#map.values();\n }\n\n /**\n * Get all keys (returns stringified keys)\n */\n keys(): IterableIterator<string> {\n return this.#map.keys();\n }\n\n /**\n * Get all entries (returns stringified keys)\n */\n entries(): IterableIterator<[string, Value]> {\n return this.#map.entries();\n }\n\n /**\n * Get the size of the map\n */\n get size(): number {\n return this.#map.size;\n }\n\n /**\n * Clear all entries\n */\n clear(): void {\n this.#map.clear();\n }\n\n /**\n * Delete an entry by key\n */\n delete(key: Key): boolean {\n this.#keyValidator(key);\n return this.#map.delete(this.#keyParser(key));\n }\n\n /**\n * Create a KeyMap for database composite keys with automatic validation\n */\n static createForCompositeKey<\n Key extends Record<string, string | number>,\n Value,\n >(\n keyFieldObject: Record<keyof Key, true>,\n entries?: readonly (readonly [Key, Value])[] | null | undefined,\n ): KeyMap<Key, Value> {\n const keyFields = createArrayFromInterfaceKeys(keyFieldObject);\n\n const parser: KeyParser<Key> = (key) => {\n return keyFields.map((field) => String(key[field])).join(\"_\");\n };\n\n const validator = (key: Key) => {\n for (const field of keyFields) {\n if (!(field in key)) {\n throw new Error(`Missing required key field: ${String(field)}`);\n }\n if (key[field] == null) {\n throw new Error(\n `Key field ${String(field)} cannot be null or undefined`,\n );\n }\n }\n };\n\n return new KeyMap(parser, entries, validator);\n }\n}\n"],"names":["KeyMap","map","keyParser","keyValidator","constructor","parser","entries","validator","Array","isArray","Map","key","value","get","set","has","values","keys","size","clear","delete","createForCompositeKey","keyFieldObject","keyFields","createArrayFromInterfaceKeys","field","String","join","Error"],"mappings":";;AAUO,MAAMA,MAAA,CAAmB;EAC9B,CAAAC,GAAA;EACA,CAAAC,SAAA;EACA,CAAAC,YAAA;EAEAC,WAAAA,CACEC,MAAA,EACAC,OAAA,EACAC,SAAA,EACA;IACA,IAAA,CAAK,CAAAL,SAAA,GAAaG,MAAA;IAClB,IAAA,CAAK,CAAAF,YAAA,GAAgBI,cAAc,MAAM,CAAC,CAAA,CAAA;IAC1C,IAAA,CAAK,CAAAN,GAAA,GAAOO,KAAA,CAAMC,OAAA,CAAQH,OAAO,IAC7B,IAAII,GAAA,CACFJ,QAAQL,GAAA,CAAI,CAAC,CAACU,GAAA,EAAKC,KAAK,CAAA,KAAM;MAC5B,IAAA,CAAK,CAAAT,aAAcQ,GAAG,CAAA;MACtB,OAAO,CAAC,IAAA,CAAK,CAAAT,SAAA,CAAWS,GAAG,GAAGC,KAAK,CAAA;IACrC,CAAC,CAAA,CACH,GAAA,mBACIF,GAAA,CAAA,CAAI;EACd;EAAA;AAAA;AAAA;EAKAG,IAAIF,GAAA,EAA6B;IAC/B,IAAA,CAAK,CAAAR,aAAcQ,GAAG,CAAA;IACtB,OAAO,KAAK,CAAAV,GAAA,CAAKY,GAAA,CAAI,IAAA,CAAK,CAAAX,SAAA,CAAWS,GAAG,CAAC,CAAA;EAC3C;EAAA;AAAA;AAAA;EAKAG,GAAAA,CAAIH,KAAUC,KAAA,EAAoB;IAChC,IAAA,CAAK,CAAAT,aAAcQ,GAAG,CAAA;IACtB,IAAA,CAAK,CAAAV,IAAKa,GAAA,CAAI,IAAA,CAAK,CAAAZ,SAAA,CAAWS,GAAG,GAAGC,KAAK,CAAA;EAC3C;EAAA;AAAA;AAAA;EAKAG,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IAEA,MAAMpB,SAAA,GAAaI,GAAA,IAAa;MAC9B,KAAA,MAAWc,SAASF,SAAA,EAAW;QAC7B,IAAI,EAAEE,SAASd,GAAA,CAAA,EAAM;UACnB,MAAM,IAAIiB,KAAA,CAAM,+BAA+BF,MAAA,CAAOD,KAAK,CAAC,EAAE,CAAA;QAChE;QACA,IAAId,GAAA,CAAIc,KAAK,CAAA,IAAK,IAAA,EAAM;UACtB,MAAM,IAAIG,KAAA,CACR,aAAaF,MAAA,CAAOD,KAAK,CAAC,8BAAA,CAC5B;QACF;MACF;IACF,CAAA;IAEA,OAAO,IAAIzB,MAAA,CAAOK,MAAA,EAAQC,OAAA,EAASC,SAAS,CAAA;EAC9C;AACF;"}
|
package/lib/utils/map.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Currency } from "../../../types";
|
|
2
|
-
import type { Cents, Dino } from "../types";
|
|
3
|
-
/**
|
|
4
|
-
* Helper class to distribute a total amount across a quantity of items.
|
|
5
|
-
*/
|
|
6
|
-
export declare class TotalAmountAllocator {
|
|
7
|
-
#private;
|
|
8
|
-
constructor({ amount, quantity, currency, }: {
|
|
9
|
-
quantity: number;
|
|
10
|
-
amount: Cents;
|
|
11
|
-
currency: Currency;
|
|
12
|
-
});
|
|
13
|
-
allocate(quantity: number): Dino;
|
|
14
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var dinero_js = require('dinero.js');
|
|
4
|
-
var errors = require('../../errors.js');
|
|
5
|
-
var misc = require('../misc.js');
|
|
6
|
-
"use strict";
|
|
7
|
-
class TotalAmountAllocator {
|
|
8
|
-
#remainingAmount;
|
|
9
|
-
#remainingQuantity;
|
|
10
|
-
#currency;
|
|
11
|
-
constructor({
|
|
12
|
-
amount,
|
|
13
|
-
quantity,
|
|
14
|
-
currency
|
|
15
|
-
}) {
|
|
16
|
-
this.#remainingAmount = misc.getDinero(amount, currency);
|
|
17
|
-
this.#remainingQuantity = quantity;
|
|
18
|
-
this.#currency = currency;
|
|
19
|
-
}
|
|
20
|
-
allocate(quantity) {
|
|
21
|
-
errors.assert(quantity <= this.#remainingQuantity, "Trying to allocate more quantity than available");
|
|
22
|
-
const quantityToAllocate = Math.min(quantity, this.#remainingQuantity);
|
|
23
|
-
if (quantityToAllocate === 0) {
|
|
24
|
-
return misc.getDinero(0, this.#currency);
|
|
25
|
-
}
|
|
26
|
-
const [allocated, newRemainingAmount] = dinero_js.allocate(this.#remainingAmount, [quantityToAllocate, this.#remainingQuantity - quantityToAllocate]);
|
|
27
|
-
errors.assert(!!allocated, "Couldn't allocate amount");
|
|
28
|
-
errors.assert(!!newRemainingAmount, "Couldn't retrieve remaining amount");
|
|
29
|
-
this.#remainingAmount = newRemainingAmount;
|
|
30
|
-
this.#remainingQuantity -= quantityToAllocate;
|
|
31
|
-
return allocated;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.TotalAmountAllocator = TotalAmountAllocator;
|
|
35
|
-
//# sourceMappingURL=totalAmount.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"totalAmount.js","sources":["../../../../src/utils/money/allocators/totalAmount.ts"],"sourcesContent":["import { allocate } from \"dinero.js\";\n\nimport type { Currency } from \"../../../types\";\nimport { assert } from \"../../errors\";\nimport { getDinero } from \"../misc\";\nimport type { Cents, Dino } from \"../types\";\n\n/**\n * Helper class to distribute a total amount across a quantity of items.\n */\nexport class TotalAmountAllocator {\n #remainingAmount: Dino;\n #remainingQuantity: number;\n #currency: Currency;\n\n constructor({\n amount,\n quantity,\n currency,\n }: {\n quantity: number;\n amount: Cents;\n currency: Currency;\n }) {\n this.#remainingAmount = getDinero(amount, currency);\n this.#remainingQuantity = quantity;\n this.#currency = currency;\n }\n\n allocate(quantity: number): Dino {\n assert(\n quantity <= this.#remainingQuantity,\n \"Trying to allocate more quantity than available\",\n );\n\n // Normalize quantity to not exceed remaining\n const quantityToAllocate = Math.min(quantity, this.#remainingQuantity);\n\n if (quantityToAllocate === 0) {\n return getDinero(0, this.#currency);\n }\n\n const [allocated, newRemainingAmount] = allocate(this.#remainingAmount, [\n quantityToAllocate,\n this.#remainingQuantity - quantityToAllocate,\n ]);\n\n assert(!!allocated, \"Couldn't allocate amount\");\n assert(!!newRemainingAmount, \"Couldn't retrieve remaining amount\");\n\n // Update remaining amounts\n this.#remainingAmount = newRemainingAmount;\n this.#remainingQuantity -= quantityToAllocate;\n\n return allocated;\n }\n}\n"],"names":["TotalAmountAllocator","remainingAmount","remainingQuantity","currency","constructor","amount","quantity","getDinero","allocate","assert","quantityToAllocate","Math","min","allocated","newRemainingAmount"],"mappings":";;;;;;AAUO,MAAMA,oBAAA,CAAqB;EAChC,CAAAC,eAAA;EACA,CAAAC,iBAAA;EACA,CAAAC,QAAA;EAEAC,WAAAA,CAAY;IACVC,MAAA;IACAC,QAAA;IACAH;EAAA,CACF,EAIG;IACD,IAAA,CAAK,CAAAF,eAAA,GAAmBM,cAAA,CAAUF,MAAA,EAAQF,QAAQ,CAAA;IAClD,IAAA,CAAK,CAAAD,iBAAA,GAAqBI,QAAA;IAC1B,IAAA,CAAK,CAAAH,QAAA,GAAYA,QAAA;EACnB;EAEAK,SAASF,QAAA,EAAwB;IAC/BG,MAAAA,CAAAA,MAAA,CACEH,YAAY,IAAA,CAAK,CAAAJ,iBAAA,EACjB,iDAAA,CACF;IAGA,MAAMQ,kBAAA,GAAqBC,IAAA,CAAKC,GAAA,CAAIN,QAAA,EAAU,KAAK,CAAAJ,iBAAkB,CAAA;IAErE,IAAIQ,uBAAuB,CAAA,EAAG;MAC5B,OAAOH,cAAA,CAAU,CAAA,EAAG,IAAA,CAAK,SAAS,CAAA;IACpC;IAEA,MAAM,CAACM,SAAA,EAAWC,kBAAkB,CAAA,GAAIN,SAAAA,CAAAA,QAAA,CAAS,KAAK,CAAAP,eAAA,EAAkB,CACtES,kBAAA,EACA,KAAK,CAAAR,iBAAA,GAAqBQ,kBAAA,CAC3B,CAAA;IAEDD,aAAA,CAAO,CAAC,CAACI,SAAA,EAAW,0BAA0B,CAAA;IAC9CJ,aAAA,CAAO,CAAC,CAACK,kBAAA,EAAoB,oCAAoC,CAAA;IAGjE,IAAA,CAAK,CAAAb,eAAA,GAAmBa,kBAAA;IACxB,IAAA,CAAK,CAAAZ,iBAAA,IAAsBQ,kBAAA;IAE3B,OAAOG,SAAA;EACT;AACF;"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { allocate } from 'dinero.js';
|
|
2
|
-
import { assert } from '../../errors.mjs';
|
|
3
|
-
import { getDinero } from '../misc.mjs';
|
|
4
|
-
"use strict";
|
|
5
|
-
class TotalAmountAllocator {
|
|
6
|
-
#remainingAmount;
|
|
7
|
-
#remainingQuantity;
|
|
8
|
-
#currency;
|
|
9
|
-
constructor({
|
|
10
|
-
amount,
|
|
11
|
-
quantity,
|
|
12
|
-
currency
|
|
13
|
-
}) {
|
|
14
|
-
this.#remainingAmount = getDinero(amount, currency);
|
|
15
|
-
this.#remainingQuantity = quantity;
|
|
16
|
-
this.#currency = currency;
|
|
17
|
-
}
|
|
18
|
-
allocate(quantity) {
|
|
19
|
-
assert(quantity <= this.#remainingQuantity, "Trying to allocate more quantity than available");
|
|
20
|
-
const quantityToAllocate = Math.min(quantity, this.#remainingQuantity);
|
|
21
|
-
if (quantityToAllocate === 0) {
|
|
22
|
-
return getDinero(0, this.#currency);
|
|
23
|
-
}
|
|
24
|
-
const [allocated, newRemainingAmount] = allocate(this.#remainingAmount, [quantityToAllocate, this.#remainingQuantity - quantityToAllocate]);
|
|
25
|
-
assert(!!allocated, "Couldn't allocate amount");
|
|
26
|
-
assert(!!newRemainingAmount, "Couldn't retrieve remaining amount");
|
|
27
|
-
this.#remainingAmount = newRemainingAmount;
|
|
28
|
-
this.#remainingQuantity -= quantityToAllocate;
|
|
29
|
-
return allocated;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export { TotalAmountAllocator };
|
|
33
|
-
//# sourceMappingURL=totalAmount.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"totalAmount.mjs","sources":["../../../../src/utils/money/allocators/totalAmount.ts"],"sourcesContent":["import { allocate } from \"dinero.js\";\n\nimport type { Currency } from \"../../../types\";\nimport { assert } from \"../../errors\";\nimport { getDinero } from \"../misc\";\nimport type { Cents, Dino } from \"../types\";\n\n/**\n * Helper class to distribute a total amount across a quantity of items.\n */\nexport class TotalAmountAllocator {\n #remainingAmount: Dino;\n #remainingQuantity: number;\n #currency: Currency;\n\n constructor({\n amount,\n quantity,\n currency,\n }: {\n quantity: number;\n amount: Cents;\n currency: Currency;\n }) {\n this.#remainingAmount = getDinero(amount, currency);\n this.#remainingQuantity = quantity;\n this.#currency = currency;\n }\n\n allocate(quantity: number): Dino {\n assert(\n quantity <= this.#remainingQuantity,\n \"Trying to allocate more quantity than available\",\n );\n\n // Normalize quantity to not exceed remaining\n const quantityToAllocate = Math.min(quantity, this.#remainingQuantity);\n\n if (quantityToAllocate === 0) {\n return getDinero(0, this.#currency);\n }\n\n const [allocated, newRemainingAmount] = allocate(this.#remainingAmount, [\n quantityToAllocate,\n this.#remainingQuantity - quantityToAllocate,\n ]);\n\n assert(!!allocated, \"Couldn't allocate amount\");\n assert(!!newRemainingAmount, \"Couldn't retrieve remaining amount\");\n\n // Update remaining amounts\n this.#remainingAmount = newRemainingAmount;\n this.#remainingQuantity -= quantityToAllocate;\n\n return allocated;\n }\n}\n"],"names":["TotalAmountAllocator","remainingAmount","remainingQuantity","currency","constructor","amount","quantity","getDinero","allocate","assert","quantityToAllocate","Math","min","allocated","newRemainingAmount"],"mappings":";;;;AAUO,MAAMA,oBAAA,CAAqB;EAChC,CAAAC,eAAA;EACA,CAAAC,iBAAA;EACA,CAAAC,QAAA;EAEAC,WAAAA,CAAY;IACVC,MAAA;IACAC,QAAA;IACAH;EAAA,CACF,EAIG;IACD,IAAA,CAAK,CAAAF,eAAA,GAAmBM,SAAA,CAAUF,MAAA,EAAQF,QAAQ,CAAA;IAClD,IAAA,CAAK,CAAAD,iBAAA,GAAqBI,QAAA;IAC1B,IAAA,CAAK,CAAAH,QAAA,GAAYA,QAAA;EACnB;EAEAK,SAASF,QAAA,EAAwB;IAC/BG,MAAA,CACEH,YAAY,IAAA,CAAK,CAAAJ,iBAAA,EACjB,iDAAA,CACF;IAGA,MAAMQ,kBAAA,GAAqBC,IAAA,CAAKC,GAAA,CAAIN,QAAA,EAAU,KAAK,CAAAJ,iBAAkB,CAAA;IAErE,IAAIQ,uBAAuB,CAAA,EAAG;MAC5B,OAAOH,SAAA,CAAU,CAAA,EAAG,IAAA,CAAK,SAAS,CAAA;IACpC;IAEA,MAAM,CAACM,SAAA,EAAWC,kBAAkB,CAAA,GAAIN,QAAA,CAAS,KAAK,CAAAP,eAAA,EAAkB,CACtES,kBAAA,EACA,KAAK,CAAAR,iBAAA,GAAqBQ,kBAAA,CAC3B,CAAA;IAEDD,MAAA,CAAO,CAAC,CAACI,SAAA,EAAW,0BAA0B,CAAA;IAC9CJ,MAAA,CAAO,CAAC,CAACK,kBAAA,EAAoB,oCAAoC,CAAA;IAGjE,IAAA,CAAK,CAAAb,eAAA,GAAmBa,kBAAA;IACxB,IAAA,CAAK,CAAAZ,iBAAA,IAAsBQ,kBAAA;IAE3B,OAAOG,SAAA;EACT;AACF;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|