decocms 2.281.3 → 2.282.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BIxJ6Rg9.js → AlertCircle-BFBGzWbU.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-CE40KV1j.js → ArrowNarrowLeft-Dxp25apt.js} +1 -1
- package/dist/client/assets/{CheckCircle-COmXIEn5.js → CheckCircle-B3ma3JwC.js} +1 -1
- package/dist/client/assets/{ChevronDown-khwBdZmm.js → ChevronDown-D9BYLhkI.js} +1 -1
- package/dist/client/assets/{ChevronRight-D2N_TrCI.js → ChevronRight-1PBbNJm4.js} +1 -1
- package/dist/client/assets/{ChevronUp-FT6mgGv1.js → ChevronUp-Cfr7nwaY.js} +1 -1
- package/dist/client/assets/{Container-YuIVovXE.js → Container-DGdMzimP.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DDaNxuxy.js → LinkExternal01-D1eXv7CP.js} +1 -1
- package/dist/client/assets/{Lock01-CkeABLOV.js → Lock01-Cd-pjSnV.js} +1 -1
- package/dist/client/assets/{Palette-CPsljGLa.js → Palette-CpczgKVU.js} +1 -1
- package/dist/client/assets/{Play-BclVnOKX.js → Play-B7_Vv1Kl.js} +1 -1
- package/dist/client/assets/{Plus-E1YejiXY.js → Plus-DCerBxVp.js} +1 -1
- package/dist/client/assets/{SearchMd-CZudW5Cy.js → SearchMd-BBYvMMEY.js} +1 -1
- package/dist/client/assets/{Settings02-KYpYe9Yz.js → Settings02-CTxpmjIL.js} +1 -1
- package/dist/client/assets/{Star01-DYPros2N.js → Star01-DtLRJZfG.js} +1 -1
- package/dist/client/assets/{Sun-DMUBYzBg.js → Sun-CjaKdP_w.js} +1 -1
- package/dist/client/assets/{Tool01-BjCpHyDA.js → Tool01-BZX3PrpA.js} +1 -1
- package/dist/client/assets/{Trash01-D8X_Y-CH.js → Trash01-BpPWbnOV.js} +1 -1
- package/dist/client/assets/{Upload01-DORqJLhK.js → Upload01-AtFwS7_4.js} +1 -1
- package/dist/client/assets/{User01-BjMDaxtZ.js → User01-CbhU6vag.js} +1 -1
- package/dist/client/assets/{Users03-DvlzurXg.js → Users03-C-T3UrlF.js} +1 -1
- package/dist/client/assets/{X-DGMDFb7Q.js → X-BNbilc9H.js} +1 -1
- package/dist/client/assets/{XCircle-BBZJUk3l.js → XCircle-DYNSiiUr.js} +1 -1
- package/dist/client/assets/{Zap-CANzvBCB.js → Zap-B7kVcQ1u.js} +1 -1
- package/dist/client/assets/{ZapSquare-CvQHn6nj.js → ZapSquare-CdonE3dW.js} +1 -1
- package/dist/client/assets/{accordion-jGpS5bKT.js → accordion-FpUQMiXV.js} +1 -1
- package/dist/client/assets/agent-icon-CxiN-PMV.js +1 -0
- package/dist/client/assets/{agents-list-CeP_6hCn.js → agents-list-C7OZID3w.js} +1 -1
- package/dist/client/assets/ai-providers-BTFQDMp3.js +1 -0
- package/dist/client/assets/{alert-dialog-Cw0drrbJ.js → alert-dialog-C9VS4Tm4.js} +1 -1
- package/dist/client/assets/{auth-catchall-uBOqh0Nn.js → auth-catchall-Bns0gw3s.js} +1 -1
- package/dist/client/assets/{automation-list-row-DUeas6D2.js → automation-list-row-BcStn6T3.js} +1 -1
- package/dist/client/assets/{automations-B24Ufwx2.js → automations-CgsrNnd6.js} +1 -1
- package/dist/client/assets/{avatar-C3f1_XSr.js → avatar-BtIUeZzk.js} +1 -1
- package/dist/client/assets/{badge-UZcqLVBi.js → badge-CiNJMavT.js} +1 -1
- package/dist/client/assets/{brand-context-DACRWARm.js → brand-context-B9-s9Xpu.js} +1 -1
- package/dist/client/assets/{card-BeBnnJUH.js → card-BLvmImYq.js} +1 -1
- package/dist/client/assets/{chat-context-DJov78wv.js → chat-context-Bx9m79lL.js} +1 -1
- package/dist/client/assets/{checkbox-BkumBjmd.js → checkbox-CRVR_ot1.js} +1 -1
- package/dist/client/assets/{collection-detail-Asuy-_1g.js → collection-detail-D4nuXZXV.js} +1 -1
- package/dist/client/assets/{collection-display-button-BzGOL-dZ.js → collection-display-button-BuSwjRsM.js} +1 -1
- package/dist/client/assets/{collection-search-sgztHnmJ.js → collection-search-DoAFbLqs.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BuB667AV.js → collection-table-wrapper-DRpY-ndk.js} +1 -1
- package/dist/client/assets/{collection-tabs-BPMwPHXY.js → collection-tabs-0TZKhC7x.js} +1 -1
- package/dist/client/assets/{collections-BkkHKP6f.js → collections-DAiJZOiv.js} +1 -1
- package/dist/client/assets/{command-DwBmBE0l.js → command-BD_eOk-8.js} +1 -1
- package/dist/client/assets/{connection-card-dMq-VEuP.js → connection-card-C4AfupKS.js} +1 -1
- package/dist/client/assets/{connection-detail-pWGU-NlL.js → connection-detail-BOwwMlXo.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-wgUzsGEw.js → connection-form-helpers-QCTlKFgF.js} +1 -1
- package/dist/client/assets/{connections-DqsTtENU.js → connections-BjoOQtn5.js} +1 -1
- package/dist/client/assets/{constants-C8yptWZl.js → constants-CA_0oD0v.js} +4 -4
- package/dist/client/assets/{constants-SeBtlxYF.js → constants-DNupv1Il.js} +1 -1
- package/dist/client/assets/{dialog-7MxBMRtv.js → dialog-Do5tt2AM.js} +1 -1
- package/dist/client/assets/{drawer-BoWGhEog.js → drawer-CBGNhyg_.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Tf7X_k_G.js → dropdown-menu-YCgfVPDE.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-CAIBwlTg.js → dynamic-plugin-layout-DyQRK4xn.js} +1 -1
- package/dist/client/assets/{empty-state-B0FZL4pN.js → empty-state-CQYaNwoK.js} +1 -1
- package/dist/client/assets/{empty-state-DTGu1Fdm.js → empty-state-v8eFhsr-.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DbLaOTrL.js → extract-connection-data-BUe7uD61.js} +1 -1
- package/dist/client/assets/{features-83PDyWcU.js → features-DCMNUsWH.js} +1 -1
- package/dist/client/assets/{form-BmBsjzN0.js → form-CxxwnlP0.js} +1 -1
- package/dist/client/assets/{general-DP3Rps2a.js → general-oBb9oBV3.js} +1 -1
- package/dist/client/assets/{index-BkTKyHO8.js → index-2HrmMP-L.js} +31 -31
- package/dist/client/assets/{index-BSSsgGZx.js → index-3qazylEt.js} +1 -1
- package/dist/client/assets/{index-B6Fe448o.js → index-B66cimzy.js} +2 -2
- package/dist/client/assets/{index-BpLvdlDN.js → index-B_SuozHK.js} +1 -1
- package/dist/client/assets/{index-BGFEANza.js → index-BzPv7Dhu.js} +1 -1
- package/dist/client/assets/{index-DHHYfLmC.js → index-CSgeCYxL.js} +1 -1
- package/dist/client/assets/{index-D2RLcUNw.js → index-CT3_Tk81.js} +1 -1
- package/dist/client/assets/{index-DWsq2B99.js → index-DBUcZB2f.js} +1 -1
- package/dist/client/assets/{index-CMwJl8aa.js → index-DCHDqkUk.js} +1 -1
- package/dist/client/assets/index-DHRo5LVc.css +1 -0
- package/dist/client/assets/{index-aO0TlYPD.js → index-DRqrJul_.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BxX_zFxP.js → infiniteQueryObserver-BMqyJ-TR.js} +1 -1
- package/dist/client/assets/{input-B6wnc6E0.js → input-n-tkcD47.js} +1 -1
- package/dist/client/assets/integration-icon-DMDIiedF.js +1 -0
- package/dist/client/assets/{label-5rqczNeH.js → label-BtcNLrPM.js} +1 -1
- package/dist/client/assets/{layout-BEgtojgD.js → layout-Db9ocR8l.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-DZ-xsVMV.js → lean-canvas-recruit-modal-D_J2ca55.js} +2 -2
- package/dist/client/assets/{login-BuRLGM9E.js → login-44n9MoF6.js} +1 -1
- package/dist/client/assets/{members-D2SzW3dK.js → members-DVv4q0sB.js} +1 -1
- package/dist/client/assets/{monaco-editor-NoBsgNbn.js → monaco-editor-BArWst-4.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CNa1Qyhs.js → monitoring-stats-row-DwT9f7ma.js} +1 -1
- package/dist/client/assets/{oauth-callback-aI0Tid7G.js → oauth-callback-ZWFD-c9z.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-EFLM2H1m.js → oauth-callback-ai-provider-DvgS7JVs.js} +1 -1
- package/dist/client/assets/{onboarding-Sr2nWjf7.js → onboarding-Bx7D7eeN.js} +1 -1
- package/dist/client/assets/{org-layout-BOB9EMoQ.js → org-layout-C1WQZ86m.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-DcKtHUs4.js → org-plugin-layout-aVinWGGP.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BHovc0r0.js → plugin-empty-state-7geUhVaf.js} +1 -1
- package/dist/client/assets/{plugin-header-BX67VN7B.js → plugin-header-C1Y6Yac2.js} +1 -1
- package/dist/client/assets/{plugin-layout-BuvVa8nF.js → plugin-layout-ClqwcLfX.js} +1 -1
- package/dist/client/assets/{popover-BU4_Dn9E.js → popover-XBsYrCQB.js} +1 -1
- package/dist/client/assets/{profile-Y8Sfq9q9.js → profile-DLXMWz7I.js} +1 -1
- package/dist/client/assets/{project-app-view-CCANnsKQ.js → project-app-view-BWaWLQ1-.js} +1 -1
- package/dist/client/assets/registry-fqaSl7FI.js +2 -0
- package/dist/client/assets/{registry-layout-Z-9iQ5Hy.js → registry-layout-BOqFx2Hr.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Dn_y9pYd.js → required-auth-layout-Q3YyHmAw.js} +1 -1
- package/dist/client/assets/{reset-password-CyUYFfOn.js → reset-password-Ben4hB-3.js} +1 -1
- package/dist/client/assets/{scroll-area-C_emWPwP.js → scroll-area-BdtE1vuO.js} +1 -1
- package/dist/client/assets/{search-input-oxb8hZUf.js → search-input-CmCwxjTX.js} +1 -1
- package/dist/client/assets/{select-CLAiPDa-.js → select-MIqG5BTZ.js} +1 -1
- package/dist/client/assets/{select-model-BXWqo7I7.js → select-model-Bg7ZIMS5.js} +1 -1
- package/dist/client/assets/{settings-layout-DealGEF-.js → settings-layout-DO-ULKWI.js} +1 -1
- package/dist/client/assets/{shell-layout-BLDfm85U.js → shell-layout-xKLRos3t.js} +1 -1
- package/dist/client/assets/{skeleton-CbLrdMio.js → skeleton-BZTVNwC4.js} +1 -1
- package/dist/client/assets/{sso-Ccm_fQKb.js → sso-BT50WbJk.js} +1 -1
- package/dist/client/assets/{store-DbLdk8zH.js → store-CHDNsIdi.js} +1 -1
- package/dist/client/assets/store-registry-kH6JKRAv.js +2 -0
- package/dist/client/assets/{switch-CBH6sGXt.js → switch-BI6s_uRk.js} +1 -1
- package/dist/client/assets/{table-fKK1m7_o.js → table-WyfrKpOs.js} +1 -1
- package/dist/client/assets/{tabs-D-EbmTZr.js → tabs-BK1mEgGf.js} +1 -1
- package/dist/client/assets/{task-status-Dpnxg-vx.js → task-status-GcEPbgk8.js} +1 -1
- package/dist/client/assets/{textarea-D4ABUBrM.js → textarea-DVawcto0.js} +1 -1
- package/dist/client/assets/{toggle-group-CrTmZ_AV.js → toggle-group-wuBBOmnu.js} +1 -1
- package/dist/client/assets/{tools-list-CqkfReof.js → tools-list-BgoIxxcE.js} +1 -1
- package/dist/client/assets/{types-GM8sGKcZ.js → types-B9bcGYd-.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Bzstkld8.js → use-ai-providers-CvVWYaQ8.js} +1 -1
- package/dist/client/assets/{use-collections-CqFt8Ao1.js → use-collections-daCmI1gf.js} +1 -1
- package/dist/client/assets/{use-connection-aoJhyCQY.js → use-connection-DX24Nzyd.js} +1 -1
- package/dist/client/assets/{use-copy-M68f6GGE.js → use-copy-DnDrxF7p.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-HCly1WGo.js → use-create-virtual-mcp-BXWOJHzA.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Dyu5zP68.js → use-decopilot-events-CqJFbk0C.js} +1 -1
- package/dist/client/assets/{use-delete-connection-D1fyoOVF.js → use-delete-connection-BypWLqop.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DxLzMG99.js → use-infinite-scroll-B2G1dNh-.js} +1 -1
- package/dist/client/assets/{use-list-state-0zsLkDoY.js → use-list-state-CUoBuePJ.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-B8DbBP0f.js → use-mcp-tools-B7YQiceT.js} +1 -1
- package/dist/client/assets/{use-members-BwzOWwXP.js → use-members-CT_s4J5I.js} +1 -1
- package/dist/client/assets/{use-mobile-BpFBqyL_.js → use-mobile-CZZS48R8.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CDDwaLRP.js → use-navigate-to-agent-DDSqcJhW.js} +1 -1
- package/dist/client/assets/{use-org-sso-tVtj-Uzh.js → use-org-sso-CtXg6XR8.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CnHZf6OA.js → use-organization-settings-G7C4gwdM.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BGlGR_mo.js → use-registry-connections-CpcHatqk.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DkqPpB9d.js → use-status-sounds-Bo8AWgrW.js} +1 -1
- package/dist/client/assets/{use-tasks-5lCHGF_c.js → use-tasks-DBgVSqQb.js} +1 -1
- package/dist/client/assets/{use-view-mode-DVj5tWV_.js → use-view-mode-BtECwb27.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-By_96asb.js → use-virtual-mcp-C6vsxMj0.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-wZmQwXID.js +1 -0
- package/dist/client/assets/{user-DHkNN6iL.js → user-5NHpahbI.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Btma8l_9.js → view-mode-toggle-DqCLjYVJ.js} +1 -1
- package/dist/client/assets/{workflow-l_Z97b0k.js → workflow-BXvm2wWf.js} +1 -1
- package/dist/client/assets/workflow-detail-C3H1TNiF.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +55 -55
- 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/emoji-regex/LICENSE-MIT.txt +20 -0
- package/dist/server/node_modules/emoji-regex/README.md +107 -0
- package/dist/server/node_modules/emoji-regex/index.d.ts +3 -0
- package/dist/server/node_modules/emoji-regex/index.js +4 -0
- package/dist/server/node_modules/emoji-regex/index.mjs +4 -0
- package/dist/server/node_modules/emoji-regex/package.json +45 -0
- package/dist/server/node_modules/figures/index.d.ts +279 -0
- package/dist/server/node_modules/figures/index.js +292 -0
- package/dist/server/node_modules/figures/package.json +49 -0
- package/dist/server/node_modules/figures/readme.md +337 -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/{widest-line → mimic-fn}/license +1 -1
- 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/onetime/index.d.ts +64 -0
- package/dist/server/node_modules/onetime/index.js +44 -0
- package/dist/server/node_modules/onetime/package.json +43 -0
- package/dist/server/node_modules/onetime/readme.md +94 -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/node_modules/split2/LICENSE +13 -0
- package/dist/server/node_modules/split2/README.md +85 -0
- package/dist/server/node_modules/split2/bench.js +27 -0
- package/dist/server/node_modules/split2/index.js +141 -0
- package/dist/server/node_modules/split2/package.json +39 -0
- package/dist/server/node_modules/split2/test.js +409 -0
- package/dist/server/node_modules/xtend/.jshintrc +30 -0
- package/dist/server/node_modules/{pg → xtend}/LICENSE +6 -7
- package/dist/server/node_modules/xtend/README.md +32 -0
- package/dist/server/node_modules/xtend/immutable.js +19 -0
- package/dist/server/node_modules/xtend/mutable.js +17 -0
- package/dist/server/node_modules/xtend/package.json +55 -0
- package/dist/server/node_modules/xtend/test.js +103 -0
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/agent-icon-CNfJJZjP.js +0 -1
- package/dist/client/assets/ai-providers-C3bM9mct.js +0 -1
- package/dist/client/assets/index-C_Ncklfg.css +0 -1
- package/dist/client/assets/integration-icon-BkwkZhee.js +0 -1
- package/dist/client/assets/registry-BbDGhxnL.js +0 -2
- package/dist/client/assets/store-registry-COcXxk0L.js +0 -2
- package/dist/client/assets/useInfiniteQuery-CTYKQqwI.js +0 -1
- package/dist/client/assets/workflow-detail-DM7Beg9p.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/get-east-asian-width/index.d.ts +0 -60
- package/dist/server/node_modules/get-east-asian-width/index.js +0 -30
- package/dist/server/node_modules/get-east-asian-width/lookup-data.js +0 -18
- package/dist/server/node_modules/get-east-asian-width/lookup.js +0 -135
- package/dist/server/node_modules/get-east-asian-width/package.json +0 -71
- package/dist/server/node_modules/get-east-asian-width/readme.md +0 -65
- package/dist/server/node_modules/get-east-asian-width/utilities.js +0 -24
- package/dist/server/node_modules/indent-string/index.d.ts +0 -38
- package/dist/server/node_modules/indent-string/index.js +0 -38
- package/dist/server/node_modules/indent-string/package.json +0 -40
- package/dist/server/node_modules/indent-string/readme.md +0 -73
- package/dist/server/node_modules/pg/README.md +0 -95
- package/dist/server/node_modules/pg/esm/index.mjs +0 -20
- package/dist/server/node_modules/pg/lib/client.js +0 -743
- package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
- package/dist/server/node_modules/pg/lib/connection.js +0 -221
- package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
- package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
- package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
- package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
- package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
- package/dist/server/node_modules/pg/lib/defaults.js +0 -91
- package/dist/server/node_modules/pg/lib/index.js +0 -73
- package/dist/server/node_modules/pg/lib/native/client.js +0 -323
- package/dist/server/node_modules/pg/lib/native/index.js +0 -2
- package/dist/server/node_modules/pg/lib/native/query.js +0 -165
- package/dist/server/node_modules/pg/lib/query.js +0 -252
- package/dist/server/node_modules/pg/lib/result.js +0 -109
- package/dist/server/node_modules/pg/lib/stream.js +0 -83
- package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
- package/dist/server/node_modules/pg/lib/utils.js +0 -217
- package/dist/server/node_modules/pg/package.json +0 -76
- package/dist/server/node_modules/widest-line/index.d.ts +0 -12
- package/dist/server/node_modules/widest-line/index.js +0 -11
- package/dist/server/node_modules/widest-line/package.json +0 -60
- package/dist/server/node_modules/widest-line/readme.md +0 -26
- /package/dist/server/node_modules/{ansi-styles → ansi-regex}/license +0 -0
- /package/dist/server/node_modules/{get-east-asian-width → figures}/license +0 -0
- /package/dist/server/node_modules/{indent-string → onetime}/license +0 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
# figures
|
|
2
|
+
|
|
3
|
+
> Unicode symbols with fallbacks for older terminals
|
|
4
|
+
|
|
5
|
+
[](index.js)
|
|
6
|
+
|
|
7
|
+
[*and more...*](index.js)
|
|
8
|
+
|
|
9
|
+
Terminals such as Windows Console Host (and CMD) only support a [limited character set](http://en.wikipedia.org/wiki/Code_page_437).
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm install figures
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
import figures, {mainSymbols, fallbackSymbols, replaceSymbols} from 'figures';
|
|
21
|
+
|
|
22
|
+
console.log(figures.tick);
|
|
23
|
+
// On terminals with Unicode symbols: ✔
|
|
24
|
+
// On other terminals: √
|
|
25
|
+
|
|
26
|
+
console.log(mainSymbols.tick);
|
|
27
|
+
// On all terminals: ✔
|
|
28
|
+
|
|
29
|
+
console.log(fallbackSymbols.tick);
|
|
30
|
+
// On all terminals: √
|
|
31
|
+
|
|
32
|
+
console.log(replaceSymbols('✔ check'));
|
|
33
|
+
// On terminals with Unicode symbols: ✔ check
|
|
34
|
+
// On other terminals: √ check
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## API
|
|
38
|
+
|
|
39
|
+
### figures (default export)
|
|
40
|
+
|
|
41
|
+
Type: `object`
|
|
42
|
+
|
|
43
|
+
Symbols to use on any terminal.
|
|
44
|
+
|
|
45
|
+
### mainSymbols
|
|
46
|
+
|
|
47
|
+
Symbols to use when the terminal supports Unicode symbols.
|
|
48
|
+
|
|
49
|
+
### fallbackSymbols
|
|
50
|
+
|
|
51
|
+
Symbols to use when the terminal does not support Unicode symbols.
|
|
52
|
+
|
|
53
|
+
### replaceSymbols(string, options?)
|
|
54
|
+
|
|
55
|
+
Returns the input with replaced fallback symbols if the terminal has poor Unicode support.
|
|
56
|
+
|
|
57
|
+
All the below [figures](#figures) are attached to the default export as shown in the example above.
|
|
58
|
+
|
|
59
|
+
#### string
|
|
60
|
+
|
|
61
|
+
Type: `string`
|
|
62
|
+
|
|
63
|
+
String where the Unicode symbols will be replaced with fallback symbols depending on the terminal.
|
|
64
|
+
|
|
65
|
+
#### options
|
|
66
|
+
|
|
67
|
+
Type: `object`
|
|
68
|
+
|
|
69
|
+
##### useFallback
|
|
70
|
+
|
|
71
|
+
Type: `boolean`\
|
|
72
|
+
Default: `true` if the terminal has poor Unicode support
|
|
73
|
+
|
|
74
|
+
Whether to replace symbols with fallbacks.
|
|
75
|
+
|
|
76
|
+
This can be set to `true` to always use fallback symbols, whether the terminal has poor Unicode support or not.
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
import {replaceSymbols} from 'figures';
|
|
80
|
+
|
|
81
|
+
console.log(replaceSymbols('✔ check', {useFallback: true}));
|
|
82
|
+
// On terminals with Unicode symbols: √ check
|
|
83
|
+
// On other terminals: √ check
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Figures
|
|
87
|
+
|
|
88
|
+
`Fallback` characters are only shown when they differ from the `Main` ones.
|
|
89
|
+
|
|
90
|
+
| Name | Main | Fallback |
|
|
91
|
+
| ------------------------------------------- | :--: | :------: |
|
|
92
|
+
| tick | `✔` | `√` |
|
|
93
|
+
| info | `ℹ` | `i` |
|
|
94
|
+
| warning | `⚠` | `‼` |
|
|
95
|
+
| cross | `✘` | `×` |
|
|
96
|
+
| square | `█` | |
|
|
97
|
+
| squareSmall | `◻` | `□` |
|
|
98
|
+
| squareSmallFilled | `◼` | `■` |
|
|
99
|
+
| squareDarkShade | `▓` | |
|
|
100
|
+
| squareMediumShade | `▒` | |
|
|
101
|
+
| squareLightShade | `░` | |
|
|
102
|
+
| squareTop | `▀` | |
|
|
103
|
+
| squareBottom | `▄` | |
|
|
104
|
+
| squareLeft | `▌` | |
|
|
105
|
+
| squareRight | `▐` | |
|
|
106
|
+
| squareCenter | `■` | |
|
|
107
|
+
| circle | `◯` | `( )` |
|
|
108
|
+
| circleFilled | `◉` | `(*)` |
|
|
109
|
+
| circleDotted | `◌` | `( )` |
|
|
110
|
+
| circleDouble | `◎` | `( )` |
|
|
111
|
+
| circleCircle | `ⓞ` | `(○)` |
|
|
112
|
+
| circleCross | `ⓧ` | `(×)` |
|
|
113
|
+
| circlePipe | `Ⓘ` | `(│)` |
|
|
114
|
+
| circleQuestionMark | `?⃝ ` | `(?)` |
|
|
115
|
+
| radioOn | `◉` | `(*)` |
|
|
116
|
+
| radioOff | `◯` | `( )` |
|
|
117
|
+
| checkboxOn | `☒` | `[×]` |
|
|
118
|
+
| checkboxOff | `☐` | `[ ]` |
|
|
119
|
+
| checkboxCircleOn | `ⓧ` | `(×)` |
|
|
120
|
+
| checkboxCircleOff | `Ⓘ` | `( )` |
|
|
121
|
+
| questionMarkPrefix | `?⃝ ` | `?` |
|
|
122
|
+
| bullet | `●` | |
|
|
123
|
+
| dot | `․` | |
|
|
124
|
+
| ellipsis | `…` | |
|
|
125
|
+
| pointer | `❯` | `>` |
|
|
126
|
+
| pointerSmall | `›` | `›` |
|
|
127
|
+
| triangleUp | `▲` | |
|
|
128
|
+
| triangleUpSmall | `▴` | |
|
|
129
|
+
| triangleUpOutline | `△` | `∆` |
|
|
130
|
+
| triangleDown | `▼` | |
|
|
131
|
+
| triangleDownSmall | `▾` | |
|
|
132
|
+
| triangleLeft | `◀` | `◄` |
|
|
133
|
+
| triangleLeftSmall | `◂` | |
|
|
134
|
+
| triangleRight | `▶` | `►` |
|
|
135
|
+
| triangleRightSmall | `▸` | |
|
|
136
|
+
| lozenge | `◆` | `♦` |
|
|
137
|
+
| lozengeOutline | `◇` | `◊` |
|
|
138
|
+
| home | `⌂` | |
|
|
139
|
+
| hamburger | `☰` | `≡` |
|
|
140
|
+
| smiley | `㋡` | `☺` |
|
|
141
|
+
| mustache | `෴` | `┌─┐` |
|
|
142
|
+
| heart | `♥` | |
|
|
143
|
+
| star | `★` | `✶` |
|
|
144
|
+
| play | `▶` | `►` |
|
|
145
|
+
| musicNote | `♪` | |
|
|
146
|
+
| musicNoteBeamed | `♫` | |
|
|
147
|
+
| nodejs | `⬢` | `♦` |
|
|
148
|
+
| arrowUp | `↑` | |
|
|
149
|
+
| arrowDown | `↓` | |
|
|
150
|
+
| arrowLeft | `←` | |
|
|
151
|
+
| arrowRight | `→` | |
|
|
152
|
+
| arrowLeftRight | `↔` | |
|
|
153
|
+
| arrowUpDown | `↕` | |
|
|
154
|
+
| almostEqual | `≈` | |
|
|
155
|
+
| notEqual | `≠` | |
|
|
156
|
+
| lessOrEqual | `≤` | |
|
|
157
|
+
| greaterOrEqual | `≥` | |
|
|
158
|
+
| identical | `≡` | |
|
|
159
|
+
| infinity | `∞` | |
|
|
160
|
+
| subscriptZero | `₀` | |
|
|
161
|
+
| subscriptOne | `₁` | |
|
|
162
|
+
| subscriptTwo | `₂` | |
|
|
163
|
+
| subscriptThree | `₃` | |
|
|
164
|
+
| subscriptFour | `₄` | |
|
|
165
|
+
| subscriptFive | `₅` | |
|
|
166
|
+
| subscriptSix | `₆` | |
|
|
167
|
+
| subscriptSeven | `₇` | |
|
|
168
|
+
| subscriptEight | `₈` | |
|
|
169
|
+
| subscriptNine | `₉` | |
|
|
170
|
+
| oneHalf | `½` | |
|
|
171
|
+
| oneThird | `⅓` | |
|
|
172
|
+
| oneQuarter | `¼` | |
|
|
173
|
+
| oneFifth | `⅕` | |
|
|
174
|
+
| oneSixth | `⅙` | |
|
|
175
|
+
| oneSeventh | `⅐` | `1/7` |
|
|
176
|
+
| oneEighth | `⅛` | |
|
|
177
|
+
| oneNinth | `⅑` | `1/9` |
|
|
178
|
+
| oneTenth | `⅒` | `1/10` |
|
|
179
|
+
| twoThirds | `⅔` | |
|
|
180
|
+
| twoFifths | `⅖` | |
|
|
181
|
+
| threeQuarters | `¾` | |
|
|
182
|
+
| threeFifths | `⅗` | |
|
|
183
|
+
| threeEighths | `⅜` | |
|
|
184
|
+
| fourFifths | `⅘` | |
|
|
185
|
+
| fiveSixths | `⅚` | |
|
|
186
|
+
| fiveEighths | `⅝` | |
|
|
187
|
+
| sevenEighths | `⅞` | |
|
|
188
|
+
| line | `─` | |
|
|
189
|
+
| lineBold | `━` | |
|
|
190
|
+
| lineDouble | `═` | |
|
|
191
|
+
| lineDashed0 | `┄` | |
|
|
192
|
+
| lineDashed1 | `┅` | |
|
|
193
|
+
| lineDashed2 | `┈` | |
|
|
194
|
+
| lineDashed3 | `┉` | |
|
|
195
|
+
| lineDashed4 | `╌` | |
|
|
196
|
+
| lineDashed5 | `╍` | |
|
|
197
|
+
| lineDashed6 | `╴` | |
|
|
198
|
+
| lineDashed7 | `╶` | |
|
|
199
|
+
| lineDashed8 | `╸` | |
|
|
200
|
+
| lineDashed9 | `╺` | |
|
|
201
|
+
| lineDashed10 | `╼` | |
|
|
202
|
+
| lineDashed11 | `╾` | |
|
|
203
|
+
| lineDashed12 | `−` | |
|
|
204
|
+
| lineDashed13 | `–` | |
|
|
205
|
+
| lineDashed14 | `‐` | |
|
|
206
|
+
| lineDashed15 | `⁃` | |
|
|
207
|
+
| lineVertical | `│` | |
|
|
208
|
+
| lineVerticalBold | `┃` | |
|
|
209
|
+
| lineVerticalDouble | `║` | |
|
|
210
|
+
| lineVerticalDashed0 | `┆` | |
|
|
211
|
+
| lineVerticalDashed1 | `┇` | |
|
|
212
|
+
| lineVerticalDashed2 | `┊` | |
|
|
213
|
+
| lineVerticalDashed3 | `┋` | |
|
|
214
|
+
| lineVerticalDashed4 | `╎` | |
|
|
215
|
+
| lineVerticalDashed5 | `╏` | |
|
|
216
|
+
| lineVerticalDashed6 | `╵` | |
|
|
217
|
+
| lineVerticalDashed7 | `╷` | |
|
|
218
|
+
| lineVerticalDashed8 | `╹` | |
|
|
219
|
+
| lineVerticalDashed9 | `╻` | |
|
|
220
|
+
| lineVerticalDashed10 | `╽` | |
|
|
221
|
+
| lineVerticalDashed11 | `╿` | |
|
|
222
|
+
| lineDownLeft | `┐` | |
|
|
223
|
+
| lineDownLeftArc | `╮` | |
|
|
224
|
+
| lineDownBoldLeftBold | `┓` | |
|
|
225
|
+
| lineDownBoldLeft | `┒` | |
|
|
226
|
+
| lineDownLeftBold | `┑` | |
|
|
227
|
+
| lineDownDoubleLeftDouble | `╗` | |
|
|
228
|
+
| lineDownDoubleLeft | `╖` | |
|
|
229
|
+
| lineDownLeftDouble | `╕` | |
|
|
230
|
+
| lineDownRight | `┌` | |
|
|
231
|
+
| lineDownRightArc | `╭` | |
|
|
232
|
+
| lineDownBoldRightBold | `┏` | |
|
|
233
|
+
| lineDownBoldRight | `┎` | |
|
|
234
|
+
| lineDownRightBold | `┍` | |
|
|
235
|
+
| lineDownDoubleRightDouble | `╔` | |
|
|
236
|
+
| lineDownDoubleRight | `╓` | |
|
|
237
|
+
| lineDownRightDouble | `╒` | |
|
|
238
|
+
| lineUpLeft | `┘` | |
|
|
239
|
+
| lineUpLeftArc | `╯` | |
|
|
240
|
+
| lineUpBoldLeftBold | `┛` | |
|
|
241
|
+
| lineUpBoldLeft | `┚` | |
|
|
242
|
+
| lineUpLeftBold | `┙` | |
|
|
243
|
+
| lineUpDoubleLeftDouble | `╝` | |
|
|
244
|
+
| lineUpDoubleLeft | `╜` | |
|
|
245
|
+
| lineUpLeftDouble | `╛` | |
|
|
246
|
+
| lineUpRight | `└` | |
|
|
247
|
+
| lineUpRightArc | `╰` | |
|
|
248
|
+
| lineUpBoldRightBold | `┗` | |
|
|
249
|
+
| lineUpBoldRight | `┖` | |
|
|
250
|
+
| lineUpRightBold | `┕` | |
|
|
251
|
+
| lineUpDoubleRightDouble | `╚` | |
|
|
252
|
+
| lineUpDoubleRight | `╙` | |
|
|
253
|
+
| lineUpRightDouble | `╘` | |
|
|
254
|
+
| lineUpDownLeft | `┤` | |
|
|
255
|
+
| lineUpBoldDownBoldLeftBold | `┫` | |
|
|
256
|
+
| lineUpBoldDownBoldLeft | `┨` | |
|
|
257
|
+
| lineUpDownLeftBold | `┥` | |
|
|
258
|
+
| lineUpBoldDownLeftBold | `┩` | |
|
|
259
|
+
| lineUpDownBoldLeftBold | `┪` | |
|
|
260
|
+
| lineUpDownBoldLeft | `┧` | |
|
|
261
|
+
| lineUpBoldDownLeft | `┦` | |
|
|
262
|
+
| lineUpDoubleDownDoubleLeftDouble | `╣` | |
|
|
263
|
+
| lineUpDoubleDownDoubleLeft | `╢` | |
|
|
264
|
+
| lineUpDownLeftDouble | `╡` | |
|
|
265
|
+
| lineUpDownRight | `├` | |
|
|
266
|
+
| lineUpBoldDownBoldRightBold | `┣` | |
|
|
267
|
+
| lineUpBoldDownBoldRight | `┠` | |
|
|
268
|
+
| lineUpDownRightBold | `┝` | |
|
|
269
|
+
| lineUpBoldDownRightBold | `┡` | |
|
|
270
|
+
| lineUpDownBoldRightBold | `┢` | |
|
|
271
|
+
| lineUpDownBoldRight | `┟` | |
|
|
272
|
+
| lineUpBoldDownRight | `┞` | |
|
|
273
|
+
| lineUpDoubleDownDoubleRightDouble | `╠` | |
|
|
274
|
+
| lineUpDoubleDownDoubleRight | `╟` | |
|
|
275
|
+
| lineUpDownRightDouble | `╞` | |
|
|
276
|
+
| lineDownLeftRight | `┬` | |
|
|
277
|
+
| lineDownBoldLeftBoldRightBold | `┳` | |
|
|
278
|
+
| lineDownLeftBoldRightBold | `┯` | |
|
|
279
|
+
| lineDownBoldLeftRight | `┰` | |
|
|
280
|
+
| lineDownBoldLeftBoldRight | `┱` | |
|
|
281
|
+
| lineDownBoldLeftRightBold | `┲` | |
|
|
282
|
+
| lineDownLeftRightBold | `┮` | |
|
|
283
|
+
| lineDownLeftBoldRight | `┭` | |
|
|
284
|
+
| lineDownDoubleLeftDoubleRightDouble | `╦` | |
|
|
285
|
+
| lineDownDoubleLeftRight | `╥` | |
|
|
286
|
+
| lineDownLeftDoubleRightDouble | `╤` | |
|
|
287
|
+
| lineUpLeftRight | `┴` | |
|
|
288
|
+
| lineUpBoldLeftBoldRightBold | `┻` | |
|
|
289
|
+
| lineUpLeftBoldRightBold | `┷` | |
|
|
290
|
+
| lineUpBoldLeftRight | `┸` | |
|
|
291
|
+
| lineUpBoldLeftBoldRight | `┹` | |
|
|
292
|
+
| lineUpBoldLeftRightBold | `┺` | |
|
|
293
|
+
| lineUpLeftRightBold | `┶` | |
|
|
294
|
+
| lineUpLeftBoldRight | `┵` | |
|
|
295
|
+
| lineUpDoubleLeftDoubleRightDouble | `╩` | |
|
|
296
|
+
| lineUpDoubleLeftRight | `╨` | |
|
|
297
|
+
| lineUpLeftDoubleRightDouble | `╧` | |
|
|
298
|
+
| lineUpDownLeftRight | `┼` | |
|
|
299
|
+
| lineUpBoldDownBoldLeftBoldRightBold | `╋` | |
|
|
300
|
+
| lineUpDownBoldLeftBoldRightBold | `╈` | |
|
|
301
|
+
| lineUpBoldDownLeftBoldRightBold | `╇` | |
|
|
302
|
+
| lineUpBoldDownBoldLeftRightBold | `╊` | |
|
|
303
|
+
| lineUpBoldDownBoldLeftBoldRight | `╉` | |
|
|
304
|
+
| lineUpBoldDownLeftRight | `╀` | |
|
|
305
|
+
| lineUpDownBoldLeftRight | `╁` | |
|
|
306
|
+
| lineUpDownLeftBoldRight | `┽` | |
|
|
307
|
+
| lineUpDownLeftRightBold | `┾` | |
|
|
308
|
+
| lineUpBoldDownBoldLeftRight | `╂` | |
|
|
309
|
+
| lineUpDownLeftBoldRightBold | `┿` | |
|
|
310
|
+
| lineUpBoldDownLeftBoldRight | `╃` | |
|
|
311
|
+
| lineUpBoldDownLeftRightBold | `╄` | |
|
|
312
|
+
| lineUpDownBoldLeftBoldRight | `╅` | |
|
|
313
|
+
| lineUpDownBoldLeftRightBold | `╆` | |
|
|
314
|
+
| lineUpDoubleDownDoubleLeftDoubleRightDouble | `╬` | |
|
|
315
|
+
| lineUpDoubleDownDoubleLeftRight | `╫` | |
|
|
316
|
+
| lineUpDownLeftDoubleRightDouble | `╪` | |
|
|
317
|
+
| lineCross | `╳` | |
|
|
318
|
+
| lineBackslash | `╲` | |
|
|
319
|
+
| lineSlash | `╱` | |
|
|
320
|
+
|
|
321
|
+
## Other characters
|
|
322
|
+
|
|
323
|
+
If you cannot find the character you're looking for in the table above, please look at this full list of [cross-platform terminal characters](https://github.com/ehmicky/cross-platform-terminal-characters).
|
|
324
|
+
|
|
325
|
+
## Unsupported terminals
|
|
326
|
+
|
|
327
|
+
The following terminals are not officially supported:
|
|
328
|
+
|
|
329
|
+
- xterm
|
|
330
|
+
- Linux Terminal (kernel)
|
|
331
|
+
- cmder
|
|
332
|
+
|
|
333
|
+
They can display most but not all of the symbols listed above.
|
|
334
|
+
|
|
335
|
+
## Related
|
|
336
|
+
|
|
337
|
+
- [log-symbols](https://github.com/sindresorhus/log-symbols) - Colored symbols for various log levels
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
declare const mimicFn: {
|
|
2
|
+
/**
|
|
3
|
+
Make a function mimic another one. It will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set.
|
|
4
|
+
|
|
5
|
+
@param to - Mimicking function.
|
|
6
|
+
@param from - Function to mimic.
|
|
7
|
+
@returns The modified `to` function.
|
|
8
|
+
|
|
9
|
+
@example
|
|
10
|
+
```
|
|
11
|
+
import mimicFn = require('mimic-fn');
|
|
12
|
+
|
|
13
|
+
function foo() {}
|
|
14
|
+
foo.unicorn = '🦄';
|
|
15
|
+
|
|
16
|
+
function wrapper() {
|
|
17
|
+
return foo();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
console.log(wrapper.name);
|
|
21
|
+
//=> 'wrapper'
|
|
22
|
+
|
|
23
|
+
mimicFn(wrapper, foo);
|
|
24
|
+
|
|
25
|
+
console.log(wrapper.name);
|
|
26
|
+
//=> 'foo'
|
|
27
|
+
|
|
28
|
+
console.log(wrapper.unicorn);
|
|
29
|
+
//=> '🦄'
|
|
30
|
+
```
|
|
31
|
+
*/
|
|
32
|
+
<
|
|
33
|
+
ArgumentsType extends unknown[],
|
|
34
|
+
ReturnType,
|
|
35
|
+
FunctionType extends (...arguments: ArgumentsType) => ReturnType
|
|
36
|
+
>(
|
|
37
|
+
to: (...arguments: ArgumentsType) => ReturnType,
|
|
38
|
+
from: FunctionType
|
|
39
|
+
): FunctionType;
|
|
40
|
+
|
|
41
|
+
// TODO: Remove this for the next major release, refactor the whole definition to:
|
|
42
|
+
// declare function mimicFn<
|
|
43
|
+
// ArgumentsType extends unknown[],
|
|
44
|
+
// ReturnType,
|
|
45
|
+
// FunctionType extends (...arguments: ArgumentsType) => ReturnType
|
|
46
|
+
// >(
|
|
47
|
+
// to: (...arguments: ArgumentsType) => ReturnType,
|
|
48
|
+
// from: FunctionType
|
|
49
|
+
// ): FunctionType;
|
|
50
|
+
// export = mimicFn;
|
|
51
|
+
default: typeof mimicFn;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export = mimicFn;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const mimicFn = (to, from) => {
|
|
4
|
+
for (const prop of Reflect.ownKeys(from)) {
|
|
5
|
+
Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
return to;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
module.exports = mimicFn;
|
|
12
|
+
// TODO: Remove this for the next major release
|
|
13
|
+
module.exports.default = mimicFn;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
4
4
|
|
|
5
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
6
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mimic-fn",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "Make a function mimic another one",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/mimic-fn",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Sindre Sorhus",
|
|
9
|
+
"email": "sindresorhus@gmail.com",
|
|
10
|
+
"url": "sindresorhus.com"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=6"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"test": "xo && ava && tsd"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"index.js",
|
|
20
|
+
"index.d.ts"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"function",
|
|
24
|
+
"mimic",
|
|
25
|
+
"imitate",
|
|
26
|
+
"rename",
|
|
27
|
+
"copy",
|
|
28
|
+
"inherit",
|
|
29
|
+
"properties",
|
|
30
|
+
"name",
|
|
31
|
+
"func",
|
|
32
|
+
"fn",
|
|
33
|
+
"set",
|
|
34
|
+
"infer",
|
|
35
|
+
"change"
|
|
36
|
+
],
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"ava": "^1.4.1",
|
|
39
|
+
"tsd": "^0.7.1",
|
|
40
|
+
"xo": "^0.24.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# mimic-fn [](https://travis-ci.org/sindresorhus/mimic-fn)
|
|
2
|
+
|
|
3
|
+
> Make a function mimic another one
|
|
4
|
+
|
|
5
|
+
Useful when you wrap a function in another function and like to preserve the original name and other properties.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
$ npm install mimic-fn
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const mimicFn = require('mimic-fn');
|
|
19
|
+
|
|
20
|
+
function foo() {}
|
|
21
|
+
foo.unicorn = '🦄';
|
|
22
|
+
|
|
23
|
+
function wrapper() {
|
|
24
|
+
return foo();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
console.log(wrapper.name);
|
|
28
|
+
//=> 'wrapper'
|
|
29
|
+
|
|
30
|
+
mimicFn(wrapper, foo);
|
|
31
|
+
|
|
32
|
+
console.log(wrapper.name);
|
|
33
|
+
//=> 'foo'
|
|
34
|
+
|
|
35
|
+
console.log(wrapper.unicorn);
|
|
36
|
+
//=> '🦄'
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## API
|
|
41
|
+
|
|
42
|
+
It will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set.
|
|
43
|
+
|
|
44
|
+
### mimicFn(to, from)
|
|
45
|
+
|
|
46
|
+
Modifies the `to` function and returns it.
|
|
47
|
+
|
|
48
|
+
#### to
|
|
49
|
+
|
|
50
|
+
Type: `Function`
|
|
51
|
+
|
|
52
|
+
Mimicking function.
|
|
53
|
+
|
|
54
|
+
#### from
|
|
55
|
+
|
|
56
|
+
Type: `Function`
|
|
57
|
+
|
|
58
|
+
Function to mimic.
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
## Related
|
|
62
|
+
|
|
63
|
+
- [rename-fn](https://github.com/sindresorhus/rename-fn) - Rename a function
|
|
64
|
+
- [keep-func-props](https://github.com/ehmicky/keep-func-props) - Wrap a function without changing its name, length and other properties
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
declare namespace onetime {
|
|
2
|
+
interface Options {
|
|
3
|
+
/**
|
|
4
|
+
Throw an error when called more than once.
|
|
5
|
+
|
|
6
|
+
@default false
|
|
7
|
+
*/
|
|
8
|
+
throw?: boolean;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare const onetime: {
|
|
13
|
+
/**
|
|
14
|
+
Ensure a function is only called once. When called multiple times it will return the return value from the first call.
|
|
15
|
+
|
|
16
|
+
@param fn - Function that should only be called once.
|
|
17
|
+
@returns A function that only calls `fn` once.
|
|
18
|
+
|
|
19
|
+
@example
|
|
20
|
+
```
|
|
21
|
+
import onetime = require('onetime');
|
|
22
|
+
|
|
23
|
+
let i = 0;
|
|
24
|
+
|
|
25
|
+
const foo = onetime(() => ++i);
|
|
26
|
+
|
|
27
|
+
foo(); //=> 1
|
|
28
|
+
foo(); //=> 1
|
|
29
|
+
foo(); //=> 1
|
|
30
|
+
|
|
31
|
+
onetime.callCount(foo); //=> 3
|
|
32
|
+
```
|
|
33
|
+
*/
|
|
34
|
+
<ArgumentsType extends unknown[], ReturnType>(
|
|
35
|
+
fn: (...arguments: ArgumentsType) => ReturnType,
|
|
36
|
+
options?: onetime.Options
|
|
37
|
+
): (...arguments: ArgumentsType) => ReturnType;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
Get the number of times `fn` has been called.
|
|
41
|
+
|
|
42
|
+
@param fn - Function to get call count from.
|
|
43
|
+
@returns A number representing how many times `fn` has been called.
|
|
44
|
+
|
|
45
|
+
@example
|
|
46
|
+
```
|
|
47
|
+
import onetime = require('onetime');
|
|
48
|
+
|
|
49
|
+
const foo = onetime(() => {});
|
|
50
|
+
foo();
|
|
51
|
+
foo();
|
|
52
|
+
foo();
|
|
53
|
+
|
|
54
|
+
console.log(onetime.callCount(foo));
|
|
55
|
+
//=> 3
|
|
56
|
+
```
|
|
57
|
+
*/
|
|
58
|
+
callCount(fn: (...arguments: any[]) => unknown): number;
|
|
59
|
+
|
|
60
|
+
// TODO: Remove this for the next major release
|
|
61
|
+
default: typeof onetime;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export = onetime;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const mimicFn = require('mimic-fn');
|
|
3
|
+
|
|
4
|
+
const calledFunctions = new WeakMap();
|
|
5
|
+
|
|
6
|
+
const onetime = (function_, options = {}) => {
|
|
7
|
+
if (typeof function_ !== 'function') {
|
|
8
|
+
throw new TypeError('Expected a function');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let returnValue;
|
|
12
|
+
let callCount = 0;
|
|
13
|
+
const functionName = function_.displayName || function_.name || '<anonymous>';
|
|
14
|
+
|
|
15
|
+
const onetime = function (...arguments_) {
|
|
16
|
+
calledFunctions.set(onetime, ++callCount);
|
|
17
|
+
|
|
18
|
+
if (callCount === 1) {
|
|
19
|
+
returnValue = function_.apply(this, arguments_);
|
|
20
|
+
function_ = null;
|
|
21
|
+
} else if (options.throw === true) {
|
|
22
|
+
throw new Error(`Function \`${functionName}\` can only be called once`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return returnValue;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
mimicFn(onetime, function_);
|
|
29
|
+
calledFunctions.set(onetime, callCount);
|
|
30
|
+
|
|
31
|
+
return onetime;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
module.exports = onetime;
|
|
35
|
+
// TODO: Remove this for the next major release
|
|
36
|
+
module.exports.default = onetime;
|
|
37
|
+
|
|
38
|
+
module.exports.callCount = function_ => {
|
|
39
|
+
if (!calledFunctions.has(function_)) {
|
|
40
|
+
throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return calledFunctions.get(function_);
|
|
44
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "onetime",
|
|
3
|
+
"version": "5.1.2",
|
|
4
|
+
"description": "Ensure a function is only called once",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/onetime",
|
|
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
|
+
"engines": {
|
|
14
|
+
"node": ">=6"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "xo && ava && tsd"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"index.js",
|
|
21
|
+
"index.d.ts"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"once",
|
|
25
|
+
"function",
|
|
26
|
+
"one",
|
|
27
|
+
"onetime",
|
|
28
|
+
"func",
|
|
29
|
+
"fn",
|
|
30
|
+
"single",
|
|
31
|
+
"call",
|
|
32
|
+
"called",
|
|
33
|
+
"prevent"
|
|
34
|
+
],
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"mimic-fn": "^2.1.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"ava": "^1.4.1",
|
|
40
|
+
"tsd": "^0.7.1",
|
|
41
|
+
"xo": "^0.24.0"
|
|
42
|
+
}
|
|
43
|
+
}
|