decocms 2.279.4 → 2.280.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.
Files changed (228) hide show
  1. package/dist/client/assets/{AlertCircle-CEilS6cR.js → AlertCircle-Dv4ZIM5J.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-DSwx4IX3.js → ArrowNarrowLeft-BvT4bMLP.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-Ko5wAfL7.js → CheckCircle-DeGJG8Ey.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-Be4lVzvR.js → ChevronDown-DA_i6htU.js} +1 -1
  5. package/dist/client/assets/{ChevronRight-Dl1oyiXi.js → ChevronRight-CPnYdMqx.js} +1 -1
  6. package/dist/client/assets/{ChevronUp-Br-o6DqX.js → ChevronUp-BAjyIVOE.js} +1 -1
  7. package/dist/client/assets/{Container-BikrIt05.js → Container-D86p6vhP.js} +1 -1
  8. package/dist/client/assets/{LinkExternal01-DjLDyTuR.js → LinkExternal01-Cfxvdz-p.js} +1 -1
  9. package/dist/client/assets/{Lock01-BWBjIjcA.js → Lock01-DMzDPwhT.js} +1 -1
  10. package/dist/client/assets/{Palette-npxPqkwL.js → Palette-DVhkaDgv.js} +1 -1
  11. package/dist/client/assets/{Play-DsEaCK4x.js → Play-Dx7-OOlg.js} +1 -1
  12. package/dist/client/assets/{Plus-3pgqg7ye.js → Plus-D9-fqNSD.js} +1 -1
  13. package/dist/client/assets/{SearchMd-B1ES2efv.js → SearchMd-DNA-TN_H.js} +1 -1
  14. package/dist/client/assets/{Settings02-CZ8z5m7j.js → Settings02-DQjDcLoY.js} +1 -1
  15. package/dist/client/assets/{Star01-BeBdOnyd.js → Star01-CaUtmy-K.js} +1 -1
  16. package/dist/client/assets/{Sun-DqEjGh0W.js → Sun-CEZa3eLS.js} +1 -1
  17. package/dist/client/assets/{Tool01-sHnbUKmU.js → Tool01-B1xrcBi5.js} +1 -1
  18. package/dist/client/assets/{Trash01-C86SDHba.js → Trash01-B4DTIo_P.js} +1 -1
  19. package/dist/client/assets/{Upload01-DQoYYKo3.js → Upload01-DH1j0KZc.js} +1 -1
  20. package/dist/client/assets/{User01-DisUuiTU.js → User01-BZLj0_M8.js} +1 -1
  21. package/dist/client/assets/{Users03-DPaLThya.js → Users03-DrJ8OfaH.js} +1 -1
  22. package/dist/client/assets/{X-faz11WMu.js → X-DoL-OQpW.js} +1 -1
  23. package/dist/client/assets/{XCircle-DcnOx3o6.js → XCircle-BEVX_MSl.js} +1 -1
  24. package/dist/client/assets/{Zap-RywdJI-6.js → Zap-CAlzQ_SF.js} +1 -1
  25. package/dist/client/assets/{ZapSquare-C2CuBY_F.js → ZapSquare-6X_ovY4u.js} +1 -1
  26. package/dist/client/assets/{accordion-CrXENhKS.js → accordion-DPKwR5jf.js} +1 -1
  27. package/dist/client/assets/{agent-icon-B7tXdvWJ.js → agent-icon-E67drceM.js} +1 -1
  28. package/dist/client/assets/agents-list-Ch7lWVOr.js +1 -0
  29. package/dist/client/assets/ai-providers-nM9qYzBZ.js +1 -0
  30. package/dist/client/assets/{alert-dialog-DPNSWK0C.js → alert-dialog-82nIWhf3.js} +1 -1
  31. package/dist/client/assets/{auth-catchall-DjM7yLtb.js → auth-catchall-BJdcQwN-.js} +1 -1
  32. package/dist/client/assets/{automation-list-row-BaryT-Si.js → automation-list-row-DXJDNS03.js} +1 -1
  33. package/dist/client/assets/{automations-DQbRygJA.js → automations-CkAigK39.js} +1 -1
  34. package/dist/client/assets/{avatar-C6d78R0W.js → avatar-CKWhFcDc.js} +1 -1
  35. package/dist/client/assets/{badge-B1bb6NY8.js → badge-DPuCicf3.js} +1 -1
  36. package/dist/client/assets/{brand-context-ubi86tCi.js → brand-context-xEuKSfj0.js} +1 -1
  37. package/dist/client/assets/{card-VmNXdIl9.js → card-BJoLtmz9.js} +1 -1
  38. package/dist/client/assets/{chat-context-BbZ-RBhM.js → chat-context-Bf3aWPzj.js} +1 -1
  39. package/dist/client/assets/{checkbox-CAGdj4ly.js → checkbox-C12E3_oq.js} +1 -1
  40. package/dist/client/assets/{collection-detail-xWNCvSYV.js → collection-detail-ByVwt639.js} +1 -1
  41. package/dist/client/assets/{collection-display-button-BSyfAyep.js → collection-display-button-CXXhefCT.js} +1 -1
  42. package/dist/client/assets/{collection-search-Dg7Paf_D.js → collection-search-tscZfmSz.js} +1 -1
  43. package/dist/client/assets/{collection-table-wrapper-B24nieNR.js → collection-table-wrapper-C82FjZ_i.js} +1 -1
  44. package/dist/client/assets/{collection-tabs-BiUVPH62.js → collection-tabs-XtEbMyOP.js} +1 -1
  45. package/dist/client/assets/{collections-cNdZZ911.js → collections-8sPPrJ7A.js} +1 -1
  46. package/dist/client/assets/{command-BGAPQAyu.js → command-C8CTcwNt.js} +1 -1
  47. package/dist/client/assets/{connection-card-BaKrYQZ0.js → connection-card-Dfd5kF4A.js} +1 -1
  48. package/dist/client/assets/{connection-detail-10aKIu7_.js → connection-detail-LgljwVBZ.js} +1 -1
  49. package/dist/client/assets/{connection-form-helpers-DDT-e8Qf.js → connection-form-helpers-D1CgFjH6.js} +1 -1
  50. package/dist/client/assets/{connections-BIIoe1Fp.js → connections-welzjCFH.js} +1 -1
  51. package/dist/client/assets/{constants-DOLR7-In.js → constants-CgzsWzve.js} +1 -1
  52. package/dist/client/assets/{constants-OdWrtR0n.js → constants-DlB9FruN.js} +1 -1
  53. package/dist/client/assets/{dialog-BBlf6Y0-.js → dialog-D3TqImE0.js} +1 -1
  54. package/dist/client/assets/{drawer-BoTS4Bqi.js → drawer-1xwox4c6.js} +1 -1
  55. package/dist/client/assets/{dropdown-menu-FXqXZNLp.js → dropdown-menu-ccbFc3oF.js} +1 -1
  56. package/dist/client/assets/{dynamic-plugin-layout-CtgRG0MU.js → dynamic-plugin-layout-C7MWhlg7.js} +1 -1
  57. package/dist/client/assets/{empty-state-X2E_7LTc.js → empty-state-BuT1lOPL.js} +1 -1
  58. package/dist/client/assets/{empty-state-Cs7wxKmu.js → empty-state-C1zz-mei.js} +1 -1
  59. package/dist/client/assets/{extract-connection-data-B-Wb5fIO.js → extract-connection-data-Aua_YhKg.js} +1 -1
  60. package/dist/client/assets/{features-BUxBwL8b.js → features-CXUvkC78.js} +1 -1
  61. package/dist/client/assets/{form-BvPuLp3p.js → form-ruWBs7d7.js} +1 -1
  62. package/dist/client/assets/{general-D2AJdg3z.js → general-DH_bFCOl.js} +1 -1
  63. package/dist/client/assets/{index-C8d--zI5.js → index-AHroOw7q.js} +1 -1
  64. package/dist/client/assets/{index-kfK6OLDe.js → index-BEoI9ZVb.js} +1 -1
  65. package/dist/client/assets/{index-BxxSf9yJ.js → index-BV6L1SjJ.js} +1 -1
  66. package/dist/client/assets/{index-D5d06kaF.js → index-CCmiT65y.js} +1 -1
  67. package/dist/client/assets/{index-Ch9qbqUU.js → index-CQ8ZZoPX.js} +1 -1
  68. package/dist/client/assets/index-CTmUD6-Y.js +739 -0
  69. package/dist/client/assets/index-C_Ncklfg.css +1 -0
  70. package/dist/client/assets/{index-Dorgz0DN.js → index-DJgqpEYW.js} +2 -2
  71. package/dist/client/assets/{index-qeyHcjD9.js → index-DrsCmq1f.js} +1 -1
  72. package/dist/client/assets/{index-s0sdZ5L_.js → index-DumcCt6F.js} +1 -1
  73. package/dist/client/assets/{index-B8be3s7t.js → index-z8VezSz0.js} +1 -1
  74. package/dist/client/assets/{infiniteQueryObserver-hlyWaAvC.js → infiniteQueryObserver-DH4hUCgR.js} +1 -1
  75. package/dist/client/assets/{input-CMnzIdr8.js → input-DV5eim50.js} +1 -1
  76. package/dist/client/assets/{integration-icon-C2aL4IRd.js → integration-icon-D2tCV60I.js} +1 -1
  77. package/dist/client/assets/{label-kikML6oQ.js → label-C86GM8X1.js} +1 -1
  78. package/dist/client/assets/{layout-D47IedlQ.js → layout-DxCigiwD.js} +1 -1
  79. package/dist/client/assets/lean-canvas-recruit-modal-CCGjmni2.js +116 -0
  80. package/dist/client/assets/{login-q3jLGKfv.js → login-DprsK4_L.js} +1 -1
  81. package/dist/client/assets/{members-iNFIg-rI.js → members-B-VFLfzJ.js} +1 -1
  82. package/dist/client/assets/{monaco-editor-DblQESYG.js → monaco-editor-R56ulXRY.js} +1 -1
  83. package/dist/client/assets/{monitoring-stats-row-DcUf2si8.js → monitoring-stats-row--PsDRgYi.js} +1 -1
  84. package/dist/client/assets/{oauth-callback-Dp11GOxx.js → oauth-callback-Ca5_CCq3.js} +1 -1
  85. package/dist/client/assets/{oauth-callback-ai-provider-B60qZO1Q.js → oauth-callback-ai-provider-DDk9IcKl.js} +1 -1
  86. package/dist/client/assets/{onboarding-Ls_Xz5aM.js → onboarding-DerxM89t.js} +1 -1
  87. package/dist/client/assets/{org-layout-D2WgV9rb.js → org-layout-DIERSToF.js} +1 -1
  88. package/dist/client/assets/{org-plugin-layout-CFSIDp0m.js → org-plugin-layout-ClNRZqNK.js} +1 -1
  89. package/dist/client/assets/{plugin-empty-state-CtOhHxMj.js → plugin-empty-state-D0vL52dh.js} +1 -1
  90. package/dist/client/assets/{plugin-header-cYrniSu5.js → plugin-header-DmExVElz.js} +1 -1
  91. package/dist/client/assets/{plugin-layout-DjQ7GFQD.js → plugin-layout-DW3szgLc.js} +1 -1
  92. package/dist/client/assets/{popover-xAirnQIV.js → popover-MsdpfhQu.js} +1 -1
  93. package/dist/client/assets/{profile-NL4vJdwI.js → profile-G3V9Se8H.js} +1 -1
  94. package/dist/client/assets/{project-app-view-DH8ksEqJ.js → project-app-view-8soha8U5.js} +1 -1
  95. package/dist/client/assets/registry-1MdxVVj5.js +2 -0
  96. package/dist/client/assets/{registry-layout-BsuMreOd.js → registry-layout-DmdT-OpW.js} +1 -1
  97. package/dist/client/assets/{required-auth-layout-CkKjV0G_.js → required-auth-layout-CExQRzBC.js} +1 -1
  98. package/dist/client/assets/{reset-password-DEmP_a1g.js → reset-password-CKscqHTM.js} +1 -1
  99. package/dist/client/assets/{scroll-area-UPgVs2bF.js → scroll-area-Co4wJj7O.js} +1 -1
  100. package/dist/client/assets/{search-input-CnrAmvY9.js → search-input-C1TJuPFM.js} +1 -1
  101. package/dist/client/assets/{select-model-BxT0iVSc.js → select-model-FUOpAZDM.js} +1 -1
  102. package/dist/client/assets/{select-C2IlresN.js → select-pAgHYIrL.js} +1 -1
  103. package/dist/client/assets/{settings-layout-Dv5OM4G4.js → settings-layout-DQBzl0lu.js} +1 -1
  104. package/dist/client/assets/{shell-layout-Dd5_p2cO.js → shell-layout-DUNitdZU.js} +1 -1
  105. package/dist/client/assets/{skeleton-CuU32mjh.js → skeleton-qER9eMeG.js} +1 -1
  106. package/dist/client/assets/{sso-DkJ7XF7r.js → sso-CJiIyGby.js} +1 -1
  107. package/dist/client/assets/store-registry-C3XskpEA.js +2 -0
  108. package/dist/client/assets/{store-DRVo25gF.js → store-rkPIhDm8.js} +1 -1
  109. package/dist/client/assets/{switch-WtRCKaAC.js → switch-D5-PzV-X.js} +1 -1
  110. package/dist/client/assets/{table-CDG3Pcei.js → table-DvXCcwv1.js} +1 -1
  111. package/dist/client/assets/{tabs-CvpfD2VC.js → tabs-Ce-3s0xL.js} +1 -1
  112. package/dist/client/assets/{task-status-DkPKuVRh.js → task-status-CffQzU_t.js} +1 -1
  113. package/dist/client/assets/{textarea-DzDNZNQx.js → textarea-BVTjXq38.js} +1 -1
  114. package/dist/client/assets/{toggle-group-ChSEkXLp.js → toggle-group-gsh8C-OR.js} +1 -1
  115. package/dist/client/assets/{tools-list-DWtwkfXV.js → tools-list-PtfMhobA.js} +1 -1
  116. package/dist/client/assets/{types-DpfrgOgc.js → types-BvKkBpVu.js} +1 -1
  117. package/dist/client/assets/{use-ai-providers-DL7syVKl.js → use-ai-providers-B5sNJvkO.js} +1 -1
  118. package/dist/client/assets/{use-collections-CJP9C70C.js → use-collections-BrU9UZ67.js} +1 -1
  119. package/dist/client/assets/{use-connection-Bfx2DpWp.js → use-connection-8il0FBHR.js} +1 -1
  120. package/dist/client/assets/{use-copy-CzzLW-t1.js → use-copy-CyDx0Roq.js} +1 -1
  121. package/dist/client/assets/{use-create-virtual-mcp-DBUGdDxL.js → use-create-virtual-mcp-DVarqFbA.js} +1 -1
  122. package/dist/client/assets/{use-decopilot-events-Co7G03Q-.js → use-decopilot-events-ZWKgln1k.js} +1 -1
  123. package/dist/client/assets/{use-delete-connection-BrJd-KQI.js → use-delete-connection-D0QU8RrP.js} +1 -1
  124. package/dist/client/assets/{use-infinite-scroll-MYeIU5rj.js → use-infinite-scroll-BxyvVOYa.js} +1 -1
  125. package/dist/client/assets/{use-list-state-CmsEU35V.js → use-list-state-DJ-Ih_V8.js} +1 -1
  126. package/dist/client/assets/{use-mcp-tools-BNvGRf7N.js → use-mcp-tools-Dtq2tMkx.js} +1 -1
  127. package/dist/client/assets/{use-members-VPKM2sg7.js → use-members-DJxwunXF.js} +1 -1
  128. package/dist/client/assets/{use-mobile-D_sy_mOx.js → use-mobile-BsrW-Uvz.js} +1 -1
  129. package/dist/client/assets/{use-navigate-to-agent-C8TD8oUz.js → use-navigate-to-agent-IOD6ymJx.js} +1 -1
  130. package/dist/client/assets/{use-org-sso-C8hw6vY4.js → use-org-sso-MYxHdY37.js} +1 -1
  131. package/dist/client/assets/{use-organization-settings-DfMTERs8.js → use-organization-settings-DgEflTxA.js} +1 -1
  132. package/dist/client/assets/{use-registry-connections-zu0-7yyQ.js → use-registry-connections-DOXnVkDT.js} +1 -1
  133. package/dist/client/assets/{use-status-sounds-D7ItdC7B.js → use-status-sounds-Bw0QWLxv.js} +1 -1
  134. package/dist/client/assets/{use-tasks-Cx0JalUc.js → use-tasks-OBM9Y7nP.js} +1 -1
  135. package/dist/client/assets/{use-view-mode-DIuslnT_.js → use-view-mode-BGx43I5y.js} +1 -1
  136. package/dist/client/assets/{use-virtual-mcp-VazaMZSE.js → use-virtual-mcp-zjP22P87.js} +1 -1
  137. package/dist/client/assets/useInfiniteQuery-BE9sdfbg.js +1 -0
  138. package/dist/client/assets/{user-Dy3Y5T-r.js → user-Ct2oIzgq.js} +1 -1
  139. package/dist/client/assets/{view-mode-toggle-BIFsJdKF.js → view-mode-toggle-DG-ttgGl.js} +1 -1
  140. package/dist/client/assets/workflow-detail-BvQnVA1D.js +1 -0
  141. package/dist/client/assets/{workflow-C9tzbaL5.js → workflow-xyFm_Ta1.js} +1 -1
  142. package/dist/client/index.html +2 -2
  143. package/dist/server/cli.js +1 -1
  144. package/dist/server/node_modules/get-east-asian-width/index.d.ts +60 -0
  145. package/dist/server/node_modules/get-east-asian-width/index.js +30 -0
  146. package/dist/server/node_modules/get-east-asian-width/lookup-data.js +18 -0
  147. package/dist/server/node_modules/get-east-asian-width/lookup.js +135 -0
  148. package/dist/server/node_modules/get-east-asian-width/package.json +71 -0
  149. package/dist/server/node_modules/get-east-asian-width/readme.md +65 -0
  150. package/dist/server/node_modules/get-east-asian-width/utilities.js +24 -0
  151. package/dist/server/node_modules/onetime/index.d.ts +64 -0
  152. package/dist/server/node_modules/onetime/index.js +44 -0
  153. package/dist/server/node_modules/{mimic-fn → onetime}/license +1 -1
  154. package/dist/server/node_modules/{mimic-fn → onetime}/package.json +16 -15
  155. package/dist/server/node_modules/onetime/readme.md +94 -0
  156. package/package.json +1 -1
  157. package/dist/client/assets/agents-list-EpavPOW6.js +0 -1
  158. package/dist/client/assets/ai-providers-CMhjDlJa.js +0 -1
  159. package/dist/client/assets/index-BQpr-5K9.js +0 -450
  160. package/dist/client/assets/index-D6N00IK2.css +0 -1
  161. package/dist/client/assets/lean-canvas-recruit-modal-DxUrUDHg.js +0 -116
  162. package/dist/client/assets/registry-ZNk-XnLr.js +0 -2
  163. package/dist/client/assets/store-registry-dHAn3ird.js +0 -2
  164. package/dist/client/assets/useInfiniteQuery-C3Jmw0Ad.js +0 -1
  165. package/dist/client/assets/workflow-detail-bN77di8o.js +0 -1
  166. package/dist/server/node_modules/ansi-styles/index.d.ts +0 -236
  167. package/dist/server/node_modules/ansi-styles/index.js +0 -223
  168. package/dist/server/node_modules/ansi-styles/package.json +0 -54
  169. package/dist/server/node_modules/ansi-styles/readme.md +0 -173
  170. package/dist/server/node_modules/mimic-fn/index.d.ts +0 -54
  171. package/dist/server/node_modules/mimic-fn/index.js +0 -13
  172. package/dist/server/node_modules/mimic-fn/readme.md +0 -69
  173. package/dist/server/node_modules/pg/LICENSE +0 -21
  174. package/dist/server/node_modules/pg/README.md +0 -95
  175. package/dist/server/node_modules/pg/esm/index.mjs +0 -20
  176. package/dist/server/node_modules/pg/lib/client.js +0 -743
  177. package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
  178. package/dist/server/node_modules/pg/lib/connection.js +0 -221
  179. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
  180. package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
  181. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
  182. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
  183. package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
  184. package/dist/server/node_modules/pg/lib/defaults.js +0 -91
  185. package/dist/server/node_modules/pg/lib/index.js +0 -73
  186. package/dist/server/node_modules/pg/lib/native/client.js +0 -323
  187. package/dist/server/node_modules/pg/lib/native/index.js +0 -2
  188. package/dist/server/node_modules/pg/lib/native/query.js +0 -165
  189. package/dist/server/node_modules/pg/lib/query.js +0 -252
  190. package/dist/server/node_modules/pg/lib/result.js +0 -109
  191. package/dist/server/node_modules/pg/lib/stream.js +0 -83
  192. package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
  193. package/dist/server/node_modules/pg/lib/utils.js +0 -217
  194. package/dist/server/node_modules/pg/package.json +0 -76
  195. package/dist/server/node_modules/pg-int8/LICENSE +0 -13
  196. package/dist/server/node_modules/pg-int8/README.md +0 -16
  197. package/dist/server/node_modules/pg-int8/index.js +0 -100
  198. package/dist/server/node_modules/pg-int8/package.json +0 -24
  199. package/dist/server/node_modules/pg-pool/LICENSE +0 -21
  200. package/dist/server/node_modules/pg-pool/README.md +0 -357
  201. package/dist/server/node_modules/pg-pool/esm/index.mjs +0 -5
  202. package/dist/server/node_modules/pg-pool/index.js +0 -517
  203. package/dist/server/node_modules/pg-pool/package.json +0 -51
  204. package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
  205. package/dist/server/node_modules/postgres-array/index.js +0 -97
  206. package/dist/server/node_modules/postgres-array/license +0 -21
  207. package/dist/server/node_modules/postgres-array/package.json +0 -35
  208. package/dist/server/node_modules/postgres-array/readme.md +0 -43
  209. package/dist/server/node_modules/postgres-bytea/index.js +0 -33
  210. package/dist/server/node_modules/postgres-bytea/license +0 -21
  211. package/dist/server/node_modules/postgres-bytea/package.json +0 -34
  212. package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
  213. package/dist/server/node_modules/postgres-date/index.js +0 -116
  214. package/dist/server/node_modules/postgres-date/license +0 -21
  215. package/dist/server/node_modules/postgres-date/package.json +0 -33
  216. package/dist/server/node_modules/postgres-date/readme.md +0 -49
  217. package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
  218. package/dist/server/node_modules/postgres-interval/index.js +0 -125
  219. package/dist/server/node_modules/postgres-interval/license +0 -21
  220. package/dist/server/node_modules/postgres-interval/package.json +0 -36
  221. package/dist/server/node_modules/postgres-interval/readme.md +0 -48
  222. package/dist/server/node_modules/split2/LICENSE +0 -13
  223. package/dist/server/node_modules/split2/README.md +0 -85
  224. package/dist/server/node_modules/split2/bench.js +0 -27
  225. package/dist/server/node_modules/split2/index.js +0 -141
  226. package/dist/server/node_modules/split2/package.json +0 -39
  227. package/dist/server/node_modules/split2/test.js +0 -409
  228. /package/dist/server/node_modules/{ansi-styles → get-east-asian-width}/license +0 -0
