decocms 2.281.3 → 2.281.4-alpha.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-BIxJ6Rg9.js → AlertCircle-7JjFgLc7.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-CE40KV1j.js → ArrowNarrowLeft-Dede_Ne2.js} +1 -1
- package/dist/client/assets/{CheckCircle-COmXIEn5.js → CheckCircle-CTW72EON.js} +1 -1
- package/dist/client/assets/{ChevronDown-khwBdZmm.js → ChevronDown-kxc5hHzL.js} +1 -1
- package/dist/client/assets/{ChevronRight-D2N_TrCI.js → ChevronRight-DDbSh6n1.js} +1 -1
- package/dist/client/assets/{ChevronUp-FT6mgGv1.js → ChevronUp-Dp8gBsiQ.js} +1 -1
- package/dist/client/assets/{Container-YuIVovXE.js → Container-DbPEBCPd.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DDaNxuxy.js → LinkExternal01-DGpodMuQ.js} +1 -1
- package/dist/client/assets/{Lock01-CkeABLOV.js → Lock01-DWeyLAgC.js} +1 -1
- package/dist/client/assets/{Palette-CPsljGLa.js → Palette-9DjyOnf4.js} +1 -1
- package/dist/client/assets/{Play-BclVnOKX.js → Play-CGVWyYId.js} +1 -1
- package/dist/client/assets/{Plus-E1YejiXY.js → Plus-BZ8TfrO6.js} +1 -1
- package/dist/client/assets/{SearchMd-CZudW5Cy.js → SearchMd-DiHiiShh.js} +1 -1
- package/dist/client/assets/{Settings02-KYpYe9Yz.js → Settings02-BrMLRmyq.js} +1 -1
- package/dist/client/assets/{Star01-DYPros2N.js → Star01-DOZUyUGI.js} +1 -1
- package/dist/client/assets/{Sun-DMUBYzBg.js → Sun-D9NMWxb1.js} +1 -1
- package/dist/client/assets/{Tool01-BjCpHyDA.js → Tool01-CPwXEQb5.js} +1 -1
- package/dist/client/assets/{Trash01-D8X_Y-CH.js → Trash01-JJPVWHIh.js} +1 -1
- package/dist/client/assets/{Upload01-DORqJLhK.js → Upload01-CAASdeK2.js} +1 -1
- package/dist/client/assets/{User01-BjMDaxtZ.js → User01-DzewYYcp.js} +1 -1
- package/dist/client/assets/{Users03-DvlzurXg.js → Users03-1bfUrVZT.js} +1 -1
- package/dist/client/assets/{X-DGMDFb7Q.js → X-CyqBZIBt.js} +1 -1
- package/dist/client/assets/{XCircle-BBZJUk3l.js → XCircle-C0Pb9VbS.js} +1 -1
- package/dist/client/assets/{Zap-CANzvBCB.js → Zap-WS6KKy8N.js} +1 -1
- package/dist/client/assets/{ZapSquare-CvQHn6nj.js → ZapSquare-DBz9qdVm.js} +1 -1
- package/dist/client/assets/{accordion-jGpS5bKT.js → accordion-iHKIJir4.js} +1 -1
- package/dist/client/assets/{agent-icon-CNfJJZjP.js → agent-icon-OPgA0_xh.js} +1 -1
- package/dist/client/assets/{agents-list-CeP_6hCn.js → agents-list-EtMSypXC.js} +1 -1
- package/dist/client/assets/ai-providers-BkPyz71b.js +1 -0
- package/dist/client/assets/{alert-dialog-Cw0drrbJ.js → alert-dialog-CvUq9c2l.js} +1 -1
- package/dist/client/assets/{auth-catchall-uBOqh0Nn.js → auth-catchall-C2AFIXKV.js} +1 -1
- package/dist/client/assets/{automation-list-row-DUeas6D2.js → automation-list-row-srgvCKZh.js} +1 -1
- package/dist/client/assets/{automations-B24Ufwx2.js → automations-Dp2hsJvG.js} +1 -1
- package/dist/client/assets/{avatar-C3f1_XSr.js → avatar-BAGLgwIy.js} +1 -1
- package/dist/client/assets/{badge-UZcqLVBi.js → badge-Csg5fgRc.js} +1 -1
- package/dist/client/assets/{brand-context-DACRWARm.js → brand-context-D7GISA6v.js} +1 -1
- package/dist/client/assets/{card-BeBnnJUH.js → card-bx_QeXw_.js} +1 -1
- package/dist/client/assets/{chat-context-DJov78wv.js → chat-context-OvrSchhz.js} +1 -1
- package/dist/client/assets/{checkbox-BkumBjmd.js → checkbox-C7KSBfZr.js} +1 -1
- package/dist/client/assets/{collection-detail-Asuy-_1g.js → collection-detail-BcTctJfQ.js} +1 -1
- package/dist/client/assets/{collection-display-button-BzGOL-dZ.js → collection-display-button-B4SGVjCw.js} +1 -1
- package/dist/client/assets/{collection-search-sgztHnmJ.js → collection-search-DOj_zhXC.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BuB667AV.js → collection-table-wrapper-C7ZPBElG.js} +1 -1
- package/dist/client/assets/{collection-tabs-BPMwPHXY.js → collection-tabs-DrO0tDqW.js} +1 -1
- package/dist/client/assets/{collections-BkkHKP6f.js → collections-DRefuj7X.js} +1 -1
- package/dist/client/assets/{command-DwBmBE0l.js → command-CGYZopFY.js} +1 -1
- package/dist/client/assets/{connection-card-dMq-VEuP.js → connection-card-x5-U4xYO.js} +1 -1
- package/dist/client/assets/{connection-detail-pWGU-NlL.js → connection-detail-DNT7n-qD.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-wgUzsGEw.js → connection-form-helpers-Cieg3At7.js} +1 -1
- package/dist/client/assets/{connections-DqsTtENU.js → connections-CcMp0k3e.js} +1 -1
- package/dist/client/assets/{constants-SeBtlxYF.js → constants-BTGWOBGG.js} +1 -1
- package/dist/client/assets/{constants-C8yptWZl.js → constants-DfNucTio.js} +1 -1
- package/dist/client/assets/{dialog-7MxBMRtv.js → dialog-CDZoEVTf.js} +1 -1
- package/dist/client/assets/{drawer-BoWGhEog.js → drawer-BtA5XqsS.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Tf7X_k_G.js → dropdown-menu-DU8JG2pk.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-CAIBwlTg.js → dynamic-plugin-layout-DI-gMMKE.js} +1 -1
- package/dist/client/assets/{empty-state-B0FZL4pN.js → empty-state-B2WkME-3.js} +1 -1
- package/dist/client/assets/{empty-state-DTGu1Fdm.js → empty-state-BxCE5vnH.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DbLaOTrL.js → extract-connection-data-DBjTfzuX.js} +1 -1
- package/dist/client/assets/{features-83PDyWcU.js → features-BTMuaR90.js} +1 -1
- package/dist/client/assets/{form-BmBsjzN0.js → form-nehB0yqt.js} +1 -1
- package/dist/client/assets/{general-DP3Rps2a.js → general-aaZSKs7j.js} +1 -1
- package/dist/client/assets/{index-DHHYfLmC.js → index-0Nuumosr.js} +1 -1
- package/dist/client/assets/{index-BGFEANza.js → index-A1TjNoro.js} +1 -1
- package/dist/client/assets/{index-D2RLcUNw.js → index-BD-lTLoS.js} +1 -1
- package/dist/client/assets/{index-BSSsgGZx.js → index-BFKRaI9q.js} +1 -1
- package/dist/client/assets/{index-DWsq2B99.js → index-C7LpArfe.js} +1 -1
- package/dist/client/assets/{index-aO0TlYPD.js → index-CFqkoEQr.js} +1 -1
- package/dist/client/assets/{index-B6Fe448o.js → index-DkLXfxeF.js} +2 -2
- package/dist/client/assets/{index-BpLvdlDN.js → index-DvGOE4TR.js} +1 -1
- package/dist/client/assets/{index-BkTKyHO8.js → index-FCEJcMKv.js} +4 -4
- package/dist/client/assets/{index-CMwJl8aa.js → index-nsskrYaZ.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BxX_zFxP.js → infiniteQueryObserver-VUPo5ONC.js} +1 -1
- package/dist/client/assets/{input-B6wnc6E0.js → input-Dxp3-aWz.js} +1 -1
- package/dist/client/assets/{integration-icon-BkwkZhee.js → integration-icon-DUduEF01.js} +1 -1
- package/dist/client/assets/{label-5rqczNeH.js → label-BVoDYtUr.js} +1 -1
- package/dist/client/assets/{layout-BEgtojgD.js → layout-C9Y7P28P.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-DZ-xsVMV.js → lean-canvas-recruit-modal-N8EVMVv5.js} +1 -1
- package/dist/client/assets/{login-BuRLGM9E.js → login-kx3MQEcu.js} +1 -1
- package/dist/client/assets/{members-D2SzW3dK.js → members-BucBnRu5.js} +1 -1
- package/dist/client/assets/{monaco-editor-NoBsgNbn.js → monaco-editor-WwGGEq4E.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CNa1Qyhs.js → monitoring-stats-row-D5uhoKE2.js} +1 -1
- package/dist/client/assets/{oauth-callback-aI0Tid7G.js → oauth-callback-BB1bfQ0C.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-EFLM2H1m.js → oauth-callback-ai-provider-Cx11JY4J.js} +1 -1
- package/dist/client/assets/{onboarding-Sr2nWjf7.js → onboarding-CRDp-7ts.js} +1 -1
- package/dist/client/assets/{org-layout-BOB9EMoQ.js → org-layout-DWgxefUR.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-DcKtHUs4.js → org-plugin-layout-B0IS-vI9.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BHovc0r0.js → plugin-empty-state-C9Il8L-B.js} +1 -1
- package/dist/client/assets/{plugin-header-BX67VN7B.js → plugin-header-DF-027xA.js} +1 -1
- package/dist/client/assets/{plugin-layout-BuvVa8nF.js → plugin-layout-CQviDmLQ.js} +1 -1
- package/dist/client/assets/{popover-BU4_Dn9E.js → popover-_s_tQK3Z.js} +1 -1
- package/dist/client/assets/{profile-Y8Sfq9q9.js → profile-BAAvq5PA.js} +1 -1
- package/dist/client/assets/{project-app-view-CCANnsKQ.js → project-app-view-CWfRTdtF.js} +1 -1
- package/dist/client/assets/registry-BO9_rH5u.js +2 -0
- package/dist/client/assets/{registry-layout-Z-9iQ5Hy.js → registry-layout-DQKjQh-i.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Dn_y9pYd.js → required-auth-layout-CXhuopzx.js} +1 -1
- package/dist/client/assets/{reset-password-CyUYFfOn.js → reset-password-DZzWPbSN.js} +1 -1
- package/dist/client/assets/{scroll-area-C_emWPwP.js → scroll-area-hAa33XcH.js} +1 -1
- package/dist/client/assets/{search-input-oxb8hZUf.js → search-input-C61ZvpPR.js} +1 -1
- package/dist/client/assets/{select-CLAiPDa-.js → select-DRB8tE_p.js} +1 -1
- package/dist/client/assets/{select-model-BXWqo7I7.js → select-model-CP81c55I.js} +1 -1
- package/dist/client/assets/settings-layout-UJNERdUa.js +1 -0
- package/dist/client/assets/{shell-layout-BLDfm85U.js → shell-layout-DAhaxub0.js} +1 -1
- package/dist/client/assets/{skeleton-CbLrdMio.js → skeleton-3sAmljB_.js} +1 -1
- package/dist/client/assets/{sso-Ccm_fQKb.js → sso-BmmBRsro.js} +1 -1
- package/dist/client/assets/{store-DbLdk8zH.js → store-Dq5sv0Ed.js} +1 -1
- package/dist/client/assets/store-registry-BfCS4xd0.js +2 -0
- package/dist/client/assets/{switch-CBH6sGXt.js → switch-DL640Ue6.js} +1 -1
- package/dist/client/assets/{table-fKK1m7_o.js → table-Dbi2W1JY.js} +1 -1
- package/dist/client/assets/{tabs-D-EbmTZr.js → tabs-BByMWKiD.js} +1 -1
- package/dist/client/assets/{task-status-Dpnxg-vx.js → task-status-CmmBYEnr.js} +1 -1
- package/dist/client/assets/{textarea-D4ABUBrM.js → textarea-DHlYLEvo.js} +1 -1
- package/dist/client/assets/{toggle-group-CrTmZ_AV.js → toggle-group-CZBEspMS.js} +1 -1
- package/dist/client/assets/{tools-list-CqkfReof.js → tools-list-DuX1kehi.js} +1 -1
- package/dist/client/assets/{types-GM8sGKcZ.js → types-DvTqSron.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Bzstkld8.js → use-ai-providers-ClS89y7X.js} +1 -1
- package/dist/client/assets/{use-collections-CqFt8Ao1.js → use-collections-Dv9KwC2D.js} +1 -1
- package/dist/client/assets/{use-connection-aoJhyCQY.js → use-connection-BmcG6E0P.js} +1 -1
- package/dist/client/assets/{use-copy-M68f6GGE.js → use-copy-BkRNxEwn.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-HCly1WGo.js → use-create-virtual-mcp-CH8VJize.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Dyu5zP68.js → use-decopilot-events-BwyevFSM.js} +1 -1
- package/dist/client/assets/{use-delete-connection-D1fyoOVF.js → use-delete-connection-DfVzQzgY.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DxLzMG99.js → use-infinite-scroll-C0yn-Y6f.js} +1 -1
- package/dist/client/assets/{use-list-state-0zsLkDoY.js → use-list-state-D4yuEOh_.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-B8DbBP0f.js → use-mcp-tools-B1TR0GK5.js} +1 -1
- package/dist/client/assets/{use-members-BwzOWwXP.js → use-members-BSe-l5RV.js} +1 -1
- package/dist/client/assets/{use-mobile-BpFBqyL_.js → use-mobile-D7gj1mMa.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CDDwaLRP.js → use-navigate-to-agent-BOFYFzjJ.js} +1 -1
- package/dist/client/assets/{use-org-sso-tVtj-Uzh.js → use-org-sso-BIx4Rk_Y.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CnHZf6OA.js → use-organization-settings-CcY3Vn-c.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BGlGR_mo.js → use-registry-connections-G41Zams2.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DkqPpB9d.js → use-status-sounds-Cq0X5c0g.js} +1 -1
- package/dist/client/assets/{use-tasks-5lCHGF_c.js → use-tasks-DqpLygvk.js} +1 -1
- package/dist/client/assets/{use-view-mode-DVj5tWV_.js → use-view-mode-hEZSGIRN.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-By_96asb.js → use-virtual-mcp-B0nMlTA1.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-D-Fu49PN.js +1 -0
- package/dist/client/assets/{user-DHkNN6iL.js → user-B-lqJM9i.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Btma8l_9.js → view-mode-toggle-DSiIUGAP.js} +1 -1
- package/dist/client/assets/{workflow-l_Z97b0k.js → workflow-C2B3R0BC.js} +1 -1
- package/dist/client/assets/workflow-detail-EmQ0YEuI.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- 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/mimic-fn/license +9 -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-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 +1 -1
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-C3bM9mct.js +0 -1
- package/dist/client/assets/registry-BbDGhxnL.js +0 -2
- package/dist/client/assets/settings-layout-DealGEF-.js +0 -1
- 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/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/{ansi-styles → ansi-regex}/license +0 -0
- /package/dist/server/node_modules/{get-east-asian-width → figures}/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;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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.
|
|
@@ -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,13 @@
|
|
|
1
|
+
Copyright © 2017, Charmander <~@charmander.me>
|
|
2
|
+
|
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
4
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
5
|
+
copyright notice and this permission notice appear in all copies.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
9
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[![Build status][ci image]][ci]
|
|
2
|
+
|
|
3
|
+
64-bit big-endian signed integer-to-string conversion designed for [pg][].
|
|
4
|
+
|
|
5
|
+
```js
|
|
6
|
+
const readInt8 = require('pg-int8');
|
|
7
|
+
|
|
8
|
+
readInt8(Buffer.from([0, 1, 2, 3, 4, 5, 6, 7]))
|
|
9
|
+
// '283686952306183'
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
[pg]: https://github.com/brianc/node-postgres
|
|
14
|
+
|
|
15
|
+
[ci]: https://travis-ci.org/charmander/pg-int8
|
|
16
|
+
[ci image]: https://api.travis-ci.org/charmander/pg-int8.svg
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// selected so (BASE - 1) * 0x100000000 + 0xffffffff is a safe integer
|
|
4
|
+
var BASE = 1000000;
|
|
5
|
+
|
|
6
|
+
function readInt8(buffer) {
|
|
7
|
+
var high = buffer.readInt32BE(0);
|
|
8
|
+
var low = buffer.readUInt32BE(4);
|
|
9
|
+
var sign = '';
|
|
10
|
+
|
|
11
|
+
if (high < 0) {
|
|
12
|
+
high = ~high + (low === 0);
|
|
13
|
+
low = (~low + 1) >>> 0;
|
|
14
|
+
sign = '-';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var result = '';
|
|
18
|
+
var carry;
|
|
19
|
+
var t;
|
|
20
|
+
var digits;
|
|
21
|
+
var pad;
|
|
22
|
+
var l;
|
|
23
|
+
var i;
|
|
24
|
+
|
|
25
|
+
{
|
|
26
|
+
carry = high % BASE;
|
|
27
|
+
high = high / BASE >>> 0;
|
|
28
|
+
|
|
29
|
+
t = 0x100000000 * carry + low;
|
|
30
|
+
low = t / BASE >>> 0;
|
|
31
|
+
digits = '' + (t - BASE * low);
|
|
32
|
+
|
|
33
|
+
if (low === 0 && high === 0) {
|
|
34
|
+
return sign + digits + result;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
pad = '';
|
|
38
|
+
l = 6 - digits.length;
|
|
39
|
+
|
|
40
|
+
for (i = 0; i < l; i++) {
|
|
41
|
+
pad += '0';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
result = pad + digits + result;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
{
|
|
48
|
+
carry = high % BASE;
|
|
49
|
+
high = high / BASE >>> 0;
|
|
50
|
+
|
|
51
|
+
t = 0x100000000 * carry + low;
|
|
52
|
+
low = t / BASE >>> 0;
|
|
53
|
+
digits = '' + (t - BASE * low);
|
|
54
|
+
|
|
55
|
+
if (low === 0 && high === 0) {
|
|
56
|
+
return sign + digits + result;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
pad = '';
|
|
60
|
+
l = 6 - digits.length;
|
|
61
|
+
|
|
62
|
+
for (i = 0; i < l; i++) {
|
|
63
|
+
pad += '0';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
result = pad + digits + result;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
{
|
|
70
|
+
carry = high % BASE;
|
|
71
|
+
high = high / BASE >>> 0;
|
|
72
|
+
|
|
73
|
+
t = 0x100000000 * carry + low;
|
|
74
|
+
low = t / BASE >>> 0;
|
|
75
|
+
digits = '' + (t - BASE * low);
|
|
76
|
+
|
|
77
|
+
if (low === 0 && high === 0) {
|
|
78
|
+
return sign + digits + result;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
pad = '';
|
|
82
|
+
l = 6 - digits.length;
|
|
83
|
+
|
|
84
|
+
for (i = 0; i < l; i++) {
|
|
85
|
+
pad += '0';
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
result = pad + digits + result;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
{
|
|
92
|
+
carry = high % BASE;
|
|
93
|
+
t = 0x100000000 * carry + low;
|
|
94
|
+
digits = '' + t % BASE;
|
|
95
|
+
|
|
96
|
+
return sign + digits + result;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
module.exports = readInt8;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pg-int8",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "64-bit big-endian signed integer-to-string conversion",
|
|
5
|
+
"bugs": "https://github.com/charmander/pg-int8/issues",
|
|
6
|
+
"license": "ISC",
|
|
7
|
+
"files": [
|
|
8
|
+
"index.js"
|
|
9
|
+
],
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/charmander/pg-int8"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"test": "tap test"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@charmander/eslint-config-base": "1.0.2",
|
|
19
|
+
"tap": "10.7.3"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=4.0.0"
|
|
23
|
+
}
|
|
24
|
+
}
|