@ubnt/store.core 11.27.0-beta.6 → 11.27.0-beta.8
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 +8 -0
- package/lib/_virtual/_virtual_multi-entry.js +6 -0
- package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
- package/lib/_virtual/_virtual_multi-entry.mjs +6 -0
- package/lib/_virtual/_virtual_multi-entry.mjs.map +1 -1
- package/lib/assets/ai-dslr.jpg +0 -0
- package/lib/assets/ai-dslr2.jpg +0 -0
- package/lib/assets/ai-lpr.jpg +0 -0
- package/lib/assets/ai-lpr2.jpg +0 -0
- package/lib/assets/ai-turret.jpg +0 -0
- package/lib/assets/ai-turret2.jpg +0 -0
- package/lib/assets/bullet2.svg +1 -1
- package/lib/assets/bullet3.svg +1 -1
- package/lib/assets/compact.svg +1 -1
- package/lib/assets/compact2.svg +1 -1
- package/lib/assets/door-hub-mini.jpg +0 -0
- package/lib/assets/door-hub-mini2.jpg +0 -0
- package/lib/assets/door-hub.jpg +0 -0
- package/lib/assets/door-hub2.jpg +0 -0
- package/lib/assets/g2-reader-pro.jpg +0 -0
- package/lib/assets/g2-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/g5-bullet.jpg +0 -0
- package/lib/assets/g5-bullet2.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/interior-design.svg +1 -1
- package/lib/assets/interior-design2.svg +1 -1
- package/lib/assets/plus.svg +1 -1
- package/lib/assets/plus2.svg +1 -1
- package/lib/assets/power-solutions.svg +10 -0
- package/lib/assets/ptz2.svg +1 -1
- package/lib/assets/ptz3.svg +1 -1
- package/lib/assets/udmProMax.jpg +0 -0
- package/lib/assets/udmProMax2.jpg +0 -0
- package/lib/assets/udmProSpecial.jpg +0 -0
- package/lib/assets/udmProSpecial2.jpg +0 -0
- package/lib/assets/udr.jpg +0 -0
- package/lib/assets/udr2.jpg +0 -0
- package/lib/assets/udr3.jpg +0 -0
- package/lib/assets/udr7.jpg +0 -0
- package/lib/assets/udr72.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/assets/ups.svg +3 -0
- package/lib/assets/video-recorders.png +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/CartModalV2/Item/Item.js +3 -3
- package/lib/components/Header/CartModalV2/Item/Item.mjs +2 -2
- package/lib/components/MicrositeHeader/components/VisualTopology/VisualTopology.js +3 -3
- package/lib/components/MicrositeHeader/components/VisualTopology/VisualTopology.mjs +2 -2
- package/lib/components/ModelCompareV4/ProductList/components/Product/Product.js +1 -1
- package/lib/components/ModelCompareV4/ProductList/components/Product/Product.mjs +1 -1
- package/lib/constants/icons/generic/index.js +3 -3
- package/lib/constants/icons/generic/index.mjs +1 -1
- package/lib/constants/icons/generic/plus.svg.js +5 -5
- package/lib/constants/icons/generic/plus.svg.mjs +2 -2
- package/lib/constants/icons/menu/index.d.ts +3 -1
- package/lib/constants/icons/menu/index.js +19 -1
- package/lib/constants/icons/menu/index.js.map +1 -1
- package/lib/constants/icons/menu/index.mjs +5 -1
- package/lib/constants/icons/menu/index.mjs.map +1 -1
- package/lib/constants/icons/menu/power-solutions.svg.js +27 -0
- package/lib/constants/icons/menu/power-solutions.svg.js.map +1 -0
- package/lib/constants/icons/menu/power-solutions.svg.mjs +3 -0
- package/lib/constants/icons/menu/power-solutions.svg.mjs.map +1 -0
- package/lib/constants/icons/menu/ups.svg.js +27 -0
- package/lib/constants/icons/menu/ups.svg.js.map +1 -0
- package/lib/constants/icons/menu/ups.svg.mjs +3 -0
- package/lib/constants/icons/menu/ups.svg.mjs.map +1 -0
- package/lib/constants/modelCompareData/assets/Bullet/ai-dslr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/ai-dslr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Bullet/ai-lpr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/ai-lpr.jpg.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/Bullet/g5-bullet.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/g5-bullet.jpg.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/udmProMax.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udmProMax.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udmProSpecial.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udmProSpecial.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/udr7.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udr7.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/udmProMax.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/udmProMax.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/udmProSpecial.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/udmProSpecial.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/Consoles/udr7.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/udr7.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-turret.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-turret.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-mini.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub-mini.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-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g2-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/MobileRouters/umr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/MobileRouters/umr.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/compact.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/compact.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/plus.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/plus.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/bullet/ai-dslr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-dslr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-lpr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-lpr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/g5-bullet.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/g5-bullet.jpg.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-turret.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-turret.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-mini.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub-mini.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-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g2-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/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/compact.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/compact.svg.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/data/CloudGateways.js +10 -10
- package/lib/constants/modelCompareData/data/CloudGateways.mjs +7 -7
- package/lib/constants/modelCompareData/data/DreamMachineConsolev4.js +10 -10
- package/lib/constants/modelCompareData/data/DreamMachineConsolev4.mjs +7 -7
- 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/Compact.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Compact.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/compact.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/compact.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/aiDslr.js +2 -2
- package/lib/constants/modelCompareData/data/products/aiDslr.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/aiLpr.js +2 -2
- package/lib/constants/modelCompareData/data/products/aiLpr.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/aiTurret.js +2 -2
- package/lib/constants/modelCompareData/data/products/aiTurret.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/doorHubMini.js +2 -2
- package/lib/constants/modelCompareData/data/products/doorHubMini.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g2ReaderPro.js +2 -2
- package/lib/constants/modelCompareData/data/products/g2ReaderPro.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/g5Bullet.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5Bullet.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/udmProMax.js +1 -1
- package/lib/constants/modelCompareData/data/products/udmProMax.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/udmProSpecial.js +1 -1
- package/lib/constants/modelCompareData/data/products/udmProSpecial.mjs +1 -1
- 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/udr7.js +1 -1
- package/lib/constants/modelCompareData/data/products/udr7.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/contexts/MicrositeMenuContext/mapping.js +25 -3
- package/lib/contexts/MicrositeMenuContext/mapping.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/mapping.mjs +23 -3
- package/lib/contexts/MicrositeMenuContext/mapping.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/ar.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/ar.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/ar.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/ar.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/ca.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/ca.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/ca.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/ca.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/cs.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/cs.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/cs.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/cs.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/da.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/da.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/da.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/da.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/de.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/de.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/de.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/de.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/el.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/el.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/el.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/el.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/en.json.js +3 -1
- package/lib/contexts/MicrositeMenuContext/translations/en.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/en.json.mjs +3 -1
- package/lib/contexts/MicrositeMenuContext/translations/en.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/es-ES.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/es-ES.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/es-ES.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/es-ES.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/es-MX.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/es-MX.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/es-MX.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/es-MX.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/fr.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/fr.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/fr.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/fr.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/it.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/it.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/it.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/it.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/ja.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/ja.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/ja.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/ja.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/ko.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/ko.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/ko.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/ko.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/nl.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/nl.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/nl.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/nl.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/no.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/no.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/no.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/no.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/pl.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/pl.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/pl.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/pl.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/pt-BR.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/pt-BR.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/pt-BR.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/pt-BR.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/pt-PT.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/pt-PT.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/pt-PT.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/pt-PT.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/ru.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/ru.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/ru.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/ru.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/sv.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/sv.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/sv.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/sv.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/tr.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/tr.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/tr.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/tr.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/zh-Hans.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/zh-Hans.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/zh-Hans.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/zh-Hant-TW.json.js +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations/zh-Hant-TW.json.mjs +5 -1
- package/lib/contexts/MicrositeMenuContext/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/contexts/MicrositeMenuContext/translations.d.ts +2 -2
- package/lib/utils/KeyMap.d.ts +51 -0
- package/lib/utils/KeyMap.js +97 -0
- package/lib/utils/KeyMap.js.map +1 -0
- package/lib/utils/KeyMap.mjs +95 -0
- package/lib/utils/KeyMap.mjs.map +1 -0
- package/lib/utils/KeyMap.test.d.ts +1 -0
- package/lib/utils/array.d.ts +6 -0
- package/lib/utils/array.js +9 -0
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/array.mjs +9 -1
- package/lib/utils/array.mjs.map +1 -1
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/index.js +6 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/index.mjs +6 -0
- package/lib/utils/index.mjs.map +1 -1
- package/lib/utils/makeMap.d.ts +44 -0
- package/lib/utils/makeMap.js +28 -0
- package/lib/utils/makeMap.js.map +1 -0
- package/lib/utils/makeMap.mjs +25 -0
- package/lib/utils/makeMap.mjs.map +1 -0
- package/lib/utils/makeMap.test.d.ts +1 -0
- package/lib/utils/makeSet.d.ts +14 -0
- package/lib/utils/makeSet.js +8 -0
- package/lib/utils/makeSet.js.map +1 -0
- package/lib/utils/makeSet.mjs +7 -0
- package/lib/utils/makeSet.mjs.map +1 -0
- package/lib/utils/makeSet.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -83,6 +83,9 @@ var zhHantTW = {
|
|
|
83
83
|
"menu.label.newIntegrations.mobileRouting.description": "一個多合一的連接中心。",
|
|
84
84
|
"menu.label.newIntegrations.overview": "新整合概覽",
|
|
85
85
|
"menu.label.newIntegrations.overview.description": "新整合概覽",
|
|
86
|
+
"menu.label.newIntegrations.powerSolutions": "電源解決方案",
|
|
87
|
+
"menu.label.newIntegrations.powerTech": "動力科技",
|
|
88
|
+
"menu.label.newIntegrations.powerTech.description": "不間斷<br/>電源",
|
|
86
89
|
"menu.label.newIntegrations.premiumAudio": "高級音響",
|
|
87
90
|
"menu.label.newIntegrations.premiumAudio.description": "強大的擴大機,適合有品味的音響愛好者。",
|
|
88
91
|
"menu.label.newIntegrations.premiumIoT": "高級物聯網",
|
|
@@ -90,6 +93,7 @@ var zhHantTW = {
|
|
|
90
93
|
"menu.label.newIntegrations.professionalAV": "專業A/V",
|
|
91
94
|
"menu.label.newIntegrations.unifiDrive": "網路附加儲存裝置",
|
|
92
95
|
"menu.label.newIntegrations.unifiDrive.description": "超快速私人儲存。",
|
|
96
|
+
"menu.label.newIntegrations.ups": "不間斷電源供應系統",
|
|
93
97
|
"menu.label.physicalSecurity": "實體安全",
|
|
94
98
|
"menu.label.physicalSecurity.bullet": "Bullet",
|
|
95
99
|
"menu.label.physicalSecurity.domeTurret": "Dome & Turret",
|
|
@@ -116,7 +120,7 @@ var zhHantTW = {
|
|
|
116
120
|
"menu.label.security.specialDevices.floodlight": "泛光燈",
|
|
117
121
|
"menu.label.security.specialDevices.superLink": "SuperLink",
|
|
118
122
|
"menu.label.security.videoRecorders": "次世代NVR",
|
|
119
|
-
"menu.label.security.videoRecorders.description": "
|
|
123
|
+
"menu.label.security.videoRecorders.description": "確保每一幀,隨時隨地。",
|
|
120
124
|
"menu.label.siteManager": "站點管理員",
|
|
121
125
|
"menu.label.startHere": "從這裡開始",
|
|
122
126
|
"menu.label.startHere.accessoryTech": "配件科技",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zh-Hant-TW.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zh-Hant-TW.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Language } from "../../types";
|
|
2
2
|
export declare const useMicrositeMenuTranslations: (language: Language) => {
|
|
3
|
-
intl: import("@formatjs/intl").IntlShape<"menu.label.introduction" | "commons.whatsNew" | "menu.label.startHere.designCenter" | "menu.label.startHere.knowledgeCenter.largeProjectAssistance" | "menu.label.startHere.knowledgeCenter.professionalSupport" | "menu.label.startHere.knowledgeCenter.uispCarrierPlatform" | "commons.close" | "commons.company" | "commons.expand" | "commons.internet" | "commons.learnMore" | "commons.links" | "commons.menu.label.compare" | "commons.menu.label.compareAll" | "commons.menu.label.explore" | "commons.menu.label.new" | "commons.menu.label.overview" | "commons.social" | "commons.store" | "commons.support" | "commons.tools" | "commons.training" | "commons.viewAll" | "menu.action.label.calculateNow" | "menu.description.cloudGateways" | "menu.description.integrations" | "menu.description.physicalSecurity" | "menu.description.startHere.caseStudies.celticDoyle" | "menu.description.startHere.caseStudies.fedexForum" | "menu.description.startHere.caseStudies.fiveGuys" | "menu.description.startHere.caseStudies.tinyDino" | "menu.description.startHere.caseStudies.unifiCaseStudies" | "menu.description.startHere.designCenter.nextAiCamera" | "menu.description.startHere.designCenter.nextAiCyber" | "menu.description.startHere.designCenter.sdWanSase" | "menu.description.startHere.designCenter.siteManager" | "menu.description.startHere.resources.blog" | "menu.description.startHere.resources.enterpriseProgram" | "menu.description.startHere.resources.eventsPrograms" | "menu.description.startHere.resources.techSpecs" | "menu.description.startHere.resources.training" | "menu.description.startHere.whyUniFi.howItWorks" | "menu.description.startHere.whyUniFi.tcoCalculator" | "menu.description.switching" | "menu.description.wifi" | "menu.label.cloudGateways" | "menu.label.cloudGateways.compact" | "menu.label.cloudGateways.compact.description" | "menu.label.cloudGateways.enterpriseScale" | "menu.label.cloudGateways.enterpriseScale.description" | "menu.label.cloudGateways.identity" | "menu.label.cloudGateways.identity.description" | "menu.label.cloudGateways.largeScale" | "menu.label.cloudGateways.largeScale.description" | "menu.label.cloudGateways.overview" | "menu.label.cloudGateways.overview.description" | "menu.label.cloudGateways.wifiIntegrated" | "menu.label.cloudGateways.wifiIntegrated.description" | "menu.label.cloudGateways.wifiIntegrated.dreamRouter" | "menu.label.cloudGateways.wifiIntegrated.dreamWall" | "menu.label.cloudGateways.wifiIntegrated.express" | "menu.label.moreFromUi" | "menu.label.newIntegrations" | "menu.label.newIntegrations.accessoryTech" | "menu.label.newIntegrations.accessoryTech.accessories" | "menu.label.newIntegrations.accessoryTech.cables" | "menu.label.newIntegrations.accessoryTech.description" | "menu.label.newIntegrations.accessoryTech.installations" | "menu.label.newIntegrations.accessoryTech.rackDesigns" | "menu.label.newIntegrations.accessoryTech.storage" | "menu.label.newIntegrations.digitalSignage" | "menu.label.newIntegrations.digitalSignage.description" | "menu.label.newIntegrations.evCharging" | "menu.label.newIntegrations.evCharging.description" | "menu.label.newIntegrations.hosting" | "menu.label.newIntegrations.hosting.controlPlaneOptions" | "menu.label.newIntegrations.hosting.description" | "menu.label.newIntegrations.hosting.independentGateways" | "menu.label.newIntegrations.internetSolutions" | "menu.label.newIntegrations.internetSolutions.cableInternet" | "menu.label.newIntegrations.internetSolutions.description" | "menu.label.newIntegrations.internetSolutions.lteBackup" | "menu.label.newIntegrations.managedVoip" | "menu.label.newIntegrations.managedVoip.description" | "menu.label.newIntegrations.mobileRouting" | "menu.label.newIntegrations.mobileRouting.description" | "menu.label.newIntegrations.overview" | "menu.label.newIntegrations.overview.description" | "menu.label.newIntegrations.powerTech" | "menu.label.newIntegrations.powerTech.description" | "menu.label.newIntegrations.premiumAudio" | "menu.label.newIntegrations.premiumAudio.description" | "menu.label.newIntegrations.premiumIoT" | "menu.label.newIntegrations.premiumIoT.description" | "menu.label.newIntegrations.professionalAV" | "menu.label.newIntegrations.unifiDrive" | "menu.label.newIntegrations.unifiDrive.description" | "menu.label.physicalSecurity" | "menu.label.physicalSecurity.bullet" | "menu.label.physicalSecurity.domeTurret" | "menu.label.physicalSecurity.doorAccess" | "menu.label.physicalSecurity.overview" | "menu.label.physicalSecurity.ptz" | "menu.label.physicalSecurity.specialDevices" | "menu.label.security.bullet" | "menu.label.security.bullet.description" | "menu.label.security.domeAndTurret" | "menu.label.security.domeAndTurret.description" | "menu.label.security.doorAccess" | "menu.label.security.doorAccess.description.1" | "menu.label.security.overview.description" | "menu.label.security.ptz" | "menu.label.security.ptz.description" | "menu.label.security.specialDevices" | "menu.label.security.specialDevices.aiEnhancements" | "menu.label.security.specialDevices.compactCameras" | "menu.label.security.specialDevices.description" | "menu.label.security.specialDevices.doorbells" | "menu.label.security.specialDevices.floodlight" | "menu.label.security.specialDevices.superLink" | "menu.label.security.videoRecorders" | "menu.label.security.videoRecorders.description" | "menu.label.siteManager" | "menu.label.startHere" | "menu.label.startHere.caseStudies" | "menu.label.startHere.caseStudies.featured.celticDoyle" | "menu.label.startHere.caseStudies.featured.fedexForum" | "menu.label.startHere.caseStudies.featured.fiveGuys" | "menu.label.startHere.caseStudies.featured.shopifySummit" | "menu.label.startHere.caseStudies.featured.tinyDino" | "menu.label.startHere.caseStudies.unifiCaseStudies" | "menu.label.startHere.designCenter.description" | "menu.label.startHere.designCenter.nextAiCamera" | "menu.label.startHere.designCenter.nextAiCyber" | "menu.label.startHere.designCenter.sdWanSase" | "menu.label.startHere.designCenter.siteManager" | "menu.label.startHere.knowledgeCenter" | "menu.label.startHere.partnerHub" | "menu.label.startHere.resources" | "menu.label.startHere.resources.blog" | "menu.label.startHere.resources.eventsPrograms" | "menu.label.startHere.resources.proSupport" | "menu.label.startHere.resources.techSpecs" | "menu.label.startHere.resources.training" | "menu.label.startHere.siteMap" | "menu.label.startHere.whyUniFi" | "menu.label.startHere.whyUniFi.designCenter" | "menu.label.startHere.whyUniFi.howItWorks.large" | "menu.label.startHere.whyUniFi.howItWorks.massiveScale" | "menu.label.startHere.whyUniFi.howItWorks.multiSite" | "menu.label.startHere.whyUniFi.howItWorks.simple" | "menu.label.startHere.whyUniFi.migrationAssistance" | "menu.label.storybook.first" | "menu.label.storybook.second" | "menu.label.storybook.third" | "menu.label.switching" | "menu.label.switching.compact" | "menu.label.switching.compact.description" | "menu.label.switching.coreAggregation" | "menu.label.switching.edge" | "menu.label.switching.enterprise" | "menu.label.switching.enterprise.description" | "menu.label.switching.overview" | "menu.label.switching.overview.description" | "menu.label.switching.professional" | "menu.label.switching.professional.description" | "menu.label.switching.value" | "menu.label.switching.value.description" | "menu.label.switching.wan" | "menu.label.switching.wan.description" | "menu.label.unifi" | "menu.label.viewSiteMapTopology" | "menu.label.wifi" | "menu.label.wifi.bridging" | "menu.label.wifi.bridging.buildingBridge" | "menu.label.wifi.bridging.description" | "menu.label.wifi.bridging.deviceBridge" | "menu.label.wifi.enterprise" | "menu.label.wifi.enterprise.description" | "menu.label.wifi.flagship" | "menu.label.wifi.flagship.description" | "menu.label.wifi.megaCapacity" | "menu.label.wifi.megaCapacity.description" | "menu.label.wifi.outdoor" | "menu.label.wifi.outdoor.description" | "menu.label.wifi.overview" | "menu.label.wifi.overview.description" | "menu.label.wifi.wall" | "menu.label.wifi.wall.description" | "menu.old.cloudGateways" | "menu.siteMap.closeSiteMap" | "menu.siteMap.title" | "menu.topology.title">;
|
|
4
|
-
formatMessage: (id: "menu.label.introduction" | "commons.whatsNew" | "menu.label.startHere.designCenter" | "menu.label.startHere.knowledgeCenter.largeProjectAssistance" | "menu.label.startHere.knowledgeCenter.professionalSupport" | "menu.label.startHere.knowledgeCenter.uispCarrierPlatform" | "commons.close" | "commons.company" | "commons.expand" | "commons.internet" | "commons.learnMore" | "commons.links" | "commons.menu.label.compare" | "commons.menu.label.compareAll" | "commons.menu.label.explore" | "commons.menu.label.new" | "commons.menu.label.overview" | "commons.social" | "commons.store" | "commons.support" | "commons.tools" | "commons.training" | "commons.viewAll" | "menu.action.label.calculateNow" | "menu.description.cloudGateways" | "menu.description.integrations" | "menu.description.physicalSecurity" | "menu.description.startHere.caseStudies.celticDoyle" | "menu.description.startHere.caseStudies.fedexForum" | "menu.description.startHere.caseStudies.fiveGuys" | "menu.description.startHere.caseStudies.tinyDino" | "menu.description.startHere.caseStudies.unifiCaseStudies" | "menu.description.startHere.designCenter.nextAiCamera" | "menu.description.startHere.designCenter.nextAiCyber" | "menu.description.startHere.designCenter.sdWanSase" | "menu.description.startHere.designCenter.siteManager" | "menu.description.startHere.resources.blog" | "menu.description.startHere.resources.enterpriseProgram" | "menu.description.startHere.resources.eventsPrograms" | "menu.description.startHere.resources.techSpecs" | "menu.description.startHere.resources.training" | "menu.description.startHere.whyUniFi.howItWorks" | "menu.description.startHere.whyUniFi.tcoCalculator" | "menu.description.switching" | "menu.description.wifi" | "menu.label.cloudGateways" | "menu.label.cloudGateways.compact" | "menu.label.cloudGateways.compact.description" | "menu.label.cloudGateways.enterpriseScale" | "menu.label.cloudGateways.enterpriseScale.description" | "menu.label.cloudGateways.identity" | "menu.label.cloudGateways.identity.description" | "menu.label.cloudGateways.largeScale" | "menu.label.cloudGateways.largeScale.description" | "menu.label.cloudGateways.overview" | "menu.label.cloudGateways.overview.description" | "menu.label.cloudGateways.wifiIntegrated" | "menu.label.cloudGateways.wifiIntegrated.description" | "menu.label.cloudGateways.wifiIntegrated.dreamRouter" | "menu.label.cloudGateways.wifiIntegrated.dreamWall" | "menu.label.cloudGateways.wifiIntegrated.express" | "menu.label.moreFromUi" | "menu.label.newIntegrations" | "menu.label.newIntegrations.accessoryTech" | "menu.label.newIntegrations.accessoryTech.accessories" | "menu.label.newIntegrations.accessoryTech.cables" | "menu.label.newIntegrations.accessoryTech.description" | "menu.label.newIntegrations.accessoryTech.installations" | "menu.label.newIntegrations.accessoryTech.rackDesigns" | "menu.label.newIntegrations.accessoryTech.storage" | "menu.label.newIntegrations.digitalSignage" | "menu.label.newIntegrations.digitalSignage.description" | "menu.label.newIntegrations.evCharging" | "menu.label.newIntegrations.evCharging.description" | "menu.label.newIntegrations.hosting" | "menu.label.newIntegrations.hosting.controlPlaneOptions" | "menu.label.newIntegrations.hosting.description" | "menu.label.newIntegrations.hosting.independentGateways" | "menu.label.newIntegrations.internetSolutions" | "menu.label.newIntegrations.internetSolutions.cableInternet" | "menu.label.newIntegrations.internetSolutions.description" | "menu.label.newIntegrations.internetSolutions.lteBackup" | "menu.label.newIntegrations.managedVoip" | "menu.label.newIntegrations.managedVoip.description" | "menu.label.newIntegrations.mobileRouting" | "menu.label.newIntegrations.mobileRouting.description" | "menu.label.newIntegrations.overview" | "menu.label.newIntegrations.overview.description" | "menu.label.newIntegrations.powerTech" | "menu.label.newIntegrations.powerTech.description" | "menu.label.newIntegrations.premiumAudio" | "menu.label.newIntegrations.premiumAudio.description" | "menu.label.newIntegrations.premiumIoT" | "menu.label.newIntegrations.premiumIoT.description" | "menu.label.newIntegrations.professionalAV" | "menu.label.newIntegrations.unifiDrive" | "menu.label.newIntegrations.unifiDrive.description" | "menu.label.physicalSecurity" | "menu.label.physicalSecurity.bullet" | "menu.label.physicalSecurity.domeTurret" | "menu.label.physicalSecurity.doorAccess" | "menu.label.physicalSecurity.overview" | "menu.label.physicalSecurity.ptz" | "menu.label.physicalSecurity.specialDevices" | "menu.label.security.bullet" | "menu.label.security.bullet.description" | "menu.label.security.domeAndTurret" | "menu.label.security.domeAndTurret.description" | "menu.label.security.doorAccess" | "menu.label.security.doorAccess.description.1" | "menu.label.security.overview.description" | "menu.label.security.ptz" | "menu.label.security.ptz.description" | "menu.label.security.specialDevices" | "menu.label.security.specialDevices.aiEnhancements" | "menu.label.security.specialDevices.compactCameras" | "menu.label.security.specialDevices.description" | "menu.label.security.specialDevices.doorbells" | "menu.label.security.specialDevices.floodlight" | "menu.label.security.specialDevices.superLink" | "menu.label.security.videoRecorders" | "menu.label.security.videoRecorders.description" | "menu.label.siteManager" | "menu.label.startHere" | "menu.label.startHere.caseStudies" | "menu.label.startHere.caseStudies.featured.celticDoyle" | "menu.label.startHere.caseStudies.featured.fedexForum" | "menu.label.startHere.caseStudies.featured.fiveGuys" | "menu.label.startHere.caseStudies.featured.shopifySummit" | "menu.label.startHere.caseStudies.featured.tinyDino" | "menu.label.startHere.caseStudies.unifiCaseStudies" | "menu.label.startHere.designCenter.description" | "menu.label.startHere.designCenter.nextAiCamera" | "menu.label.startHere.designCenter.nextAiCyber" | "menu.label.startHere.designCenter.sdWanSase" | "menu.label.startHere.designCenter.siteManager" | "menu.label.startHere.knowledgeCenter" | "menu.label.startHere.partnerHub" | "menu.label.startHere.resources" | "menu.label.startHere.resources.blog" | "menu.label.startHere.resources.eventsPrograms" | "menu.label.startHere.resources.proSupport" | "menu.label.startHere.resources.techSpecs" | "menu.label.startHere.resources.training" | "menu.label.startHere.siteMap" | "menu.label.startHere.whyUniFi" | "menu.label.startHere.whyUniFi.designCenter" | "menu.label.startHere.whyUniFi.howItWorks.large" | "menu.label.startHere.whyUniFi.howItWorks.massiveScale" | "menu.label.startHere.whyUniFi.howItWorks.multiSite" | "menu.label.startHere.whyUniFi.howItWorks.simple" | "menu.label.startHere.whyUniFi.migrationAssistance" | "menu.label.storybook.first" | "menu.label.storybook.second" | "menu.label.storybook.third" | "menu.label.switching" | "menu.label.switching.compact" | "menu.label.switching.compact.description" | "menu.label.switching.coreAggregation" | "menu.label.switching.edge" | "menu.label.switching.enterprise" | "menu.label.switching.enterprise.description" | "menu.label.switching.overview" | "menu.label.switching.overview.description" | "menu.label.switching.professional" | "menu.label.switching.professional.description" | "menu.label.switching.value" | "menu.label.switching.value.description" | "menu.label.switching.wan" | "menu.label.switching.wan.description" | "menu.label.unifi" | "menu.label.viewSiteMapTopology" | "menu.label.wifi" | "menu.label.wifi.bridging" | "menu.label.wifi.bridging.buildingBridge" | "menu.label.wifi.bridging.description" | "menu.label.wifi.bridging.deviceBridge" | "menu.label.wifi.enterprise" | "menu.label.wifi.enterprise.description" | "menu.label.wifi.flagship" | "menu.label.wifi.flagship.description" | "menu.label.wifi.megaCapacity" | "menu.label.wifi.megaCapacity.description" | "menu.label.wifi.outdoor" | "menu.label.wifi.outdoor.description" | "menu.label.wifi.overview" | "menu.label.wifi.overview.description" | "menu.label.wifi.wall" | "menu.label.wifi.wall.description" | "menu.old.cloudGateways" | "menu.siteMap.closeSiteMap" | "menu.siteMap.title" | "menu.topology.title", values?: {
|
|
3
|
+
intl: import("@formatjs/intl").IntlShape<"menu.label.introduction" | "commons.whatsNew" | "menu.label.startHere.designCenter" | "menu.label.startHere.knowledgeCenter.largeProjectAssistance" | "menu.label.startHere.knowledgeCenter.professionalSupport" | "menu.label.startHere.knowledgeCenter.uispCarrierPlatform" | "commons.close" | "commons.company" | "commons.expand" | "commons.internet" | "commons.learnMore" | "commons.links" | "commons.menu.label.compare" | "commons.menu.label.compareAll" | "commons.menu.label.explore" | "commons.menu.label.new" | "commons.menu.label.overview" | "commons.social" | "commons.store" | "commons.support" | "commons.tools" | "commons.training" | "commons.viewAll" | "menu.action.label.calculateNow" | "menu.description.cloudGateways" | "menu.description.integrations" | "menu.description.physicalSecurity" | "menu.description.startHere.caseStudies.celticDoyle" | "menu.description.startHere.caseStudies.fedexForum" | "menu.description.startHere.caseStudies.fiveGuys" | "menu.description.startHere.caseStudies.tinyDino" | "menu.description.startHere.caseStudies.unifiCaseStudies" | "menu.description.startHere.designCenter.nextAiCamera" | "menu.description.startHere.designCenter.nextAiCyber" | "menu.description.startHere.designCenter.sdWanSase" | "menu.description.startHere.designCenter.siteManager" | "menu.description.startHere.resources.blog" | "menu.description.startHere.resources.enterpriseProgram" | "menu.description.startHere.resources.eventsPrograms" | "menu.description.startHere.resources.techSpecs" | "menu.description.startHere.resources.training" | "menu.description.startHere.whyUniFi.howItWorks" | "menu.description.startHere.whyUniFi.tcoCalculator" | "menu.description.switching" | "menu.description.wifi" | "menu.label.cloudGateways" | "menu.label.cloudGateways.compact" | "menu.label.cloudGateways.compact.description" | "menu.label.cloudGateways.enterpriseScale" | "menu.label.cloudGateways.enterpriseScale.description" | "menu.label.cloudGateways.identity" | "menu.label.cloudGateways.identity.description" | "menu.label.cloudGateways.largeScale" | "menu.label.cloudGateways.largeScale.description" | "menu.label.cloudGateways.overview" | "menu.label.cloudGateways.overview.description" | "menu.label.cloudGateways.wifiIntegrated" | "menu.label.cloudGateways.wifiIntegrated.description" | "menu.label.cloudGateways.wifiIntegrated.dreamRouter" | "menu.label.cloudGateways.wifiIntegrated.dreamWall" | "menu.label.cloudGateways.wifiIntegrated.express" | "menu.label.moreFromUi" | "menu.label.newIntegrations" | "menu.label.newIntegrations.accessoryTech" | "menu.label.newIntegrations.accessoryTech.accessories" | "menu.label.newIntegrations.accessoryTech.cables" | "menu.label.newIntegrations.accessoryTech.description" | "menu.label.newIntegrations.accessoryTech.installations" | "menu.label.newIntegrations.accessoryTech.rackDesigns" | "menu.label.newIntegrations.accessoryTech.storage" | "menu.label.newIntegrations.digitalSignage" | "menu.label.newIntegrations.digitalSignage.description" | "menu.label.newIntegrations.evCharging" | "menu.label.newIntegrations.evCharging.description" | "menu.label.newIntegrations.hosting" | "menu.label.newIntegrations.hosting.controlPlaneOptions" | "menu.label.newIntegrations.hosting.description" | "menu.label.newIntegrations.hosting.independentGateways" | "menu.label.newIntegrations.internetSolutions" | "menu.label.newIntegrations.internetSolutions.cableInternet" | "menu.label.newIntegrations.internetSolutions.description" | "menu.label.newIntegrations.internetSolutions.lteBackup" | "menu.label.newIntegrations.managedVoip" | "menu.label.newIntegrations.managedVoip.description" | "menu.label.newIntegrations.mobileRouting" | "menu.label.newIntegrations.mobileRouting.description" | "menu.label.newIntegrations.overview" | "menu.label.newIntegrations.overview.description" | "menu.label.newIntegrations.powerSolutions" | "menu.label.newIntegrations.powerTech" | "menu.label.newIntegrations.powerTech.description" | "menu.label.newIntegrations.premiumAudio" | "menu.label.newIntegrations.premiumAudio.description" | "menu.label.newIntegrations.premiumIoT" | "menu.label.newIntegrations.premiumIoT.description" | "menu.label.newIntegrations.professionalAV" | "menu.label.newIntegrations.unifiDrive" | "menu.label.newIntegrations.unifiDrive.description" | "menu.label.newIntegrations.ups" | "menu.label.physicalSecurity" | "menu.label.physicalSecurity.bullet" | "menu.label.physicalSecurity.domeTurret" | "menu.label.physicalSecurity.doorAccess" | "menu.label.physicalSecurity.overview" | "menu.label.physicalSecurity.ptz" | "menu.label.physicalSecurity.specialDevices" | "menu.label.security.bullet" | "menu.label.security.bullet.description" | "menu.label.security.domeAndTurret" | "menu.label.security.domeAndTurret.description" | "menu.label.security.doorAccess" | "menu.label.security.doorAccess.description.1" | "menu.label.security.overview.description" | "menu.label.security.ptz" | "menu.label.security.ptz.description" | "menu.label.security.specialDevices" | "menu.label.security.specialDevices.aiEnhancements" | "menu.label.security.specialDevices.compactCameras" | "menu.label.security.specialDevices.description" | "menu.label.security.specialDevices.doorbells" | "menu.label.security.specialDevices.floodlight" | "menu.label.security.specialDevices.superLink" | "menu.label.security.videoRecorders" | "menu.label.security.videoRecorders.description" | "menu.label.siteManager" | "menu.label.startHere" | "menu.label.startHere.caseStudies" | "menu.label.startHere.caseStudies.featured.celticDoyle" | "menu.label.startHere.caseStudies.featured.fedexForum" | "menu.label.startHere.caseStudies.featured.fiveGuys" | "menu.label.startHere.caseStudies.featured.shopifySummit" | "menu.label.startHere.caseStudies.featured.tinyDino" | "menu.label.startHere.caseStudies.unifiCaseStudies" | "menu.label.startHere.designCenter.description" | "menu.label.startHere.designCenter.nextAiCamera" | "menu.label.startHere.designCenter.nextAiCyber" | "menu.label.startHere.designCenter.sdWanSase" | "menu.label.startHere.designCenter.siteManager" | "menu.label.startHere.knowledgeCenter" | "menu.label.startHere.partnerHub" | "menu.label.startHere.resources" | "menu.label.startHere.resources.blog" | "menu.label.startHere.resources.eventsPrograms" | "menu.label.startHere.resources.proSupport" | "menu.label.startHere.resources.techSpecs" | "menu.label.startHere.resources.training" | "menu.label.startHere.siteMap" | "menu.label.startHere.whyUniFi" | "menu.label.startHere.whyUniFi.designCenter" | "menu.label.startHere.whyUniFi.howItWorks.large" | "menu.label.startHere.whyUniFi.howItWorks.massiveScale" | "menu.label.startHere.whyUniFi.howItWorks.multiSite" | "menu.label.startHere.whyUniFi.howItWorks.simple" | "menu.label.startHere.whyUniFi.migrationAssistance" | "menu.label.storybook.first" | "menu.label.storybook.second" | "menu.label.storybook.third" | "menu.label.switching" | "menu.label.switching.compact" | "menu.label.switching.compact.description" | "menu.label.switching.coreAggregation" | "menu.label.switching.edge" | "menu.label.switching.enterprise" | "menu.label.switching.enterprise.description" | "menu.label.switching.overview" | "menu.label.switching.overview.description" | "menu.label.switching.professional" | "menu.label.switching.professional.description" | "menu.label.switching.value" | "menu.label.switching.value.description" | "menu.label.switching.wan" | "menu.label.switching.wan.description" | "menu.label.unifi" | "menu.label.viewSiteMapTopology" | "menu.label.wifi" | "menu.label.wifi.bridging" | "menu.label.wifi.bridging.buildingBridge" | "menu.label.wifi.bridging.description" | "menu.label.wifi.bridging.deviceBridge" | "menu.label.wifi.enterprise" | "menu.label.wifi.enterprise.description" | "menu.label.wifi.flagship" | "menu.label.wifi.flagship.description" | "menu.label.wifi.megaCapacity" | "menu.label.wifi.megaCapacity.description" | "menu.label.wifi.outdoor" | "menu.label.wifi.outdoor.description" | "menu.label.wifi.overview" | "menu.label.wifi.overview.description" | "menu.label.wifi.wall" | "menu.label.wifi.wall.description" | "menu.old.cloudGateways" | "menu.siteMap.closeSiteMap" | "menu.siteMap.title" | "menu.topology.title">;
|
|
4
|
+
formatMessage: (id: "menu.label.introduction" | "commons.whatsNew" | "menu.label.startHere.designCenter" | "menu.label.startHere.knowledgeCenter.largeProjectAssistance" | "menu.label.startHere.knowledgeCenter.professionalSupport" | "menu.label.startHere.knowledgeCenter.uispCarrierPlatform" | "commons.close" | "commons.company" | "commons.expand" | "commons.internet" | "commons.learnMore" | "commons.links" | "commons.menu.label.compare" | "commons.menu.label.compareAll" | "commons.menu.label.explore" | "commons.menu.label.new" | "commons.menu.label.overview" | "commons.social" | "commons.store" | "commons.support" | "commons.tools" | "commons.training" | "commons.viewAll" | "menu.action.label.calculateNow" | "menu.description.cloudGateways" | "menu.description.integrations" | "menu.description.physicalSecurity" | "menu.description.startHere.caseStudies.celticDoyle" | "menu.description.startHere.caseStudies.fedexForum" | "menu.description.startHere.caseStudies.fiveGuys" | "menu.description.startHere.caseStudies.tinyDino" | "menu.description.startHere.caseStudies.unifiCaseStudies" | "menu.description.startHere.designCenter.nextAiCamera" | "menu.description.startHere.designCenter.nextAiCyber" | "menu.description.startHere.designCenter.sdWanSase" | "menu.description.startHere.designCenter.siteManager" | "menu.description.startHere.resources.blog" | "menu.description.startHere.resources.enterpriseProgram" | "menu.description.startHere.resources.eventsPrograms" | "menu.description.startHere.resources.techSpecs" | "menu.description.startHere.resources.training" | "menu.description.startHere.whyUniFi.howItWorks" | "menu.description.startHere.whyUniFi.tcoCalculator" | "menu.description.switching" | "menu.description.wifi" | "menu.label.cloudGateways" | "menu.label.cloudGateways.compact" | "menu.label.cloudGateways.compact.description" | "menu.label.cloudGateways.enterpriseScale" | "menu.label.cloudGateways.enterpriseScale.description" | "menu.label.cloudGateways.identity" | "menu.label.cloudGateways.identity.description" | "menu.label.cloudGateways.largeScale" | "menu.label.cloudGateways.largeScale.description" | "menu.label.cloudGateways.overview" | "menu.label.cloudGateways.overview.description" | "menu.label.cloudGateways.wifiIntegrated" | "menu.label.cloudGateways.wifiIntegrated.description" | "menu.label.cloudGateways.wifiIntegrated.dreamRouter" | "menu.label.cloudGateways.wifiIntegrated.dreamWall" | "menu.label.cloudGateways.wifiIntegrated.express" | "menu.label.moreFromUi" | "menu.label.newIntegrations" | "menu.label.newIntegrations.accessoryTech" | "menu.label.newIntegrations.accessoryTech.accessories" | "menu.label.newIntegrations.accessoryTech.cables" | "menu.label.newIntegrations.accessoryTech.description" | "menu.label.newIntegrations.accessoryTech.installations" | "menu.label.newIntegrations.accessoryTech.rackDesigns" | "menu.label.newIntegrations.accessoryTech.storage" | "menu.label.newIntegrations.digitalSignage" | "menu.label.newIntegrations.digitalSignage.description" | "menu.label.newIntegrations.evCharging" | "menu.label.newIntegrations.evCharging.description" | "menu.label.newIntegrations.hosting" | "menu.label.newIntegrations.hosting.controlPlaneOptions" | "menu.label.newIntegrations.hosting.description" | "menu.label.newIntegrations.hosting.independentGateways" | "menu.label.newIntegrations.internetSolutions" | "menu.label.newIntegrations.internetSolutions.cableInternet" | "menu.label.newIntegrations.internetSolutions.description" | "menu.label.newIntegrations.internetSolutions.lteBackup" | "menu.label.newIntegrations.managedVoip" | "menu.label.newIntegrations.managedVoip.description" | "menu.label.newIntegrations.mobileRouting" | "menu.label.newIntegrations.mobileRouting.description" | "menu.label.newIntegrations.overview" | "menu.label.newIntegrations.overview.description" | "menu.label.newIntegrations.powerSolutions" | "menu.label.newIntegrations.powerTech" | "menu.label.newIntegrations.powerTech.description" | "menu.label.newIntegrations.premiumAudio" | "menu.label.newIntegrations.premiumAudio.description" | "menu.label.newIntegrations.premiumIoT" | "menu.label.newIntegrations.premiumIoT.description" | "menu.label.newIntegrations.professionalAV" | "menu.label.newIntegrations.unifiDrive" | "menu.label.newIntegrations.unifiDrive.description" | "menu.label.newIntegrations.ups" | "menu.label.physicalSecurity" | "menu.label.physicalSecurity.bullet" | "menu.label.physicalSecurity.domeTurret" | "menu.label.physicalSecurity.doorAccess" | "menu.label.physicalSecurity.overview" | "menu.label.physicalSecurity.ptz" | "menu.label.physicalSecurity.specialDevices" | "menu.label.security.bullet" | "menu.label.security.bullet.description" | "menu.label.security.domeAndTurret" | "menu.label.security.domeAndTurret.description" | "menu.label.security.doorAccess" | "menu.label.security.doorAccess.description.1" | "menu.label.security.overview.description" | "menu.label.security.ptz" | "menu.label.security.ptz.description" | "menu.label.security.specialDevices" | "menu.label.security.specialDevices.aiEnhancements" | "menu.label.security.specialDevices.compactCameras" | "menu.label.security.specialDevices.description" | "menu.label.security.specialDevices.doorbells" | "menu.label.security.specialDevices.floodlight" | "menu.label.security.specialDevices.superLink" | "menu.label.security.videoRecorders" | "menu.label.security.videoRecorders.description" | "menu.label.siteManager" | "menu.label.startHere" | "menu.label.startHere.caseStudies" | "menu.label.startHere.caseStudies.featured.celticDoyle" | "menu.label.startHere.caseStudies.featured.fedexForum" | "menu.label.startHere.caseStudies.featured.fiveGuys" | "menu.label.startHere.caseStudies.featured.shopifySummit" | "menu.label.startHere.caseStudies.featured.tinyDino" | "menu.label.startHere.caseStudies.unifiCaseStudies" | "menu.label.startHere.designCenter.description" | "menu.label.startHere.designCenter.nextAiCamera" | "menu.label.startHere.designCenter.nextAiCyber" | "menu.label.startHere.designCenter.sdWanSase" | "menu.label.startHere.designCenter.siteManager" | "menu.label.startHere.knowledgeCenter" | "menu.label.startHere.partnerHub" | "menu.label.startHere.resources" | "menu.label.startHere.resources.blog" | "menu.label.startHere.resources.eventsPrograms" | "menu.label.startHere.resources.proSupport" | "menu.label.startHere.resources.techSpecs" | "menu.label.startHere.resources.training" | "menu.label.startHere.siteMap" | "menu.label.startHere.whyUniFi" | "menu.label.startHere.whyUniFi.designCenter" | "menu.label.startHere.whyUniFi.howItWorks.large" | "menu.label.startHere.whyUniFi.howItWorks.massiveScale" | "menu.label.startHere.whyUniFi.howItWorks.multiSite" | "menu.label.startHere.whyUniFi.howItWorks.simple" | "menu.label.startHere.whyUniFi.migrationAssistance" | "menu.label.storybook.first" | "menu.label.storybook.second" | "menu.label.storybook.third" | "menu.label.switching" | "menu.label.switching.compact" | "menu.label.switching.compact.description" | "menu.label.switching.coreAggregation" | "menu.label.switching.edge" | "menu.label.switching.enterprise" | "menu.label.switching.enterprise.description" | "menu.label.switching.overview" | "menu.label.switching.overview.description" | "menu.label.switching.professional" | "menu.label.switching.professional.description" | "menu.label.switching.value" | "menu.label.switching.value.description" | "menu.label.switching.wan" | "menu.label.switching.wan.description" | "menu.label.unifi" | "menu.label.viewSiteMapTopology" | "menu.label.wifi" | "menu.label.wifi.bridging" | "menu.label.wifi.bridging.buildingBridge" | "menu.label.wifi.bridging.description" | "menu.label.wifi.bridging.deviceBridge" | "menu.label.wifi.enterprise" | "menu.label.wifi.enterprise.description" | "menu.label.wifi.flagship" | "menu.label.wifi.flagship.description" | "menu.label.wifi.megaCapacity" | "menu.label.wifi.megaCapacity.description" | "menu.label.wifi.outdoor" | "menu.label.wifi.outdoor.description" | "menu.label.wifi.overview" | "menu.label.wifi.overview.description" | "menu.label.wifi.wall" | "menu.label.wifi.wall.description" | "menu.old.cloudGateways" | "menu.siteMap.closeSiteMap" | "menu.siteMap.title" | "menu.topology.title", values?: {
|
|
5
5
|
[x: string]: import("intl-messageformat").PrimitiveType | import("intl-messageformat").FormatXMLElementFn<string, string>;
|
|
6
6
|
}) => string;
|
|
7
7
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
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=KeyMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyMap.js","sources":["../../src/utils/KeyMap.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":"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"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { createArrayFromInterfaceKeys } from './array.mjs';
|
|
2
|
+
"use strict";
|
|
3
|
+
class KeyMap {
|
|
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=KeyMap.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyMap.mjs","sources":["../../src/utils/KeyMap.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,IAAIJ,GAAA,EAAmB;IACrB,IAAA,CAAK,CAAAR,aAAcQ,GAAG,CAAA;IACtB,OAAO,KAAK,CAAAV,GAAA,CAAKc,GAAA,CAAI,IAAA,CAAK,CAAAb,SAAA,CAAWS,GAAG,CAAC,CAAA;EAC3C;EAAA;AAAA;AAAA;EAKAK,MAAAA,CAAA,EAAkC;IAChC,OAAO,IAAA,CAAK,CAAAf,IAAKe,MAAA,CAAA,CAAO;EAC1B;EAAA;AAAA;AAAA;EAKAC,IAAAA,CAAA,EAAiC;IAC/B,OAAO,IAAA,CAAK,CAAAhB,IAAKgB,IAAA,CAAA,CAAK;EACxB;EAAA;AAAA;AAAA;EAKAX,OAAAA,CAAA,EAA6C;IAC3C,OAAO,IAAA,CAAK,CAAAL,IAAKK,OAAA,CAAA,CAAQ;EAC3B;EAAA;AAAA;AAAA;EAKA,IAAIY,IAAAA,CAAA,EAAe;IACjB,OAAO,KAAK,CAAAjB,GAAA,CAAKiB,IAAA;EACnB;EAAA;AAAA;AAAA;EAKAC,KAAAA,CAAA,EAAc;IACZ,IAAA,CAAK,CAAAlB,IAAKkB,KAAA,CAAA,CAAM;EAClB;EAAA;AAAA;AAAA;EAKAC,OAAOT,GAAA,EAAmB;IACxB,IAAA,CAAK,CAAAR,aAAcQ,GAAG,CAAA;IACtB,OAAO,KAAK,CAAAV,GAAA,CAAKmB,MAAA,CAAO,IAAA,CAAK,CAAAlB,SAAA,CAAWS,GAAG,CAAC,CAAA;EAC9C;EAAA;AAAA;AAAA;EAKA,OAAOU,qBAAAA,CAILC,cAAA,EACAhB,OAAA,EACoB;IACpB,MAAMiB,SAAA,GAAYC,6BAA6BF,cAAc,CAAA;IAE7D,MAAMjB,MAAA,GAA0BM,GAAA,IAAQ;MACtC,OAAOY,SAAA,CAAUtB,GAAA,CAAKwB,KAAA,IAAUC,MAAA,CAAOf,GAAA,CAAIc,KAAK,CAAC,CAAC,CAAA,CAAEE,IAAA,CAAK,GAAG,CAAA;IAC9D,CAAA;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;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/utils/array.d.ts
CHANGED
|
@@ -28,3 +28,9 @@ export declare const arraySafeIndexFind: <T>(array: T[], index: number) => T | u
|
|
|
28
28
|
* Normalise sort result to be in range of -1 to 1 so that we can easily combine multiple sorts
|
|
29
29
|
*/
|
|
30
30
|
export declare const normalizeSortResult: (sortResult: number) => number;
|
|
31
|
+
/**
|
|
32
|
+
* Returns an array of keys from an interface where the value is true
|
|
33
|
+
*
|
|
34
|
+
* @example createArrayFromInterfaceKeys<{a: string, b: number, c: Date}>({ a: true, b: false, c: true }) => ['a', 'c']
|
|
35
|
+
*/
|
|
36
|
+
export declare function createArrayFromInterfaceKeys<T extends object>(keyRecord: Record<keyof T, boolean>): (keyof T)[];
|
package/lib/utils/array.js
CHANGED
|
@@ -24,9 +24,18 @@ const arraySafeIndexFind = (array, index) => {
|
|
|
24
24
|
return array[safeIndex];
|
|
25
25
|
};
|
|
26
26
|
const normalizeSortResult = sortResult => number.clamp(sortResult, -1, 1);
|
|
27
|
+
function createArrayFromInterfaceKeys(keyRecord) {
|
|
28
|
+
return Object.entries(keyRecord).reduce((acc, [key, include]) => {
|
|
29
|
+
if (include) {
|
|
30
|
+
acc.push(key);
|
|
31
|
+
}
|
|
32
|
+
return acc;
|
|
33
|
+
}, []);
|
|
34
|
+
}
|
|
27
35
|
exports.areEqualArrays = areEqualArrays;
|
|
28
36
|
exports.arraySafeIndex = arraySafeIndex;
|
|
29
37
|
exports.arraySafeIndexFind = arraySafeIndexFind;
|
|
38
|
+
exports.createArrayFromInterfaceKeys = createArrayFromInterfaceKeys;
|
|
30
39
|
exports.dedupe = dedupe;
|
|
31
40
|
exports.ensureArray = ensureArray;
|
|
32
41
|
exports.normalizeSortResult = normalizeSortResult;
|
package/lib/utils/array.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.js","sources":["../../src/utils/array.ts"],"sourcesContent":["import { clamp } from \"./number\";\n\n/**\n * Make sure the element is an array\n * If it's not, make it an array of one element\n */\nexport function ensureArray<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Utility to quickly remove duplicates from an array.\n *\n * Similar to lodash's `uniq`, but doesn't require lodash as dependency.\n */\nexport const dedupe = <T>(arr: T[]) => [...new Set(arr)];\n\n/**\n * Utility function check if given arrays contain same elements (regardless the order)\n *\n * @example\n * areArraysEqual([1, 2, 3], [3, 2, 1]) // true\n * areArraysEqual([1, 2, 3], [3, 2, 1, 4]) // false\n */\nexport const areEqualArrays = (a: string[], b: string[]): boolean => {\n if (a.length !== b.length) {\n return false;\n }\n if (!a.every((el) => b.includes(el))) {\n return false;\n }\n return !b.every((el) => a.includes(el)) ? false : true;\n};\n\n/**\n * Function to get array index by positive and negative wrap-around offsets\n *\n * @see https://dirask.com/posts/JavaScript-positive-and-negative-around-index-wrapping-overlapping-to-address-items-in-array-pVyrnD\n */\nexport const arraySafeIndex = <T>(array: T[], index: number): number => {\n const indexSize = array.length;\n\n return ((index % indexSize) + indexSize) % indexSize;\n};\n\nexport const arraySafeIndexFind = <T>(\n array: T[],\n index: number,\n): T | undefined => {\n const safeIndex = arraySafeIndex(array, index);\n\n return array[safeIndex];\n};\n\n/**\n * Normalise sort result to be in range of -1 to 1 so that we can easily combine multiple sorts\n */\nexport const normalizeSortResult = (sortResult: number): number =>\n clamp(sortResult, -1, 1);\n"],"names":["ensureArray","value","Array","isArray","dedupe","arr","Set","areEqualArrays","a","b","length","every","el","includes","arraySafeIndex","array","index","indexSize","arraySafeIndexFind","safeIndex","normalizeSortResult","sortResult","clamp"],"mappings":";;;;AAMO,SAASA,YAAeC,KAAA,EAAqB;EAClD,OAAOC,MAAMC,OAAA,CAAQF,KAAK,CAAA,GAAIA,KAAA,GAAQ,CAACA,KAAK,CAAA;AAC9C;AAOO,MAAMG,MAAA,GAAaC,GAAA,IAAa,CAAC,GAAG,IAAIC,GAAA,CAAID,GAAG,CAAC,CAAA;AAShD,MAAME,cAAA,GAAiBA,CAACC,CAAA,EAAaC,CAAA,KAAyB;EACnE,IAAID,CAAA,CAAEE,MAAA,KAAWD,CAAA,CAAEC,MAAA,EAAQ;IACzB,OAAO,KAAA;EACT;EACA,IAAI,CAACF,EAAEG,KAAA,CAAOC,MAAOH,CAAA,CAAEI,QAAA,CAASD,EAAE,CAAC,CAAA,EAAG;IACpC,OAAO,KAAA;EACT;EACA,OAAO,CAACH,CAAA,CAAEE,KAAA,CAAOC,EAAA,IAAOJ,EAAEK,QAAA,CAASD,EAAE,CAAC,CAAA,GAAI,KAAA,GAAQ,IAAA;AACpD,CAAA;AAOO,MAAME,cAAA,GAAiBA,CAAIC,KAAA,EAAYC,KAAA,KAA0B;EACtE,MAAMC,YAAYF,KAAA,CAAML,MAAA;EAExB,OAAA,CAASM,KAAA,GAAQC,YAAaA,SAAA,IAAaA,SAAA;AAC7C,CAAA;AAEO,MAAMC,kBAAA,GAAqBA,CAChCH,KAAA,EACAC,KAAA,KACkB;EAClB,MAAMG,SAAA,GAAYL,cAAA,CAAeC,KAAA,EAAOC,KAAK,CAAA;EAE7C,OAAOD,MAAMI,SAAS,CAAA;AACxB,CAAA;AAKO,MAAMC,sBAAuBC,UAAA,IAClCC,MAAAA,CAAAA,KAAA,CAAMD,UAAA,EAAY,IAAI,CAAC,CAAA
|
|
1
|
+
{"version":3,"file":"array.js","sources":["../../src/utils/array.ts"],"sourcesContent":["import { clamp } from \"./number\";\n\n/**\n * Make sure the element is an array\n * If it's not, make it an array of one element\n */\nexport function ensureArray<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Utility to quickly remove duplicates from an array.\n *\n * Similar to lodash's `uniq`, but doesn't require lodash as dependency.\n */\nexport const dedupe = <T>(arr: T[]) => [...new Set(arr)];\n\n/**\n * Utility function check if given arrays contain same elements (regardless the order)\n *\n * @example\n * areArraysEqual([1, 2, 3], [3, 2, 1]) // true\n * areArraysEqual([1, 2, 3], [3, 2, 1, 4]) // false\n */\nexport const areEqualArrays = (a: string[], b: string[]): boolean => {\n if (a.length !== b.length) {\n return false;\n }\n if (!a.every((el) => b.includes(el))) {\n return false;\n }\n return !b.every((el) => a.includes(el)) ? false : true;\n};\n\n/**\n * Function to get array index by positive and negative wrap-around offsets\n *\n * @see https://dirask.com/posts/JavaScript-positive-and-negative-around-index-wrapping-overlapping-to-address-items-in-array-pVyrnD\n */\nexport const arraySafeIndex = <T>(array: T[], index: number): number => {\n const indexSize = array.length;\n\n return ((index % indexSize) + indexSize) % indexSize;\n};\n\nexport const arraySafeIndexFind = <T>(\n array: T[],\n index: number,\n): T | undefined => {\n const safeIndex = arraySafeIndex(array, index);\n\n return array[safeIndex];\n};\n\n/**\n * Normalise sort result to be in range of -1 to 1 so that we can easily combine multiple sorts\n */\nexport const normalizeSortResult = (sortResult: number): number =>\n clamp(sortResult, -1, 1);\n\n/**\n * Returns an array of keys from an interface where the value is true\n *\n * @example createArrayFromInterfaceKeys<{a: string, b: number, c: Date}>({ a: true, b: false, c: true }) => ['a', 'c']\n */\nexport function createArrayFromInterfaceKeys<T extends object>(\n keyRecord: Record<keyof T, boolean>,\n) {\n return Object.entries(keyRecord).reduce(\n (acc: (keyof T)[], [key, include]) => {\n if (include) {\n acc.push(key);\n }\n return acc;\n },\n [],\n );\n}\n"],"names":["ensureArray","value","Array","isArray","dedupe","arr","Set","areEqualArrays","a","b","length","every","el","includes","arraySafeIndex","array","index","indexSize","arraySafeIndexFind","safeIndex","normalizeSortResult","sortResult","clamp","createArrayFromInterfaceKeys","keyRecord","Object","entries","reduce","acc","key","include","push"],"mappings":";;;;AAMO,SAASA,YAAeC,KAAA,EAAqB;EAClD,OAAOC,MAAMC,OAAA,CAAQF,KAAK,CAAA,GAAIA,KAAA,GAAQ,CAACA,KAAK,CAAA;AAC9C;AAOO,MAAMG,MAAA,GAAaC,GAAA,IAAa,CAAC,GAAG,IAAIC,GAAA,CAAID,GAAG,CAAC,CAAA;AAShD,MAAME,cAAA,GAAiBA,CAACC,CAAA,EAAaC,CAAA,KAAyB;EACnE,IAAID,CAAA,CAAEE,MAAA,KAAWD,CAAA,CAAEC,MAAA,EAAQ;IACzB,OAAO,KAAA;EACT;EACA,IAAI,CAACF,EAAEG,KAAA,CAAOC,MAAOH,CAAA,CAAEI,QAAA,CAASD,EAAE,CAAC,CAAA,EAAG;IACpC,OAAO,KAAA;EACT;EACA,OAAO,CAACH,CAAA,CAAEE,KAAA,CAAOC,EAAA,IAAOJ,EAAEK,QAAA,CAASD,EAAE,CAAC,CAAA,GAAI,KAAA,GAAQ,IAAA;AACpD,CAAA;AAOO,MAAME,cAAA,GAAiBA,CAAIC,KAAA,EAAYC,KAAA,KAA0B;EACtE,MAAMC,YAAYF,KAAA,CAAML,MAAA;EAExB,OAAA,CAASM,KAAA,GAAQC,YAAaA,SAAA,IAAaA,SAAA;AAC7C,CAAA;AAEO,MAAMC,kBAAA,GAAqBA,CAChCH,KAAA,EACAC,KAAA,KACkB;EAClB,MAAMG,SAAA,GAAYL,cAAA,CAAeC,KAAA,EAAOC,KAAK,CAAA;EAE7C,OAAOD,MAAMI,SAAS,CAAA;AACxB,CAAA;AAKO,MAAMC,sBAAuBC,UAAA,IAClCC,MAAAA,CAAAA,KAAA,CAAMD,UAAA,EAAY,IAAI,CAAC,CAAA;AAOlB,SAASE,6BACdC,SAAA,EACA;EACA,OAAOC,MAAA,CAAOC,OAAA,CAAQF,SAAS,CAAA,CAAEG,MAAA,CAC/B,CAACC,GAAA,EAAkB,CAACC,GAAA,EAAKC,OAAO,CAAA,KAAM;IACpC,IAAIA,OAAA,EAAS;MACXF,GAAA,CAAIG,KAAKF,GAAG,CAAA;IACd;IACA,OAAOD,GAAA;EACT,CAAA,EACA,EAAC,CACH;AACF;;;;;;;"}
|
package/lib/utils/array.mjs
CHANGED
|
@@ -22,5 +22,13 @@ const arraySafeIndexFind = (array, index) => {
|
|
|
22
22
|
return array[safeIndex];
|
|
23
23
|
};
|
|
24
24
|
const normalizeSortResult = sortResult => clamp(sortResult, -1, 1);
|
|
25
|
-
|
|
25
|
+
function createArrayFromInterfaceKeys(keyRecord) {
|
|
26
|
+
return Object.entries(keyRecord).reduce((acc, [key, include]) => {
|
|
27
|
+
if (include) {
|
|
28
|
+
acc.push(key);
|
|
29
|
+
}
|
|
30
|
+
return acc;
|
|
31
|
+
}, []);
|
|
32
|
+
}
|
|
33
|
+
export { areEqualArrays, arraySafeIndex, arraySafeIndexFind, createArrayFromInterfaceKeys, dedupe, ensureArray, normalizeSortResult };
|
|
26
34
|
//# sourceMappingURL=array.mjs.map
|
package/lib/utils/array.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.mjs","sources":["../../src/utils/array.ts"],"sourcesContent":["import { clamp } from \"./number\";\n\n/**\n * Make sure the element is an array\n * If it's not, make it an array of one element\n */\nexport function ensureArray<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Utility to quickly remove duplicates from an array.\n *\n * Similar to lodash's `uniq`, but doesn't require lodash as dependency.\n */\nexport const dedupe = <T>(arr: T[]) => [...new Set(arr)];\n\n/**\n * Utility function check if given arrays contain same elements (regardless the order)\n *\n * @example\n * areArraysEqual([1, 2, 3], [3, 2, 1]) // true\n * areArraysEqual([1, 2, 3], [3, 2, 1, 4]) // false\n */\nexport const areEqualArrays = (a: string[], b: string[]): boolean => {\n if (a.length !== b.length) {\n return false;\n }\n if (!a.every((el) => b.includes(el))) {\n return false;\n }\n return !b.every((el) => a.includes(el)) ? false : true;\n};\n\n/**\n * Function to get array index by positive and negative wrap-around offsets\n *\n * @see https://dirask.com/posts/JavaScript-positive-and-negative-around-index-wrapping-overlapping-to-address-items-in-array-pVyrnD\n */\nexport const arraySafeIndex = <T>(array: T[], index: number): number => {\n const indexSize = array.length;\n\n return ((index % indexSize) + indexSize) % indexSize;\n};\n\nexport const arraySafeIndexFind = <T>(\n array: T[],\n index: number,\n): T | undefined => {\n const safeIndex = arraySafeIndex(array, index);\n\n return array[safeIndex];\n};\n\n/**\n * Normalise sort result to be in range of -1 to 1 so that we can easily combine multiple sorts\n */\nexport const normalizeSortResult = (sortResult: number): number =>\n clamp(sortResult, -1, 1);\n"],"names":["ensureArray","value","Array","isArray","dedupe","arr","Set","areEqualArrays","a","b","length","every","el","includes","arraySafeIndex","array","index","indexSize","arraySafeIndexFind","safeIndex","normalizeSortResult","sortResult","clamp"],"mappings":";;AAMO,SAASA,YAAeC,KAAA,EAAqB;EAClD,OAAOC,MAAMC,OAAA,CAAQF,KAAK,CAAA,GAAIA,KAAA,GAAQ,CAACA,KAAK,CAAA;AAC9C;AAOO,MAAMG,MAAA,GAAaC,GAAA,IAAa,CAAC,GAAG,IAAIC,GAAA,CAAID,GAAG,CAAC,CAAA;AAShD,MAAME,cAAA,GAAiBA,CAACC,CAAA,EAAaC,CAAA,KAAyB;EACnE,IAAID,CAAA,CAAEE,MAAA,KAAWD,CAAA,CAAEC,MAAA,EAAQ;IACzB,OAAO,KAAA;EACT;EACA,IAAI,CAACF,EAAEG,KAAA,CAAOC,MAAOH,CAAA,CAAEI,QAAA,CAASD,EAAE,CAAC,CAAA,EAAG;IACpC,OAAO,KAAA;EACT;EACA,OAAO,CAACH,CAAA,CAAEE,KAAA,CAAOC,EAAA,IAAOJ,EAAEK,QAAA,CAASD,EAAE,CAAC,CAAA,GAAI,KAAA,GAAQ,IAAA;AACpD,CAAA;AAOO,MAAME,cAAA,GAAiBA,CAAIC,KAAA,EAAYC,KAAA,KAA0B;EACtE,MAAMC,YAAYF,KAAA,CAAML,MAAA;EAExB,OAAA,CAASM,KAAA,GAAQC,YAAaA,SAAA,IAAaA,SAAA;AAC7C,CAAA;AAEO,MAAMC,kBAAA,GAAqBA,CAChCH,KAAA,EACAC,KAAA,KACkB;EAClB,MAAMG,SAAA,GAAYL,cAAA,CAAeC,KAAA,EAAOC,KAAK,CAAA;EAE7C,OAAOD,MAAMI,SAAS,CAAA;AACxB,CAAA;AAKO,MAAMC,sBAAuBC,UAAA,IAClCC,KAAA,CAAMD,UAAA,EAAY,IAAI,CAAC,CAAA;"}
|
|
1
|
+
{"version":3,"file":"array.mjs","sources":["../../src/utils/array.ts"],"sourcesContent":["import { clamp } from \"./number\";\n\n/**\n * Make sure the element is an array\n * If it's not, make it an array of one element\n */\nexport function ensureArray<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Utility to quickly remove duplicates from an array.\n *\n * Similar to lodash's `uniq`, but doesn't require lodash as dependency.\n */\nexport const dedupe = <T>(arr: T[]) => [...new Set(arr)];\n\n/**\n * Utility function check if given arrays contain same elements (regardless the order)\n *\n * @example\n * areArraysEqual([1, 2, 3], [3, 2, 1]) // true\n * areArraysEqual([1, 2, 3], [3, 2, 1, 4]) // false\n */\nexport const areEqualArrays = (a: string[], b: string[]): boolean => {\n if (a.length !== b.length) {\n return false;\n }\n if (!a.every((el) => b.includes(el))) {\n return false;\n }\n return !b.every((el) => a.includes(el)) ? false : true;\n};\n\n/**\n * Function to get array index by positive and negative wrap-around offsets\n *\n * @see https://dirask.com/posts/JavaScript-positive-and-negative-around-index-wrapping-overlapping-to-address-items-in-array-pVyrnD\n */\nexport const arraySafeIndex = <T>(array: T[], index: number): number => {\n const indexSize = array.length;\n\n return ((index % indexSize) + indexSize) % indexSize;\n};\n\nexport const arraySafeIndexFind = <T>(\n array: T[],\n index: number,\n): T | undefined => {\n const safeIndex = arraySafeIndex(array, index);\n\n return array[safeIndex];\n};\n\n/**\n * Normalise sort result to be in range of -1 to 1 so that we can easily combine multiple sorts\n */\nexport const normalizeSortResult = (sortResult: number): number =>\n clamp(sortResult, -1, 1);\n\n/**\n * Returns an array of keys from an interface where the value is true\n *\n * @example createArrayFromInterfaceKeys<{a: string, b: number, c: Date}>({ a: true, b: false, c: true }) => ['a', 'c']\n */\nexport function createArrayFromInterfaceKeys<T extends object>(\n keyRecord: Record<keyof T, boolean>,\n) {\n return Object.entries(keyRecord).reduce(\n (acc: (keyof T)[], [key, include]) => {\n if (include) {\n acc.push(key);\n }\n return acc;\n },\n [],\n );\n}\n"],"names":["ensureArray","value","Array","isArray","dedupe","arr","Set","areEqualArrays","a","b","length","every","el","includes","arraySafeIndex","array","index","indexSize","arraySafeIndexFind","safeIndex","normalizeSortResult","sortResult","clamp","createArrayFromInterfaceKeys","keyRecord","Object","entries","reduce","acc","key","include","push"],"mappings":";;AAMO,SAASA,YAAeC,KAAA,EAAqB;EAClD,OAAOC,MAAMC,OAAA,CAAQF,KAAK,CAAA,GAAIA,KAAA,GAAQ,CAACA,KAAK,CAAA;AAC9C;AAOO,MAAMG,MAAA,GAAaC,GAAA,IAAa,CAAC,GAAG,IAAIC,GAAA,CAAID,GAAG,CAAC,CAAA;AAShD,MAAME,cAAA,GAAiBA,CAACC,CAAA,EAAaC,CAAA,KAAyB;EACnE,IAAID,CAAA,CAAEE,MAAA,KAAWD,CAAA,CAAEC,MAAA,EAAQ;IACzB,OAAO,KAAA;EACT;EACA,IAAI,CAACF,EAAEG,KAAA,CAAOC,MAAOH,CAAA,CAAEI,QAAA,CAASD,EAAE,CAAC,CAAA,EAAG;IACpC,OAAO,KAAA;EACT;EACA,OAAO,CAACH,CAAA,CAAEE,KAAA,CAAOC,EAAA,IAAOJ,EAAEK,QAAA,CAASD,EAAE,CAAC,CAAA,GAAI,KAAA,GAAQ,IAAA;AACpD,CAAA;AAOO,MAAME,cAAA,GAAiBA,CAAIC,KAAA,EAAYC,KAAA,KAA0B;EACtE,MAAMC,YAAYF,KAAA,CAAML,MAAA;EAExB,OAAA,CAASM,KAAA,GAAQC,YAAaA,SAAA,IAAaA,SAAA;AAC7C,CAAA;AAEO,MAAMC,kBAAA,GAAqBA,CAChCH,KAAA,EACAC,KAAA,KACkB;EAClB,MAAMG,SAAA,GAAYL,cAAA,CAAeC,KAAA,EAAOC,KAAK,CAAA;EAE7C,OAAOD,MAAMI,SAAS,CAAA;AACxB,CAAA;AAKO,MAAMC,sBAAuBC,UAAA,IAClCC,KAAA,CAAMD,UAAA,EAAY,IAAI,CAAC,CAAA;AAOlB,SAASE,6BACdC,SAAA,EACA;EACA,OAAOC,MAAA,CAAOC,OAAA,CAAQF,SAAS,CAAA,CAAEG,MAAA,CAC/B,CAACC,GAAA,EAAkB,CAACC,GAAA,EAAKC,OAAO,CAAA,KAAM;IACpC,IAAIA,OAAA,EAAS;MACXF,GAAA,CAAIG,KAAKF,GAAG,CAAA;IACd;IACA,OAAOD,GAAA;EACT,CAAA,EACA,EAAC,CACH;AACF;"}
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -20,3 +20,6 @@ export * as styles from "./styles";
|
|
|
20
20
|
export * as storeId from "./storeId";
|
|
21
21
|
export * as blackFriday from "./blackFriday";
|
|
22
22
|
export * as sales from "./sales";
|
|
23
|
+
export * as keyMap from "./KeyMap";
|
|
24
|
+
export * as makeMap from "./makeMap";
|
|
25
|
+
export * as makeSet from "./makeSet";
|
package/lib/utils/index.js
CHANGED
|
@@ -22,6 +22,9 @@ var styles$1 = require('./styles.js');
|
|
|
22
22
|
var storeId$1 = require('./storeId.js');
|
|
23
23
|
var blackFriday$1 = require('./blackFriday.js');
|
|
24
24
|
var sales$1 = require('./sales.js');
|
|
25
|
+
var KeyMap = require('./KeyMap.js');
|
|
26
|
+
var makeMap$1 = require('./makeMap.js');
|
|
27
|
+
var makeSet$1 = require('./makeSet.js');
|
|
25
28
|
"use strict";
|
|
26
29
|
exports.url = url$1;
|
|
27
30
|
exports.money = index;
|
|
@@ -45,4 +48,7 @@ exports.styles = styles$1;
|
|
|
45
48
|
exports.storeId = storeId$1;
|
|
46
49
|
exports.blackFriday = blackFriday$1;
|
|
47
50
|
exports.sales = sales$1;
|
|
51
|
+
exports.keyMap = KeyMap;
|
|
52
|
+
exports.makeMap = makeMap$1;
|
|
53
|
+
exports.makeSet = makeSet$1;
|
|
48
54
|
//# sourceMappingURL=index.js.map
|
package/lib/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/utils/index.mjs
CHANGED
|
@@ -42,5 +42,11 @@ import * as blackFriday$1 from './blackFriday.mjs';
|
|
|
42
42
|
export { blackFriday$1 as blackFriday };
|
|
43
43
|
import * as sales$1 from './sales.mjs';
|
|
44
44
|
export { sales$1 as sales };
|
|
45
|
+
import * as KeyMap from './KeyMap.mjs';
|
|
46
|
+
export { KeyMap as keyMap };
|
|
47
|
+
import * as makeMap$1 from './makeMap.mjs';
|
|
48
|
+
export { makeMap$1 as makeMap };
|
|
49
|
+
import * as makeSet$1 from './makeSet.mjs';
|
|
50
|
+
export { makeSet$1 as makeSet };
|
|
45
51
|
"use strict";
|
|
46
52
|
//# sourceMappingURL=index.mjs.map
|
package/lib/utils/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a Map from a plain object.
|
|
3
|
+
*
|
|
4
|
+
* @url https://www.builder.io/blog/maps
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```
|
|
8
|
+
* const map = makeMap({a: 1, b: 2, c: 3})
|
|
9
|
+
* expect(map).toBe(new Map([["a", 1], ["b", 2], ["c", 3]]))
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare const makeMap: <V = unknown>(obj: Record<string, V>) => Map<string, V>;
|
|
13
|
+
/**
|
|
14
|
+
* Converts an array of objects to a Map of arrays, using a specified key from each
|
|
15
|
+
* object as the Map key. Multiple objects with the same key value will be grouped together.
|
|
16
|
+
*
|
|
17
|
+
* @param array - The array of objects to convert
|
|
18
|
+
* @param keyField - The field name to use as the Map key (must be a key of T)
|
|
19
|
+
* @returns A Map where keys are the values of the specified field and values
|
|
20
|
+
* are arrays of the original objects that share that key
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```
|
|
24
|
+
* const map = makeMapCollectionBy([{key: "a", val: 1}, {key: "a", val: 2}, {key: "c", val: 3}], "key")
|
|
25
|
+
* expect(map).toBe(new Map([["a", [{key: "a", val: 1}, {key: "a", val: 2}]], ["c", [{key: "c", val: 3}]]]))
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function makeMapCollectionBy<T, K extends keyof T>(array: T[], keyField: K): Map<T[K], T[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Converts an array of objects to a Map, using a specified key from each
|
|
31
|
+
* object as the Map key.
|
|
32
|
+
*
|
|
33
|
+
* @param array - The array of objects to convert
|
|
34
|
+
* @param keyField - The field name to use as the Map key (must be a key of T)
|
|
35
|
+
* @returns A Map where keys are the values of the specified field and values
|
|
36
|
+
* are the original objects
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```
|
|
40
|
+
* const map = makeMapBy([{key: "a", val: 1}, {key: "b", val: 2}, {key: "c", val: 3}], "key")
|
|
41
|
+
* expect(map).toBe(new Map([["a", {key: "a", val: 1}], ["b", {key: "b", val: 2}], ["c", {key: "c", val: 3}]]))
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function makeMapBy<T, K extends keyof T>(array: T[], keyField: K): Map<T[K], T>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const makeMap = obj => new Map(Object.entries(obj));
|
|
5
|
+
function makeMapCollectionBy(array, keyField) {
|
|
6
|
+
const map = /* @__PURE__ */new Map();
|
|
7
|
+
for (const item of array) {
|
|
8
|
+
const key = item[keyField];
|
|
9
|
+
const existing = map.get(key);
|
|
10
|
+
if (existing) {
|
|
11
|
+
existing.push(item);
|
|
12
|
+
} else {
|
|
13
|
+
map.set(key, [item]);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return map;
|
|
17
|
+
}
|
|
18
|
+
function makeMapBy(array, keyField) {
|
|
19
|
+
const map = /* @__PURE__ */new Map();
|
|
20
|
+
for (const item of array) {
|
|
21
|
+
map.set(item[keyField], item);
|
|
22
|
+
}
|
|
23
|
+
return map;
|
|
24
|
+
}
|
|
25
|
+
exports.makeMap = makeMap;
|
|
26
|
+
exports.makeMapBy = makeMapBy;
|
|
27
|
+
exports.makeMapCollectionBy = makeMapCollectionBy;
|
|
28
|
+
//# sourceMappingURL=makeMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"makeMap.js","sources":["../../src/utils/makeMap.ts"],"sourcesContent":["/**\n * Creates a Map from a plain object.\n *\n * @url https://www.builder.io/blog/maps\n *\n * @example\n * ```\n * const map = makeMap({a: 1, b: 2, c: 3})\n * expect(map).toBe(new Map([[\"a\", 1], [\"b\", 2], [\"c\", 3]]))\n * ```\n */\nexport const makeMap = <V = unknown>(obj: Record<string, V>) =>\n new Map<string, V>(Object.entries(obj));\n\n/**\n * Converts an array of objects to a Map of arrays, using a specified key from each\n * object as the Map key. Multiple objects with the same key value will be grouped together.\n *\n * @param array - The array of objects to convert\n * @param keyField - The field name to use as the Map key (must be a key of T)\n * @returns A Map where keys are the values of the specified field and values\n * are arrays of the original objects that share that key\n *\n * @example\n * ```\n * const map = makeMapCollectionBy([{key: \"a\", val: 1}, {key: \"a\", val: 2}, {key: \"c\", val: 3}], \"key\")\n * expect(map).toBe(new Map([[\"a\", [{key: \"a\", val: 1}, {key: \"a\", val: 2}]], [\"c\", [{key: \"c\", val: 3}]]]))\n * ```\n */\nexport function makeMapCollectionBy<T, K extends keyof T>(\n array: T[],\n keyField: K,\n): Map<T[K], T[]> {\n const map = new Map<T[K], T[]>();\n\n for (const item of array) {\n const key = item[keyField];\n const existing = map.get(key);\n\n if (existing) {\n existing.push(item);\n } else {\n map.set(key, [item]);\n }\n }\n\n return map;\n}\n\n/**\n * Converts an array of objects to a Map, using a specified key from each\n * object as the Map key.\n *\n * @param array - The array of objects to convert\n * @param keyField - The field name to use as the Map key (must be a key of T)\n * @returns A Map where keys are the values of the specified field and values\n * are the original objects\n *\n * @example\n * ```\n * const map = makeMapBy([{key: \"a\", val: 1}, {key: \"b\", val: 2}, {key: \"c\", val: 3}], \"key\")\n * expect(map).toBe(new Map([[\"a\", {key: \"a\", val: 1}], [\"b\", {key: \"b\", val: 2}], [\"c\", {key: \"c\", val: 3}]]))\n * ```\n */\nexport function makeMapBy<T, K extends keyof T>(\n array: T[],\n keyField: K,\n): Map<T[K], T> {\n const map = new Map<T[K], T>();\n\n for (const item of array) {\n map.set(item[keyField], item);\n }\n\n return map;\n}\n"],"names":["makeMap","obj","Map","Object","entries","makeMapCollectionBy","array","keyField","map","item","key","existing","get","push","set","makeMapBy"],"mappings":";;;AAWO,MAAMA,OAAA,GAAwBC,GAAA,IACnC,IAAIC,IAAeC,MAAA,CAAOC,OAAA,CAAQH,GAAG,CAAC,CAAA;AAiBjC,SAASI,mBAAAA,CACdC,OACAC,QAAA,EACgB;EAChB,MAAMC,GAAA,GAAA,mBAAUN,GAAA,CAAA,CAAe;EAE/B,KAAA,MAAWO,QAAQH,KAAA,EAAO;IACxB,MAAMI,GAAA,GAAMD,KAAKF,QAAQ,CAAA;IACzB,MAAMI,QAAA,GAAWH,GAAA,CAAII,GAAA,CAAIF,GAAG,CAAA;IAE5B,IAAIC,QAAA,EAAU;MACZA,QAAA,CAASE,KAAKJ,IAAI,CAAA;IACpB,CAAA,MAAO;MACLD,GAAA,CAAIM,GAAA,CAAIJ,GAAA,EAAK,CAACD,IAAI,CAAC,CAAA;IACrB;EACF;EAEA,OAAOD,GAAA;AACT;AAiBO,SAASO,SAAAA,CACdT,OACAC,QAAA,EACc;EACd,MAAMC,GAAA,GAAA,mBAAUN,GAAA,CAAA,CAAa;EAE7B,KAAA,MAAWO,QAAQH,KAAA,EAAO;IACxBE,GAAA,CAAIM,GAAA,CAAIL,IAAA,CAAKF,QAAQ,CAAA,EAAGE,IAAI,CAAA;EAC9B;EAEA,OAAOD,GAAA;AACT;;;"}
|