decocms 2.299.0 → 2.300.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-aQgTv3kr.js → AlertCircle-CtSiN7Dh.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-C_pLc5t-.js → ArrowNarrowLeft-CjMD5YtT.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-Bws5ir-q.js → ArrowUpRight-VGEco3p8.js} +1 -1
- package/dist/client/assets/{CheckCircle-Cwc7BvQq.js → CheckCircle-BOjQcSoZ.js} +1 -1
- package/dist/client/assets/{ChevronDown-C4MI00HX.js → ChevronDown-B21GyFLP.js} +1 -1
- package/dist/client/assets/{ChevronRight-DDkghuaf.js → ChevronRight-C7fFXCXU.js} +1 -1
- package/dist/client/assets/{ChevronUp-BjFGxYUb.js → ChevronUp-DLJe-Ifh.js} +1 -1
- package/dist/client/assets/{Container-U4v06cth.js → Container-DVwtR0PY.js} +1 -1
- package/dist/client/assets/{DotsVertical-BCK2nFhn.js → DotsVertical-_1yE4PFi.js} +1 -1
- package/dist/client/assets/{LinkExternal01-C_yQygSO.js → LinkExternal01-BeNjIA73.js} +1 -1
- package/dist/client/assets/{Lock01-rLvN1xbd.js → Lock01-y9D26Lk9.js} +1 -1
- package/dist/client/assets/{Palette-CA95sDHj.js → Palette-xIvgAE_U.js} +1 -1
- package/dist/client/assets/{Play-BlOman6C.js → Play-esUCyQh5.js} +1 -1
- package/dist/client/assets/{Plus-B5soxpbi.js → Plus-8zlfW9Nb.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-onzNEsM4.js → RefreshCcw01-DV-_PfmV.js} +1 -1
- package/dist/client/assets/{SearchMd-fvAW1pa8.js → SearchMd-BgpZuBQH.js} +1 -1
- package/dist/client/assets/{Settings02-Cro6-7q4.js → Settings02-B2DHZxlV.js} +1 -1
- package/dist/client/assets/{Shield01-DtWtqZJ1.js → Shield01-CewVSi37.js} +1 -1
- package/dist/client/assets/{Star01-BHGJRtit.js → Star01-DupDdRAe.js} +1 -1
- package/dist/client/assets/{Sun-C6J9iUe_.js → Sun-B1MYWGMj.js} +1 -1
- package/dist/client/assets/{Tool01-DeRpug6W.js → Tool01-73PH4njb.js} +1 -1
- package/dist/client/assets/{Trash01-BSFNbfe8.js → Trash01-_-2EAUWH.js} +1 -1
- package/dist/client/assets/{User01-C-8Fo7RS.js → User01-DLnrd0WJ.js} +1 -1
- package/dist/client/assets/{Users03-C25Ink_E.js → Users03-CtQ_adLe.js} +1 -1
- package/dist/client/assets/{X-Cf3FFZEE.js → X-DavTUkoo.js} +1 -1
- package/dist/client/assets/{XCircle-CLM44_6-.js → XCircle-BKeTm8Ww.js} +1 -1
- package/dist/client/assets/{XClose-B9H_q-Ab.js → XClose-BpjQA_dF.js} +1 -1
- package/dist/client/assets/{Zap-BQvzqOLx.js → Zap-DT_tBFfJ.js} +1 -1
- package/dist/client/assets/{ZapSquare-CjSpwpWX.js → ZapSquare-BL-_ZEqM.js} +1 -1
- package/dist/client/assets/{accordion-YUzrCziW.js → accordion-pRq2Jalt.js} +1 -1
- package/dist/client/assets/{agent-icon-CyFFhaia.js → agent-icon-DnE1m294.js} +1 -1
- package/dist/client/assets/{agents-list-W7eiHZAH.js → agents-list-BoAFCp78.js} +1 -1
- package/dist/client/assets/ai-providers-CAEYBEbx.js +1 -0
- package/dist/client/assets/{alert-dialog-BRriT9Rx.js → alert-dialog-DvcLf48w.js} +1 -1
- package/dist/client/assets/{auth-catchall-dvNJT_HW.js → auth-catchall-CAJD1PoQ.js} +1 -1
- package/dist/client/assets/{automation-list-row-Dr5BqZcR.js → automation-list-row-DsEcFwqj.js} +1 -1
- package/dist/client/assets/{automations-DThDEBhK.js → automations-0IJqtFMr.js} +1 -1
- package/dist/client/assets/{avatar-DZ7Lcia3.js → avatar-B1YFr91G.js} +1 -1
- package/dist/client/assets/{badge-CNKFpwCQ.js → badge-BnwDLyJj.js} +1 -1
- package/dist/client/assets/{brand-context-FHNmQTmw.js → brand-context-D5_IL-aX.js} +1 -1
- package/dist/client/assets/{card-DVXldwSE.js → card-Hve9iIpZ.js} +1 -1
- package/dist/client/assets/{chat-context-clHOazkR.js → chat-context-C2vjARhO.js} +1 -1
- package/dist/client/assets/{checkbox-EVw79nds.js → checkbox-DmWLCJJH.js} +1 -1
- package/dist/client/assets/{collection-detail-C13v-yoJ.js → collection-detail-D8wvqyeL.js} +1 -1
- package/dist/client/assets/{collection-display-button-BM4OZbbR.js → collection-display-button-CQ2KlZSu.js} +1 -1
- package/dist/client/assets/{collection-search-DoSMDd39.js → collection-search-D_mJKf_N.js} +1 -1
- package/dist/client/assets/{collection-search-DjqZM35U.js → collection-search-DffILLk0.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-jyvgWmq5.js → collection-table-wrapper-fO254CQy.js} +1 -1
- package/dist/client/assets/{collection-tabs-Nu6UZ0Wa.js → collection-tabs-Bcs-_tfj.js} +1 -1
- package/dist/client/assets/{collections-_TpL4Kbd.js → collections-CISD8jzc.js} +1 -1
- package/dist/client/assets/{command-BGK9JNiv.js → command-CsVFknP_.js} +1 -1
- package/dist/client/assets/{connection-card-h503T7yE.js → connection-card-aTu5Xl4N.js} +1 -1
- package/dist/client/assets/{connection-detail-E3ZTKIWY.js → connection-detail-BUr0xwe0.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-B5DiwUxU.js → connection-form-helpers-BEHWki2e.js} +1 -1
- package/dist/client/assets/{connections-Ba8EED2x.js → connections-BJwQ4V76.js} +1 -1
- package/dist/client/assets/{constants-lTcLVS5n.js → constants-BwurOShK.js} +1 -1
- package/dist/client/assets/{constants-CiJRSGoE.js → constants-DZ5y4NEu.js} +1 -1
- package/dist/client/assets/{dialog-BRB-AdlQ.js → dialog-BSlhJimL.js} +1 -1
- package/dist/client/assets/{domain-settings-vcc_x35P.js → domain-settings-D65HSgmV.js} +1 -1
- package/dist/client/assets/{drawer-rKfRlJNC.js → drawer-DwurUbp0.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DaYjsctt.js → dropdown-menu-Dn3K1Gpo.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Bs-dtzIc.js → dynamic-plugin-layout-uzPcJgAD.js} +1 -1
- package/dist/client/assets/{empty-state-DpWDEkDd.js → empty-state-B4R6bbr3.js} +1 -1
- package/dist/client/assets/{empty-state-DLaWKneQ.js → empty-state-DbgILpoj.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DIDviCIp.js → extract-connection-data-Bp5NDOhQ.js} +1 -1
- package/dist/client/assets/{features-CE8oBb9H.js → features-MuQDQTKd.js} +1 -1
- package/dist/client/assets/{form-mI6GLCMQ.js → form-DTt4fIHo.js} +1 -1
- package/dist/client/assets/{general-27HuvgYf.js → general-C7YvzevF.js} +1 -1
- package/dist/client/assets/index-B4J1yAvl.css +1 -0
- package/dist/client/assets/{index-Ccm19Owr.js → index-BJz9Oj-t.js} +1 -1
- package/dist/client/assets/{index-B11-oLok.js → index-BTM4S0x-.js} +1 -1
- package/dist/client/assets/{index-D8ZWoKb1.js → index-BZwRn_mX.js} +1 -1
- package/dist/client/assets/index-CKNbLfs9.js +1 -0
- package/dist/client/assets/{index-cC9WxUf7.js → index-COQkJrV6.js} +1 -1
- package/dist/client/assets/{index-BdrUauLh.js → index-CbEM9IOV.js} +1 -1
- package/dist/client/assets/{index-oMBghIJJ.js → index-D1LVHcIe.js} +1 -1
- package/dist/client/assets/{index-BLqORW7O.js → index-D9wcQMm5.js} +1 -1
- package/dist/client/assets/{index-WenLlWbb.js → index-DBY00Q2Z.js} +19 -19
- package/dist/client/assets/{index-C4eEdhdn.js → index-DHKldY3y.js} +1 -1
- package/dist/client/assets/{index-hcEg81hB.js → index-DRnP8Xhy.js} +10 -10
- package/dist/client/assets/{index-CHiZkXhm.js → index-Day-HjXR.js} +1 -1
- package/dist/client/assets/{index-CD-vU91r.js → index-XlHohbXo.js} +1 -1
- package/dist/client/assets/{index-DHZDsons.js → index-h0Ny6VA2.js} +1 -1
- package/dist/client/assets/{index-B3FEpuQw.js → index-uTtq-reU.js} +1 -1
- package/dist/client/assets/{index-B3zZp_Qu.js → index-ygN6PiaU.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DkM0VxlF.js → infiniteQueryObserver-BFZ15R1_.js} +1 -1
- package/dist/client/assets/{input-Cuud93wX.js → input-liZY-axz.js} +1 -1
- package/dist/client/assets/{integration-icon-CsrRg2Lu.js → integration-icon-Cz-seBmA.js} +1 -1
- package/dist/client/assets/{label-Bk3DQN0Y.js → label-CrXFAdsO.js} +1 -1
- package/dist/client/assets/{layout-BtQea4Qg.js → layout-bMTJXFfz.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-CbbipZjJ.js → lean-canvas-recruit-modal-DZ6knxg9.js} +1 -1
- package/dist/client/assets/{login-BgZ8a57W.js → login-CWW3hrOg.js} +1 -1
- package/dist/client/assets/{members-BrEtD2C0.js → members-DKWnDmHd.js} +1 -1
- package/dist/client/assets/{monaco-editor-B5h0xAd0.js → monaco-editor-Cx68yuxi.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-FmuYstq7.js → monitoring-stats-row-BFqk7UYd.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-D2JxS3R_.js → oauth-callback-ai-provider-ONRq40Il.js} +1 -1
- package/dist/client/assets/{oauth-callback-BOHYAMsk.js → oauth-callback-nz50ugwL.js} +1 -1
- package/dist/client/assets/{onboarding-Dls-YBag.js → onboarding-CbZyKtbC.js} +1 -1
- package/dist/client/assets/{org-layout-B0WpG86a.js → org-layout-DkS2FRIV.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-fSkxW1jN.js → org-plugin-layout-DnoycXXu.js} +1 -1
- package/dist/client/assets/{pair-CqYfP4a_.js → pair-rqe3skqp.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-C3M4-bHq.js → plugin-empty-state-DAJtqa_X.js} +1 -1
- package/dist/client/assets/{plugin-header-Bhl8FTKN.js → plugin-header-DnTysGuR.js} +1 -1
- package/dist/client/assets/{plugin-layout-DOuAk8f9.js → plugin-layout-Zl5kAJLg.js} +1 -1
- package/dist/client/assets/{popover-BWawolwL.js → popover-B6ijC2Zf.js} +1 -1
- package/dist/client/assets/{profile-DKggoElb.js → profile-Wj3GJkbr.js} +1 -1
- package/dist/client/assets/{project-app-view-BTqqbkYN.js → project-app-view-DufFnF1s.js} +1 -1
- package/dist/client/assets/registry-D49ZAHvu.js +2 -0
- package/dist/client/assets/{registry-layout-Bcb0ETu2.js → registry-layout-BvfKYFzg.js} +1 -1
- package/dist/client/assets/{required-auth-layout-B0aP_BYa.js → required-auth-layout-CKQlCfyf.js} +1 -1
- package/dist/client/assets/{reset-password-DAQu9CHm.js → reset-password-4dmtvYgx.js} +1 -1
- package/dist/client/assets/{roles-CV8Id8qK.js → roles-DlsIbipv.js} +1 -1
- package/dist/client/assets/{scroll-area-0g8Z_dWS.js → scroll-area-D_0eTXQI.js} +1 -1
- package/dist/client/assets/{search-input-jyuCy7Ai.js → search-input-CbBz2_I7.js} +1 -1
- package/dist/client/assets/{select-hpzuL2n7.js → select-DwQCWni4.js} +1 -1
- package/dist/client/assets/{select-model-CtHOnPsy.js → select-model-CSzGroxj.js} +1 -1
- package/dist/client/assets/{settings-layout-ClllTp0r.js → settings-layout-D2TzHadG.js} +1 -1
- package/dist/client/assets/{settings-section-DTpTGGC-.js → settings-section-CVNbjkC4.js} +1 -1
- package/dist/client/assets/{shell-layout-B405kN5F.js → shell-layout-BK74oWLU.js} +1 -1
- package/dist/client/assets/{skeleton-B9GboYxM.js → skeleton-DnMJGIDK.js} +1 -1
- package/dist/client/assets/{sso-Dh1NgG1u.js → sso-ByZblLmU.js} +1 -1
- package/dist/client/assets/{store-2uy2qIUV.js → store-D02KrT4m.js} +1 -1
- package/dist/client/assets/store-registry-C02mfQOQ.js +2 -0
- package/dist/client/assets/{switch-CD5xHhwa.js → switch-BwYbkaPM.js} +1 -1
- package/dist/client/assets/{table-Bl-CW2Ey.js → table-dOL69UsN.js} +1 -1
- package/dist/client/assets/{tabs-8bRAvOFB.js → tabs-CGg7lV45.js} +1 -1
- package/dist/client/assets/{task-status-Df19deFg.js → task-status-DAgh3LfT.js} +1 -1
- package/dist/client/assets/{textarea-0ebJKTCS.js → textarea-CkxfQbxI.js} +1 -1
- package/dist/client/assets/{toggle-group-BqrVPEZw.js → toggle-group-C5VhmQig.js} +1 -1
- package/dist/client/assets/{tools-list-1YgWwNhM.js → tools-list-CwM3RxlF.js} +1 -1
- package/dist/client/assets/{tooltip-CGmvkTM6.js → tooltip-CUw8WpYG.js} +1 -1
- package/dist/client/assets/{types-CN-G9hqy.js → types-slR7lXH6.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BtZzelvz.js → use-ai-providers-DespFg1Y.js} +1 -1
- package/dist/client/assets/{use-collections-DjbmBbmU.js → use-collections-CDG0ivO9.js} +1 -1
- package/dist/client/assets/{use-connection-CffI5S47.js → use-connection-DDedfw7l.js} +1 -1
- package/dist/client/assets/{use-copy-DNx2iDfI.js → use-copy-Czy0YFNn.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BFp1mbc9.js → use-create-virtual-mcp-Bhi93QNY.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-D5TlUkky.js → use-decopilot-events-DkzJQYGR.js} +1 -1
- package/dist/client/assets/{use-delete-connection-O5X9Xo4O.js → use-delete-connection-CG2J3Cjn.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-FZg8WuOv.js → use-infinite-scroll-qjXoMT8U.js} +1 -1
- package/dist/client/assets/{use-list-state-CbWjR069.js → use-list-state-D2VmPCpI.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CxZifaYv.js → use-mcp-tools-nd8RTEJZ.js} +1 -1
- package/dist/client/assets/{use-members-CXQMD9Vu.js → use-members-BWz4qY4v.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C0C5E43c.js → use-navigate-to-agent-Dj0boPYr.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Dy4G77my.js → use-org-auth-client-_7iLBAbg.js} +1 -1
- package/dist/client/assets/{use-org-sso-Drj77Zm1.js → use-org-sso-CXTYwYuw.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DmSBxwGY.js → use-organization-roles-BmJJrwum.js} +1 -1
- package/dist/client/assets/{use-organization-settings--1KNcya1.js → use-organization-settings-C516uAxZ.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BaBm7Ii1.js → use-registry-connections-BH65PVKK.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BDL4IJ6A.js → use-status-sounds-COJng9ez.js} +1 -1
- package/dist/client/assets/{use-tasks-DF42FEXc.js → use-tasks-BMtiaufW.js} +1 -1
- package/dist/client/assets/{use-view-mode-CBcjjJZG.js → use-view-mode-B3HPjSsa.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CTmQF3FY.js → use-virtual-mcp-Dkco3wCF.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-mbgOLEDd.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DZGLPMRe.js +1 -0
- package/dist/client/assets/{user-DNhBNgsY.js → user-BCVAIUhB.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-KbDgQNkg.js → view-mode-toggle-Bbj9P-zr.js} +1 -1
- package/dist/client/assets/{workflow-DZzf5GRI.js → workflow-DZKRFLJh.js} +1 -1
- package/dist/client/assets/workflow-detail-Bm0PdrL9.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +3 -3
- package/dist/server/node_modules/ansi-regex/index.d.ts +33 -0
- package/dist/server/node_modules/ansi-regex/index.js +14 -0
- package/dist/server/node_modules/{ansi-styles → ansi-regex}/package.json +20 -13
- package/dist/server/node_modules/ansi-regex/readme.md +66 -0
- package/dist/server/node_modules/mimic-fn/index.d.ts +54 -0
- package/dist/server/node_modules/mimic-fn/index.js +13 -0
- package/dist/server/node_modules/mimic-fn/package.json +42 -0
- package/dist/server/node_modules/mimic-fn/readme.md +69 -0
- package/dist/server/node_modules/pg-int8/LICENSE +13 -0
- package/dist/server/node_modules/pg-int8/README.md +16 -0
- package/dist/server/node_modules/pg-int8/index.js +100 -0
- package/dist/server/node_modules/pg-int8/package.json +24 -0
- package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
- package/dist/server/node_modules/postgres-array/index.js +97 -0
- package/dist/server/node_modules/postgres-array/license +21 -0
- package/dist/server/node_modules/postgres-array/package.json +35 -0
- package/dist/server/node_modules/postgres-array/readme.md +43 -0
- package/dist/server/node_modules/postgres-bytea/index.js +33 -0
- package/dist/server/node_modules/postgres-bytea/license +21 -0
- package/dist/server/node_modules/postgres-bytea/package.json +34 -0
- package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
- package/dist/server/node_modules/postgres-date/index.js +116 -0
- package/dist/server/node_modules/postgres-date/license +21 -0
- package/dist/server/node_modules/postgres-date/package.json +33 -0
- package/dist/server/node_modules/postgres-date/readme.md +49 -0
- package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
- package/dist/server/node_modules/postgres-interval/index.js +125 -0
- package/dist/server/node_modules/postgres-interval/license +21 -0
- package/dist/server/node_modules/postgres-interval/package.json +36 -0
- package/dist/server/node_modules/postgres-interval/readme.md +48 -0
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-D112U5ed.js +0 -1
- package/dist/client/assets/index-CLgHTXwu.js +0 -1
- package/dist/client/assets/index-DT63_YMm.css +0 -1
- package/dist/client/assets/registry-BOvZQpcE.js +0 -2
- package/dist/client/assets/store-registry-LkT6leWD.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BugVQNDu.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CMPA3kQv.js +0 -1
- package/dist/client/assets/workflow-detail-OXlDN5sZ.js +0 -1
- package/dist/server/node_modules/ansi-styles/index.d.ts +0 -236
- package/dist/server/node_modules/ansi-styles/index.js +0 -223
- package/dist/server/node_modules/ansi-styles/readme.md +0 -173
- package/dist/server/node_modules/environment/index.d.ts +0 -74
- package/dist/server/node_modules/environment/index.js +0 -47
- package/dist/server/node_modules/environment/license +0 -9
- package/dist/server/node_modules/environment/package.json +0 -74
- package/dist/server/node_modules/environment/readme.md +0 -94
- package/dist/server/node_modules/escape-string-regexp/index.d.ts +0 -18
- package/dist/server/node_modules/escape-string-regexp/index.js +0 -11
- package/dist/server/node_modules/escape-string-regexp/package.json +0 -43
- package/dist/server/node_modules/escape-string-regexp/readme.md +0 -29
- package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
- package/dist/server/node_modules/is-fullwidth-code-point/index.js +0 -12
- package/dist/server/node_modules/is-fullwidth-code-point/license +0 -9
- package/dist/server/node_modules/is-fullwidth-code-point/package.json +0 -53
- package/dist/server/node_modules/is-fullwidth-code-point/readme.md +0 -31
- package/dist/server/node_modules/string-width/index.d.ts +0 -39
- package/dist/server/node_modules/string-width/index.js +0 -82
- package/dist/server/node_modules/string-width/license +0 -9
- package/dist/server/node_modules/string-width/package.json +0 -64
- package/dist/server/node_modules/string-width/readme.md +0 -66
- /package/dist/server/node_modules/{ansi-styles → ansi-regex}/license +0 -0
- /package/dist/server/node_modules/{escape-string-regexp → mimic-fn}/license +0 -0
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/* globals WorkerGlobalScope, DedicatedWorkerGlobalScope, SharedWorkerGlobalScope, ServiceWorkerGlobalScope */
|
|
2
|
-
|
|
3
|
-
export const isBrowser = globalThis.window?.document !== undefined;
|
|
4
|
-
|
|
5
|
-
export const isNode = globalThis.process?.versions?.node !== undefined;
|
|
6
|
-
|
|
7
|
-
export const isBun = globalThis.process?.versions?.bun !== undefined;
|
|
8
|
-
|
|
9
|
-
export const isDeno = globalThis.Deno?.version?.deno !== undefined;
|
|
10
|
-
|
|
11
|
-
export const isElectron = globalThis.process?.versions?.electron !== undefined;
|
|
12
|
-
|
|
13
|
-
export const isJsDom = globalThis.navigator?.userAgent?.includes('jsdom') === true;
|
|
14
|
-
|
|
15
|
-
export const isWebWorker = typeof WorkerGlobalScope !== 'undefined' && globalThis instanceof WorkerGlobalScope;
|
|
16
|
-
|
|
17
|
-
export const isDedicatedWorker = typeof DedicatedWorkerGlobalScope !== 'undefined' && globalThis instanceof DedicatedWorkerGlobalScope;
|
|
18
|
-
|
|
19
|
-
export const isSharedWorker = typeof SharedWorkerGlobalScope !== 'undefined' && globalThis instanceof SharedWorkerGlobalScope;
|
|
20
|
-
|
|
21
|
-
export const isServiceWorker = typeof ServiceWorkerGlobalScope !== 'undefined' && globalThis instanceof ServiceWorkerGlobalScope;
|
|
22
|
-
|
|
23
|
-
// Note: I'm intentionally not DRYing up the other variables to keep them "lazy".
|
|
24
|
-
const platform = globalThis.navigator?.userAgentData?.platform;
|
|
25
|
-
|
|
26
|
-
export const isMacOs = platform === 'macOS'
|
|
27
|
-
|| globalThis.navigator?.platform === 'MacIntel' // Even on Apple silicon Macs.
|
|
28
|
-
|| globalThis.navigator?.userAgent?.includes(' Mac ') === true
|
|
29
|
-
|| globalThis.process?.platform === 'darwin';
|
|
30
|
-
|
|
31
|
-
export const isWindows = platform === 'Windows'
|
|
32
|
-
|| globalThis.navigator?.platform === 'Win32'
|
|
33
|
-
|| globalThis.process?.platform === 'win32';
|
|
34
|
-
|
|
35
|
-
export const isLinux = platform === 'Linux'
|
|
36
|
-
|| globalThis.navigator?.platform?.startsWith('Linux') === true
|
|
37
|
-
|| globalThis.navigator?.userAgent?.includes(' Linux ') === true
|
|
38
|
-
|| globalThis.process?.platform === 'linux';
|
|
39
|
-
|
|
40
|
-
export const isIos = platform === 'iOS'
|
|
41
|
-
|| (globalThis.navigator?.platform === 'MacIntel' && globalThis.navigator?.maxTouchPoints > 1)
|
|
42
|
-
|| /iPad|iPhone|iPod/.test(globalThis.navigator?.platform);
|
|
43
|
-
|
|
44
|
-
export const isAndroid = platform === 'Android'
|
|
45
|
-
|| globalThis.navigator?.platform === 'Android'
|
|
46
|
-
|| globalThis.navigator?.userAgent?.includes(' Android ') === true
|
|
47
|
-
|| globalThis.process?.platform === 'android';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "environment",
|
|
3
|
-
"version": "1.1.0",
|
|
4
|
-
"description": "Check which JavaScript environment your code is running in at runtime: browser, Node.js, Bun, etc",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "sindresorhus/environment",
|
|
7
|
-
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Sindre Sorhus",
|
|
10
|
-
"email": "sindresorhus@gmail.com",
|
|
11
|
-
"url": "https://sindresorhus.com"
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"exports": {
|
|
15
|
-
"types": "./index.d.ts",
|
|
16
|
-
"default": "./index.js"
|
|
17
|
-
},
|
|
18
|
-
"sideEffects": false,
|
|
19
|
-
"engines": {
|
|
20
|
-
"node": ">=18"
|
|
21
|
-
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"test": "xo && ava && tsc index.d.ts"
|
|
24
|
-
},
|
|
25
|
-
"files": [
|
|
26
|
-
"index.js",
|
|
27
|
-
"index.d.ts"
|
|
28
|
-
],
|
|
29
|
-
"keywords": [
|
|
30
|
-
"runtime",
|
|
31
|
-
"environment",
|
|
32
|
-
"env",
|
|
33
|
-
"execution",
|
|
34
|
-
"engine",
|
|
35
|
-
"platform",
|
|
36
|
-
"context",
|
|
37
|
-
"js",
|
|
38
|
-
"javascript",
|
|
39
|
-
"is",
|
|
40
|
-
"check",
|
|
41
|
-
"checking",
|
|
42
|
-
"detect",
|
|
43
|
-
"detection",
|
|
44
|
-
"browser",
|
|
45
|
-
"node",
|
|
46
|
-
"bun",
|
|
47
|
-
"deno",
|
|
48
|
-
"electron",
|
|
49
|
-
"jsdom",
|
|
50
|
-
"webworker",
|
|
51
|
-
"worker",
|
|
52
|
-
"serviceworker",
|
|
53
|
-
"macos",
|
|
54
|
-
"ios",
|
|
55
|
-
"iphone",
|
|
56
|
-
"ipad",
|
|
57
|
-
"windows",
|
|
58
|
-
"linux",
|
|
59
|
-
"android",
|
|
60
|
-
"os",
|
|
61
|
-
"operating",
|
|
62
|
-
"system"
|
|
63
|
-
],
|
|
64
|
-
"devDependencies": {
|
|
65
|
-
"ava": "^6.1.3",
|
|
66
|
-
"typescript": "^5.4.5",
|
|
67
|
-
"xo": "^0.58.0"
|
|
68
|
-
},
|
|
69
|
-
"xo": {
|
|
70
|
-
"rules": {
|
|
71
|
-
"n/prefer-global/process": "off"
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
# environment
|
|
2
|
-
|
|
3
|
-
> Check which JavaScript environment your code is running in at runtime
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
npm install environment
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
import {isBrowser, isNode} from 'environment';
|
|
15
|
-
|
|
16
|
-
if (isBrowser) {
|
|
17
|
-
console.log('Running in a browser!');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (isNode) {
|
|
21
|
-
console.log('Running in Node.js!');
|
|
22
|
-
}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
> [!NOTE]
|
|
26
|
-
> Runtime checks should be used sparingly. Prefer [conditional package exports](https://nodejs.org/api/packages.html#conditional-exports) and [imports](https://nodejs.org/api/packages.html#subpath-imports) whenever possible.
|
|
27
|
-
|
|
28
|
-
## API
|
|
29
|
-
|
|
30
|
-
### `isBrowser`
|
|
31
|
-
|
|
32
|
-
Check if the code is running in a web browser environment.
|
|
33
|
-
|
|
34
|
-
### `isNode`
|
|
35
|
-
|
|
36
|
-
Check if the code is running in a [Node.js](https://nodejs.org) environment.
|
|
37
|
-
|
|
38
|
-
### `isBun`
|
|
39
|
-
|
|
40
|
-
Check if the code is running in a [Bun](https://bun.sh) environment.
|
|
41
|
-
|
|
42
|
-
### `isDeno`
|
|
43
|
-
|
|
44
|
-
Check if the code is running in a [Deno](https://deno.com) environment.
|
|
45
|
-
|
|
46
|
-
### `isElectron`
|
|
47
|
-
|
|
48
|
-
Check if the code is running in an [Electron](https://www.electronjs.org) environment.
|
|
49
|
-
|
|
50
|
-
### `isJsDom`
|
|
51
|
-
|
|
52
|
-
Check if the code is running in a [jsdom](https://github.com/jsdom/jsdom) environment.
|
|
53
|
-
|
|
54
|
-
### `isWebWorker`
|
|
55
|
-
|
|
56
|
-
Check if the code is running in a [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API#worker_global_contexts_and_functions) environment, which could be either a dedicated worker, shared worker, or service worker.
|
|
57
|
-
|
|
58
|
-
### `isDedicatedWorker`
|
|
59
|
-
|
|
60
|
-
Check if the code is running in a [Dedicated Worker](https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope) environment.
|
|
61
|
-
|
|
62
|
-
### `isSharedWorker`
|
|
63
|
-
|
|
64
|
-
Check if the code is running in a [Shared Worker](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorkerGlobalScope) environment.
|
|
65
|
-
|
|
66
|
-
### `isServiceWorker`
|
|
67
|
-
|
|
68
|
-
Check if the code is running in a [Service Worker](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope) environment.
|
|
69
|
-
|
|
70
|
-
### `isMacOs`
|
|
71
|
-
|
|
72
|
-
Check if the code is running on macOS.
|
|
73
|
-
|
|
74
|
-
### `isWindows`
|
|
75
|
-
|
|
76
|
-
Check if the code is running on Windows.
|
|
77
|
-
|
|
78
|
-
### `isLinux`
|
|
79
|
-
|
|
80
|
-
Check if the code is running on Linux.
|
|
81
|
-
|
|
82
|
-
### `isIos`
|
|
83
|
-
|
|
84
|
-
Check if the code is running on iOS.
|
|
85
|
-
|
|
86
|
-
### `isAndroid`
|
|
87
|
-
|
|
88
|
-
Check if the code is running on Android.
|
|
89
|
-
|
|
90
|
-
## Related
|
|
91
|
-
|
|
92
|
-
- [is-in-ci](https://github.com/sindresorhus/is-in-ci) - Check if the process is running in a CI environment
|
|
93
|
-
- [is64bit](https://github.com/sindresorhus/is64bit) - Check if the operating system CPU architecture is 64-bit or 32-bit
|
|
94
|
-
- [is](https://github.com/sindresorhus/is) - Type check values
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Escape RegExp special characters.
|
|
3
|
-
|
|
4
|
-
You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class.
|
|
5
|
-
|
|
6
|
-
@example
|
|
7
|
-
```
|
|
8
|
-
import escapeStringRegexp = require('escape-string-regexp');
|
|
9
|
-
|
|
10
|
-
const escapedString = escapeStringRegexp('How much $ for a 🦄?');
|
|
11
|
-
//=> 'How much \\$ for a 🦄\\?'
|
|
12
|
-
|
|
13
|
-
new RegExp(escapedString);
|
|
14
|
-
```
|
|
15
|
-
*/
|
|
16
|
-
declare const escapeStringRegexp: (string: string) => string;
|
|
17
|
-
|
|
18
|
-
export = escapeStringRegexp;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "escape-string-regexp",
|
|
3
|
-
"version": "2.0.0",
|
|
4
|
-
"description": "Escape RegExp special characters",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "sindresorhus/escape-string-regexp",
|
|
7
|
-
"author": {
|
|
8
|
-
"name": "Sindre Sorhus",
|
|
9
|
-
"email": "sindresorhus@gmail.com",
|
|
10
|
-
"url": "sindresorhus.com"
|
|
11
|
-
},
|
|
12
|
-
"maintainers": [
|
|
13
|
-
"Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
|
|
14
|
-
"Joshua Boy Nicolai Appelman <joshua@jbna.nl> (jbna.nl)"
|
|
15
|
-
],
|
|
16
|
-
"engines": {
|
|
17
|
-
"node": ">=8"
|
|
18
|
-
},
|
|
19
|
-
"scripts": {
|
|
20
|
-
"test": "xo && ava && tsd"
|
|
21
|
-
},
|
|
22
|
-
"files": [
|
|
23
|
-
"index.js",
|
|
24
|
-
"index.d.ts"
|
|
25
|
-
],
|
|
26
|
-
"keywords": [
|
|
27
|
-
"escape",
|
|
28
|
-
"regex",
|
|
29
|
-
"regexp",
|
|
30
|
-
"re",
|
|
31
|
-
"regular",
|
|
32
|
-
"expression",
|
|
33
|
-
"string",
|
|
34
|
-
"str",
|
|
35
|
-
"special",
|
|
36
|
-
"characters"
|
|
37
|
-
],
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"ava": "^1.4.1",
|
|
40
|
-
"tsd": "^0.7.2",
|
|
41
|
-
"xo": "^0.24.0"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# escape-string-regexp [](https://travis-ci.org/sindresorhus/escape-string-regexp)
|
|
2
|
-
|
|
3
|
-
> Escape RegExp special characters
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## Install
|
|
7
|
-
|
|
8
|
-
```
|
|
9
|
-
$ npm install escape-string-regexp
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
const escapeStringRegexp = require('escape-string-regexp');
|
|
17
|
-
|
|
18
|
-
const escapedString = escapeStringRegexp('How much $ for a 🦄?');
|
|
19
|
-
//=> 'How much \\$ for a 🦄\\?'
|
|
20
|
-
|
|
21
|
-
new RegExp(escapedString);
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
## License
|
|
28
|
-
|
|
29
|
-
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms).
|
|
3
|
-
|
|
4
|
-
@param codePoint - The [code point](https://en.wikipedia.org/wiki/Code_point) of a character.
|
|
5
|
-
|
|
6
|
-
@example
|
|
7
|
-
```
|
|
8
|
-
import isFullwidthCodePoint from 'is-fullwidth-code-point';
|
|
9
|
-
|
|
10
|
-
isFullwidthCodePoint('谢'.codePointAt(0));
|
|
11
|
-
//=> true
|
|
12
|
-
|
|
13
|
-
isFullwidthCodePoint('a'.codePointAt(0));
|
|
14
|
-
//=> false
|
|
15
|
-
```
|
|
16
|
-
*/
|
|
17
|
-
export default function isFullwidthCodePoint(codePoint: number): boolean;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
_isFullWidth as isFullWidth,
|
|
3
|
-
_isWide as isWide,
|
|
4
|
-
} from 'get-east-asian-width';
|
|
5
|
-
|
|
6
|
-
export default function isFullwidthCodePoint(codePoint) {
|
|
7
|
-
if (!Number.isInteger(codePoint)) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
return isFullWidth(codePoint) || isWide(codePoint);
|
|
12
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "is-fullwidth-code-point",
|
|
3
|
-
"version": "5.1.0",
|
|
4
|
-
"description": "Check if the character represented by a given Unicode code point is fullwidth",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "sindresorhus/is-fullwidth-code-point",
|
|
7
|
-
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Sindre Sorhus",
|
|
10
|
-
"email": "sindresorhus@gmail.com",
|
|
11
|
-
"url": "https://sindresorhus.com"
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"exports": {
|
|
15
|
-
"types": "./index.d.ts",
|
|
16
|
-
"default": "./index.js"
|
|
17
|
-
},
|
|
18
|
-
"sideEffects": false,
|
|
19
|
-
"engines": {
|
|
20
|
-
"node": ">=18"
|
|
21
|
-
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"test": "xo && ava && tsd"
|
|
24
|
-
},
|
|
25
|
-
"files": [
|
|
26
|
-
"index.js",
|
|
27
|
-
"index.d.ts"
|
|
28
|
-
],
|
|
29
|
-
"keywords": [
|
|
30
|
-
"fullwidth",
|
|
31
|
-
"full-width",
|
|
32
|
-
"full",
|
|
33
|
-
"width",
|
|
34
|
-
"unicode",
|
|
35
|
-
"character",
|
|
36
|
-
"string",
|
|
37
|
-
"codepoint",
|
|
38
|
-
"code",
|
|
39
|
-
"point",
|
|
40
|
-
"is",
|
|
41
|
-
"detect",
|
|
42
|
-
"check",
|
|
43
|
-
"east-asian-width"
|
|
44
|
-
],
|
|
45
|
-
"devDependencies": {
|
|
46
|
-
"ava": "^5.3.1",
|
|
47
|
-
"tsd": "^0.29.0",
|
|
48
|
-
"xo": "^0.56.0"
|
|
49
|
-
},
|
|
50
|
-
"dependencies": {
|
|
51
|
-
"get-east-asian-width": "^1.3.1"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# is-fullwidth-code-point
|
|
2
|
-
|
|
3
|
-
> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms)
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
npm install is-fullwidth-code-point
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
import isFullwidthCodePoint from 'is-fullwidth-code-point';
|
|
15
|
-
|
|
16
|
-
isFullwidthCodePoint('谢'.codePointAt(0));
|
|
17
|
-
//=> true
|
|
18
|
-
|
|
19
|
-
isFullwidthCodePoint('a'.codePointAt(0));
|
|
20
|
-
//=> false
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## API
|
|
24
|
-
|
|
25
|
-
### isFullwidthCodePoint(codePoint)
|
|
26
|
-
|
|
27
|
-
#### codePoint
|
|
28
|
-
|
|
29
|
-
Type: `number`
|
|
30
|
-
|
|
31
|
-
The [code point](https://en.wikipedia.org/wiki/Code_point) of a character.
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export type Options = {
|
|
2
|
-
/**
|
|
3
|
-
Count [ambiguous width characters](https://www.unicode.org/reports/tr11/#Ambiguous) as having narrow width (count of 1) instead of wide width (count of 2).
|
|
4
|
-
|
|
5
|
-
@default true
|
|
6
|
-
|
|
7
|
-
> Ambiguous characters behave like wide or narrow characters depending on the context (language tag, script identification, associated font, source of data, or explicit markup; all can provide the context). __If the context cannot be established reliably, they should be treated as narrow characters by default.__
|
|
8
|
-
> - http://www.unicode.org/reports/tr11/
|
|
9
|
-
*/
|
|
10
|
-
readonly ambiguousIsNarrow?: boolean;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
Whether [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) should be counted.
|
|
14
|
-
|
|
15
|
-
@default false
|
|
16
|
-
*/
|
|
17
|
-
readonly countAnsiEscapeCodes?: boolean;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
Get the visual width of a string - the number of columns required to display it.
|
|
22
|
-
|
|
23
|
-
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
|
|
24
|
-
|
|
25
|
-
@example
|
|
26
|
-
```
|
|
27
|
-
import stringWidth from 'string-width';
|
|
28
|
-
|
|
29
|
-
stringWidth('a');
|
|
30
|
-
//=> 1
|
|
31
|
-
|
|
32
|
-
stringWidth('古');
|
|
33
|
-
//=> 2
|
|
34
|
-
|
|
35
|
-
stringWidth('\u001B[1m古\u001B[22m');
|
|
36
|
-
//=> 2
|
|
37
|
-
```
|
|
38
|
-
*/
|
|
39
|
-
export default function stringWidth(string: string, options?: Options): number;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import stripAnsi from 'strip-ansi';
|
|
2
|
-
import {eastAsianWidth} from 'get-east-asian-width';
|
|
3
|
-
import emojiRegex from 'emoji-regex';
|
|
4
|
-
|
|
5
|
-
const segmenter = new Intl.Segmenter();
|
|
6
|
-
|
|
7
|
-
const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
8
|
-
|
|
9
|
-
export default function stringWidth(string, options = {}) {
|
|
10
|
-
if (typeof string !== 'string' || string.length === 0) {
|
|
11
|
-
return 0;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const {
|
|
15
|
-
ambiguousIsNarrow = true,
|
|
16
|
-
countAnsiEscapeCodes = false,
|
|
17
|
-
} = options;
|
|
18
|
-
|
|
19
|
-
if (!countAnsiEscapeCodes) {
|
|
20
|
-
string = stripAnsi(string);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (string.length === 0) {
|
|
24
|
-
return 0;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
let width = 0;
|
|
28
|
-
const eastAsianWidthOptions = {ambiguousAsWide: !ambiguousIsNarrow};
|
|
29
|
-
|
|
30
|
-
for (const {segment: character} of segmenter.segment(string)) {
|
|
31
|
-
const codePoint = character.codePointAt(0);
|
|
32
|
-
|
|
33
|
-
// Ignore control characters
|
|
34
|
-
if (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Ignore zero-width characters
|
|
39
|
-
if (
|
|
40
|
-
(codePoint >= 0x20_0B && codePoint <= 0x20_0F) // Zero-width space, non-joiner, joiner, left-to-right mark, right-to-left mark
|
|
41
|
-
|| codePoint === 0xFE_FF // Zero-width no-break space
|
|
42
|
-
) {
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Ignore combining characters
|
|
47
|
-
if (
|
|
48
|
-
(codePoint >= 0x3_00 && codePoint <= 0x3_6F) // Combining diacritical marks
|
|
49
|
-
|| (codePoint >= 0x1A_B0 && codePoint <= 0x1A_FF) // Combining diacritical marks extended
|
|
50
|
-
|| (codePoint >= 0x1D_C0 && codePoint <= 0x1D_FF) // Combining diacritical marks supplement
|
|
51
|
-
|| (codePoint >= 0x20_D0 && codePoint <= 0x20_FF) // Combining diacritical marks for symbols
|
|
52
|
-
|| (codePoint >= 0xFE_20 && codePoint <= 0xFE_2F) // Combining half marks
|
|
53
|
-
) {
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Ignore surrogate pairs
|
|
58
|
-
if (codePoint >= 0xD8_00 && codePoint <= 0xDF_FF) {
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Ignore variation selectors
|
|
63
|
-
if (codePoint >= 0xFE_00 && codePoint <= 0xFE_0F) {
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// This covers some of the above cases, but we still keep them for performance reasons.
|
|
68
|
-
if (defaultIgnorableCodePointRegex.test(character)) {
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// TODO: Use `/\p{RGI_Emoji}/v` when targeting Node.js 20.
|
|
73
|
-
if (emojiRegex().test(character)) {
|
|
74
|
-
width += 2;
|
|
75
|
-
continue;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return width;
|
|
82
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "string-width",
|
|
3
|
-
"version": "7.2.0",
|
|
4
|
-
"description": "Get the visual width of a string - the number of columns required to display it",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "sindresorhus/string-width",
|
|
7
|
-
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Sindre Sorhus",
|
|
10
|
-
"email": "sindresorhus@gmail.com",
|
|
11
|
-
"url": "https://sindresorhus.com"
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"exports": {
|
|
15
|
-
"types": "./index.d.ts",
|
|
16
|
-
"default": "./index.js"
|
|
17
|
-
},
|
|
18
|
-
"sideEffects": false,
|
|
19
|
-
"engines": {
|
|
20
|
-
"node": ">=18"
|
|
21
|
-
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"test": "xo && ava && tsd"
|
|
24
|
-
},
|
|
25
|
-
"files": [
|
|
26
|
-
"index.js",
|
|
27
|
-
"index.d.ts"
|
|
28
|
-
],
|
|
29
|
-
"keywords": [
|
|
30
|
-
"string",
|
|
31
|
-
"character",
|
|
32
|
-
"unicode",
|
|
33
|
-
"width",
|
|
34
|
-
"visual",
|
|
35
|
-
"column",
|
|
36
|
-
"columns",
|
|
37
|
-
"fullwidth",
|
|
38
|
-
"full-width",
|
|
39
|
-
"full",
|
|
40
|
-
"ansi",
|
|
41
|
-
"escape",
|
|
42
|
-
"codes",
|
|
43
|
-
"cli",
|
|
44
|
-
"command-line",
|
|
45
|
-
"terminal",
|
|
46
|
-
"console",
|
|
47
|
-
"cjk",
|
|
48
|
-
"chinese",
|
|
49
|
-
"japanese",
|
|
50
|
-
"korean",
|
|
51
|
-
"fixed-width",
|
|
52
|
-
"east-asian-width"
|
|
53
|
-
],
|
|
54
|
-
"dependencies": {
|
|
55
|
-
"emoji-regex": "^10.3.0",
|
|
56
|
-
"get-east-asian-width": "^1.0.0",
|
|
57
|
-
"strip-ansi": "^7.1.0"
|
|
58
|
-
},
|
|
59
|
-
"devDependencies": {
|
|
60
|
-
"ava": "^5.3.1",
|
|
61
|
-
"tsd": "^0.29.0",
|
|
62
|
-
"xo": "^0.56.0"
|
|
63
|
-
}
|
|
64
|
-
}
|