@@ -0,0 +1,60 @@
1
+ export type WidthType = 'fullwidth' | 'halfwidth' | 'wide' | 'narrow' | 'neutral' | 'ambiguous';
2
+
3
+ export type Options = {
4
+ /**
5
+ Whether to treat an `'ambiguous'` character as wide.
6
+
7
+ @default true
8
+
9
+ @example
10
+ ```
11
+ import {eastAsianWidth} from 'get-east-asian-width';
12
+
13
+ const codePoint = '⛣'.codePointAt(0);
14
+
15
+ console.log(eastAsianWidth(codePoint));
16
+ //=> 1
17
+
18
+ console.log(eastAsianWidth(codePoint, {ambiguousAsWide: true}));
19
+ //=> 2
20
+ ```
21
+
22
+ > 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.__
23
+ > - http://www.unicode.org/reports/tr11/
24
+ */
25
+ readonly ambiguousAsWide?: boolean;
26
+ };
27
+
28
+ /**
29
+ Returns the width as a number for the given code point.
30
+
31
+ @param codePoint - A Unicode code point.
32
+
33
+ @example
34
+ ```
35
+ import {eastAsianWidth} from 'get-east-asian-width';
36
+
37
+ const codePoint = '字'.codePointAt(0);
38
+
39
+ console.log(eastAsianWidth(codePoint));
40
+ //=> 2
41
+ ```
42
+ */
43
+ export function eastAsianWidth(codePoint: number, options?: Options): 1 | 2;
44
+
45
+ /**
46
+ Returns the type of “East Asian Width” for the given code point.
47
+
48
+ @param codePoint - A Unicode code point.
49
+
50
+ @example
51
+ ```
52
+ import {eastAsianWidthType} from 'get-east-asian-width';
53
+
54
+ const codePoint = '字'.codePointAt(0);
55
+
56
+ console.log(eastAsianWidthType(codePoint));
57
+ //=> 'wide'
58
+ ```
59
+ */
60
+ export function eastAsianWidthType(codePoint: number): WidthType;
@@ -0,0 +1,30 @@
1
+ import {getCategory, isAmbiguous, isFullWidth, isWide} from './lookup.js';
2
+
3
+ function validate(codePoint) {
4
+ if (!Number.isSafeInteger(codePoint)) {
5
+ throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
6
+ }
7
+ }
8
+
9
+ export function eastAsianWidthType(codePoint) {
10
+ validate(codePoint);
11
+
12
+ return getCategory(codePoint);
13
+ }
14
+
15
+ export function eastAsianWidth(codePoint, {ambiguousAsWide = false} = {}) {
16
+ validate(codePoint);
17
+
18
+ if (
19
+ isFullWidth(codePoint)
20
+ || isWide(codePoint)
21
+ || (ambiguousAsWide && isAmbiguous(codePoint))
22
+ ) {
23
+ return 2;
24
+ }
25
+
26
+ return 1;
27
+ }
28
+
29
+ // Private exports for https://github.com/sindresorhus/is-fullwidth-code-point
30
+ export {isFullWidth as _isFullWidth, isWide as _isWide} from './lookup.js';
@@ -0,0 +1,18 @@
1
+ // Generated by scripts/build.js
2
+
3
+ // prettier-ignore
4
+ const ambiguousRanges = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109];
5
+
6
+ // prettier-ignore
7
+ const fullwidthRanges = [12288, 12288, 65281, 65376, 65504, 65510];
8
+
9
+ // prettier-ignore
10
+ const halfwidthRanges = [8361, 8361, 65377, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65512, 65518];
11
+
12
+ // prettier-ignore
13
+ const narrowRanges = [32, 126, 162, 163, 165, 166, 172, 172, 175, 175, 10214, 10221, 10629, 10630];
14
+
15
+ // prettier-ignore
16
+ const wideRanges = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101589, 101631, 101662, 101760, 101874, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128728, 128732, 128735, 128747, 128748, 128756, 128764, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129674, 129678, 129734, 129736, 129736, 129741, 129756, 129759, 129770, 129775, 129784, 131072, 196605, 196608, 262141];
17
+
18
+ export {ambiguousRanges, fullwidthRanges, halfwidthRanges, narrowRanges, wideRanges};
@@ -0,0 +1,135 @@
1
+ import {
2
+ ambiguousRanges,
3
+ fullwidthRanges,
4
+ halfwidthRanges,
5
+ narrowRanges,
6
+ wideRanges,
7
+ } from './lookup-data.js';
8
+ import {isInRange} from './utilities.js';
9
+
10
+ const minimumAmbiguousCodePoint = ambiguousRanges[0];
11
+ const maximumAmbiguousCodePoint = ambiguousRanges.at(-1);
12
+ const minimumFullWidthCodePoint = fullwidthRanges[0];
13
+ const maximumFullWidthCodePoint = fullwidthRanges.at(-1);
14
+ const minimumHalfWidthCodePoint = halfwidthRanges[0];
15
+ const maximumHalfWidthCodePoint = halfwidthRanges.at(-1);
16
+ const minimumNarrowCodePoint = narrowRanges[0];
17
+ const maximumNarrowCodePoint = narrowRanges.at(-1);
18
+ const minimumWideCodePoint = wideRanges[0];
19
+ const maximumWideCodePoint = wideRanges.at(-1);
20
+
21
+ const commonCjkCodePoint = 0x4E_00;
22
+ const [wideFastPathStart, wideFastPathEnd] = findWideFastPathRange(wideRanges);
23
+
24
+ // Use a hot-path range so common `isWide` calls can skip binary search.
25
+ // The range containing U+4E00 covers common CJK ideographs;
26
+ // fallback to the largest range for resilience to Unicode table changes.
27
+ function findWideFastPathRange(ranges) {
28
+ let fastPathStart = ranges[0];
29
+ let fastPathEnd = ranges[1];
30
+
31
+ for (let index = 0; index < ranges.length; index += 2) {
32
+ const start = ranges[index];
33
+ const end = ranges[index + 1];
34
+
35
+ if (
36
+ commonCjkCodePoint >= start
37
+ && commonCjkCodePoint <= end
38
+ ) {
39
+ return [start, end];
40
+ }
41
+
42
+ if ((end - start) > (fastPathEnd - fastPathStart)) {
43
+ fastPathStart = start;
44
+ fastPathEnd = end;
45
+ }
46
+ }
47
+
48
+ return [fastPathStart, fastPathEnd];
49
+ }
50
+
51
+ export const isAmbiguous = codePoint => {
52
+ if (
53
+ codePoint < minimumAmbiguousCodePoint
54
+ || codePoint > maximumAmbiguousCodePoint
55
+ ) {
56
+ return false;
57
+ }
58
+
59
+ return isInRange(ambiguousRanges, codePoint);
60
+ };
61
+
62
+ export const isFullWidth = codePoint => {
63
+ if (
64
+ codePoint < minimumFullWidthCodePoint
65
+ || codePoint > maximumFullWidthCodePoint
66
+ ) {
67
+ return false;
68
+ }
69
+
70
+ return isInRange(fullwidthRanges, codePoint);
71
+ };
72
+
73
+ const isHalfWidth = codePoint => {
74
+ if (
75
+ codePoint < minimumHalfWidthCodePoint
76
+ || codePoint > maximumHalfWidthCodePoint
77
+ ) {
78
+ return false;
79
+ }
80
+
81
+ return isInRange(halfwidthRanges, codePoint);
82
+ };
83
+
84
+ const isNarrow = codePoint => {
85
+ if (
86
+ codePoint < minimumNarrowCodePoint
87
+ || codePoint > maximumNarrowCodePoint
88
+ ) {
89
+ return false;
90
+ }
91
+
92
+ return isInRange(narrowRanges, codePoint);
93
+ };
94
+
95
+ export const isWide = codePoint => {
96
+ if (
97
+ codePoint >= wideFastPathStart
98
+ && codePoint <= wideFastPathEnd
99
+ ) {
100
+ return true;
101
+ }
102
+
103
+ if (
104
+ codePoint < minimumWideCodePoint
105
+ || codePoint > maximumWideCodePoint
106
+ ) {
107
+ return false;
108
+ }
109
+
110
+ return isInRange(wideRanges, codePoint);
111
+ };
112
+
113
+ export function getCategory(codePoint) {
114
+ if (isAmbiguous(codePoint)) {
115
+ return 'ambiguous';
116
+ }
117
+
118
+ if (isFullWidth(codePoint)) {
119
+ return 'fullwidth';
120
+ }
121
+
122
+ if (isHalfWidth(codePoint)) {
123
+ return 'halfwidth';
124
+ }
125
+
126
+ if (isNarrow(codePoint)) {
127
+ return 'narrow';
128
+ }
129
+
130
+ if (isWide(codePoint)) {
131
+ return 'wide';
132
+ }
133
+
134
+ return 'neutral';
135
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "get-east-asian-width",
3
+ "version": "1.5.0",
4
+ "description": "Determine the East Asian Width of a Unicode character",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/get-east-asian-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 && tsc index.d.ts",
24
+ "build": "node scripts/build.js",
25
+ "prepublish": "npm run build"
26
+ },
27
+ "files": [
28
+ "index.js",
29
+ "index.d.ts",
30
+ "lookup.js",
31
+ "lookup-data.js",
32
+ "utilities.js"
33
+ ],
34
+ "keywords": [
35
+ "unicode",
36
+ "east-asian-width",
37
+ "eastasianwidth",
38
+ "character",
39
+ "string",
40
+ "width",
41
+ "text",
42
+ "layout",
43
+ "alignment",
44
+ "fullwidth",
45
+ "halfwidth",
46
+ "ambiguous",
47
+ "narrow",
48
+ "wide",
49
+ "neutral",
50
+ "typography",
51
+ "japanese",
52
+ "chinese",
53
+ "korean",
54
+ "codepoint",
55
+ "text-processing",
56
+ "i18n",
57
+ "l10n"
58
+ ],
59
+ "devDependencies": {
60
+ "ava": "^5.3.1",
61
+ "outdent": "^0.8.0",
62
+ "simplify-ranges": "^0.1.0",
63
+ "typescript": "^5.2.2",
64
+ "xo": "^0.56.0"
65
+ },
66
+ "xo": {
67
+ "ignores": [
68
+ "lookup-data.js"
69
+ ]
70
+ }
71
+ }
@@ -0,0 +1,65 @@
1
+ # get-east-asian-width
2
+
3
+ > Determine the [East Asian Width](https://unicode.org/reports/tr11/) of a Unicode character
4
+
5
+ > East Asian Width categorizes Unicode characters based on their occupied space in East Asian typography, which helps in text layout and alignment, particularly in languages like Japanese, Chinese, and Korean.
6
+
7
+ Unlike other similar packages, this package uses the latest Unicode data (which changes each year).
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ npm install get-east-asian-width
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```js
18
+ import {eastAsianWidth, eastAsianWidthType} from 'get-east-asian-width';
19
+
20
+ const codePoint = '字'.codePointAt(0);
21
+
22
+ console.log(eastAsianWidth(codePoint));
23
+ //=> 2
24
+
25
+ console.log(eastAsianWidthType(codePoint));
26
+ //=> 'wide'
27
+ ```
28
+
29
+ ## `eastAsianWidth(codePoint: number, options?: object): 1 | 2`
30
+
31
+ Returns the width as a number for the given code point.
32
+
33
+ ### options
34
+
35
+ Type: `object`
36
+
37
+ #### ambiguousAsWide
38
+
39
+ Type: `boolean`\
40
+ Default: `false`
41
+
42
+ Whether to treat an `'ambiguous'` character as wide.
43
+
44
+ ```js
45
+ import {eastAsianWidth} from 'get-east-asian-width';
46
+
47
+ const codePoint = '⛣'.codePointAt(0);
48
+
49
+ console.log(eastAsianWidth(codePoint));
50
+ //=> 1
51
+
52
+ console.log(eastAsianWidth(codePoint, {ambiguousAsWide: true}));
53
+ //=> 2
54
+ ```
55
+
56
+ > 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.**
57
+ > - http://www.unicode.org/reports/tr11/
58
+
59
+ ## `eastAsianWidthType(codePoint: number): 'fullwidth' | 'halfwidth' | 'wide' | 'narrow' | 'neutral' | 'ambiguous'`
60
+
61
+ Returns the type of “East Asian Width” for the given code point.
62
+
63
+ ## Related
64
+
65
+ - [string-width](https://github.com/sindresorhus/string-width) - Get the visual width of a string
@@ -0,0 +1,24 @@
1
+ /**
2
+ Binary search on a sorted flat array of [start, end] pairs.
3
+
4
+ @param {number[]} ranges - Flat array of inclusive [start, end] range pairs, e.g. [0, 5, 10, 20].
5
+ @param {number} codePoint - The value to search for.
6
+ @returns {boolean} Whether the value falls within any of the ranges.
7
+ */
8
+ export const isInRange = (ranges, codePoint) => {
9
+ let low = 0;
10
+ let high = Math.floor(ranges.length / 2) - 1;
11
+ while (low <= high) {
12
+ const mid = Math.floor((low + high) / 2);
13
+ const i = mid * 2;
14
+ if (codePoint < ranges[i]) {
15
+ high = mid - 1;
16
+ } else if (codePoint > ranges[i + 1]) {
17
+ low = mid + 1;
18
+ } else {
19
+ return true;
20
+ }
21
+ }
22
+
23
+ return false;
24
+ };
@@ -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
+ };
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://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
 
@@ -1,13 +1,14 @@
1
1
  {
2
- "name": "mimic-fn",
3
- "version": "2.1.0",
4
- "description": "Make a function mimic another one",
2
+ "name": "onetime",
3
+ "version": "5.1.2",
4
+ "description": "Ensure a function is only called once",
5
5
  "license": "MIT",
6
- "repository": "sindresorhus/mimic-fn",
6
+ "repository": "sindresorhus/onetime",
7
+ "funding": "https://github.com/sponsors/sindresorhus",
7
8
  "author": {
8
9
  "name": "Sindre Sorhus",
9
10
  "email": "sindresorhus@gmail.com",
10
- "url": "sindresorhus.com"
11
+ "url": "https://sindresorhus.com"
11
12
  },
12
13
  "engines": {
13
14
  "node": ">=6"
@@ -20,20 +21,20 @@
20
21
  "index.d.ts"
21
22
  ],
22
23
  "keywords": [
24
+ "once",
23
25
  "function",
24
- "mimic",
25
- "imitate",
26
- "rename",
27
- "copy",
28
- "inherit",
29
- "properties",
30
- "name",
26
+ "one",
27
+ "onetime",
31
28
  "func",
32
29
  "fn",
33
- "set",
34
- "infer",
35
- "change"
30
+ "single",
31
+ "call",
32
+ "called",
33
+ "prevent"
36
34
  ],
35
+ "dependencies": {
36
+ "mimic-fn": "^2.1.0"
37
+ },
37
38
  "devDependencies": {
38
39
  "ava": "^1.4.1",
39
40
  "tsd": "^0.7.1",
@@ -0,0 +1,94 @@
1
+ # onetime [![Build Status](https://travis-ci.com/sindresorhus/onetime.svg?branch=master)](https://travis-ci.com/github/sindresorhus/onetime)
2
+
3
+ > Ensure a function is only called once
4
+
5
+ When called multiple times it will return the return value from the first call.
6
+
7
+ *Unlike the module [once](https://github.com/isaacs/once), this one isn't naughty and extending `Function.prototype`.*
8
+
9
+ ## Install
10
+
11
+ ```
12
+ $ npm install onetime
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```js
18
+ const onetime = require('onetime');
19
+
20
+ let i = 0;
21
+
22
+ const foo = onetime(() => ++i);
23
+
24
+ foo(); //=> 1
25
+ foo(); //=> 1
26
+ foo(); //=> 1
27
+
28
+ onetime.callCount(foo); //=> 3
29
+ ```
30
+
31
+ ```js
32
+ const onetime = require('onetime');
33
+
34
+ const foo = onetime(() => {}, {throw: true});
35
+
36
+ foo();
37
+
38
+ foo();
39
+ //=> Error: Function `foo` can only be called once
40
+ ```
41
+
42
+ ## API
43
+
44
+ ### onetime(fn, options?)
45
+
46
+ Returns a function that only calls `fn` once.
47
+
48
+ #### fn
49
+
50
+ Type: `Function`
51
+
52
+ Function that should only be called once.
53
+
54
+ #### options
55
+
56
+ Type: `object`
57
+
58
+ ##### throw
59
+
60
+ Type: `boolean`\
61
+ Default: `false`
62
+
63
+ Throw an error when called more than once.
64
+
65
+ ### onetime.callCount(fn)
66
+
67
+ Returns a number representing how many times `fn` has been called.
68
+
69
+ Note: It throws an error if you pass in a function that is not wrapped by `onetime`.
70
+
71
+ ```js
72
+ const onetime = require('onetime');
73
+
74
+ const foo = onetime(() => {});
75
+
76
+ foo();
77
+ foo();
78
+ foo();
79
+
80
+ console.log(onetime.callCount(foo));
81
+ //=> 3
82
+ ```
83
+
84
+ #### fn
85
+
86
+ Type: `Function`
87
+
88
+ Function to get call count from.
89
+
90
+ ## onetime for enterprise
91
+
92
+ Available as part of the Tidelift Subscription.
93
+
94
+ The maintainers of onetime and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-onetime?utm_source=npm-onetime&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "2.279.4",
3
+ "version": "2.280.0",
4
4
  "description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "repository": {