decocms 2.310.2 → 2.310.3

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 (199) hide show
  1. package/dist/client/assets/{AlertCircle-Bjs1DRoe.js → AlertCircle-B72APkrz.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-4-qtN4yo.js → ArrowNarrowLeft-Dz0P9WNF.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-TOJd4tk1.js → ArrowUpRight-CCQZEQ7k.js} +1 -1
  4. package/dist/client/assets/{Check-uCeCY94f.js → Check-CUpq9BBu.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-BYjzCjZv.js → CheckCircle-DTCxFilU.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-BCKKMGkp.js → ChevronDown-D5WF5tyi.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-CBRO8ebn.js → ChevronRight-DwbV0YDZ.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-CImlARUB.js → ChevronUp-CDMPc0ql.js} +1 -1
  9. package/dist/client/assets/{Container-UmsQv9ox.js → Container-BioZd28q.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-DYz9Xowp.js → DotsVertical-D8wcDPCU.js} +1 -1
  11. package/dist/client/assets/{LinkExternal01-MfoA7_8K.js → LinkExternal01-CKpEz_fF.js} +1 -1
  12. package/dist/client/assets/{Lock01-DY0dR_EF.js → Lock01-CHfwR6Qi.js} +1 -1
  13. package/dist/client/assets/{Palette-CYlPasQS.js → Palette-brLBiHpP.js} +1 -1
  14. package/dist/client/assets/{Play-BOunn_Vy.js → Play-DRCdZRLW.js} +1 -1
  15. package/dist/client/assets/{Plus-DJQM2qca.js → Plus-DNkjVBwq.js} +1 -1
  16. package/dist/client/assets/{RefreshCcw01-fb__YhOw.js → RefreshCcw01-CdP9yH0w.js} +1 -1
  17. package/dist/client/assets/{SearchMd-Bv6wAjVm.js → SearchMd-JqX1mLMq.js} +1 -1
  18. package/dist/client/assets/{Settings02-ZxqKPBpN.js → Settings02-D1Jfvo1d.js} +1 -1
  19. package/dist/client/assets/{Shield01-DLP8JywO.js → Shield01-D5fQpAyA.js} +1 -1
  20. package/dist/client/assets/{Star01-DO3o-Tm0.js → Star01-Y834gtsL.js} +1 -1
  21. package/dist/client/assets/{Sun-CZnXZvsq.js → Sun-BgOSswUu.js} +1 -1
  22. package/dist/client/assets/{Tool01-D8__PXyN.js → Tool01-CXQZ3p7Z.js} +1 -1
  23. package/dist/client/assets/{Trash01-CaQDsaot.js → Trash01-B8-uqWxa.js} +1 -1
  24. package/dist/client/assets/{User01-oR5RStEl.js → User01-Cxb6YtJq.js} +1 -1
  25. package/dist/client/assets/{Users03-BsIZE4Pm.js → Users03-CXkopkPu.js} +1 -1
  26. package/dist/client/assets/{X-vjP4Msb7.js → X-CdXDgTcN.js} +1 -1
  27. package/dist/client/assets/{XCircle-Bjg8qJ8l.js → XCircle-CjR4LC4r.js} +1 -1
  28. package/dist/client/assets/{XClose-CaKKQVXU.js → XClose-zqTFiPq2.js} +1 -1
  29. package/dist/client/assets/{Zap-CSBwa9kl.js → Zap--FKeiDFf.js} +1 -1
  30. package/dist/client/assets/{ZapSquare-B2TPVAEq.js → ZapSquare-CliIuzcs.js} +1 -1
  31. package/dist/client/assets/{accordion-BtvBKlj9.js → accordion-BBKL1fM-.js} +1 -1
  32. package/dist/client/assets/{agent-icon-BwpnpUbm.js → agent-icon-CaG-DX2m.js} +1 -1
  33. package/dist/client/assets/{agents-list-DO7W3l8_.js → agents-list-BUqQO9y3.js} +1 -1
  34. package/dist/client/assets/ai-providers-BvV5AI1b.js +1 -0
  35. package/dist/client/assets/{alert-dialog-C-BRVgvu.js → alert-dialog-B-P8jHly.js} +1 -1
  36. package/dist/client/assets/{auth-catchall-CutI2kmj.js → auth-catchall-CyIMPFaS.js} +1 -1
  37. package/dist/client/assets/{automation-list-row-DAEvSBmb.js → automation-list-row-Qk3UXtKg.js} +1 -1
  38. package/dist/client/assets/{automations-CgXPCVHi.js → automations-CkkIdwK3.js} +1 -1
  39. package/dist/client/assets/{avatar-DMfNBsEa.js → avatar-CYyuZ3vB.js} +1 -1
  40. package/dist/client/assets/{badge-IDvBfH3R.js → badge-C-R5WeFR.js} +1 -1
  41. package/dist/client/assets/{brand-context-BJ_Ok-7-.js → brand-context-BqPn2XVA.js} +1 -1
  42. package/dist/client/assets/{card-CvuzGHjO.js → card-BWjsP1pO.js} +1 -1
  43. package/dist/client/assets/{chat-context-CErwb6k6.js → chat-context-D7DJNKEQ.js} +1 -1
  44. package/dist/client/assets/{checkbox-Dl75QnG7.js → checkbox-DRyB8BVf.js} +1 -1
  45. package/dist/client/assets/{collection-detail-D1GYoMQ-.js → collection-detail-BiG3-7wS.js} +1 -1
  46. package/dist/client/assets/{collection-display-button-DuQih4HO.js → collection-display-button-D0yyhe94.js} +1 -1
  47. package/dist/client/assets/{collection-search-FABAZQZ-.js → collection-search-BtC9EgTH.js} +1 -1
  48. package/dist/client/assets/{collection-search-BbV_T-EE.js → collection-search-CVa4reVh.js} +1 -1
  49. package/dist/client/assets/{collection-table-wrapper-BOjY1N-o.js → collection-table-wrapper-C2Zi2ikn.js} +1 -1
  50. package/dist/client/assets/{collection-tabs-D9DYouIo.js → collection-tabs-8bicuWoG.js} +1 -1
  51. package/dist/client/assets/{collections-CWT6-czY.js → collections-ZqRHYd6U.js} +1 -1
  52. package/dist/client/assets/{command-BcVlajkv.js → command-BUJHwA-d.js} +1 -1
  53. package/dist/client/assets/{connection-card-5Wnkn35H.js → connection-card-CiNzXirJ.js} +1 -1
  54. package/dist/client/assets/{connection-detail-9LTY8cEq.js → connection-detail-DQFCqOq5.js} +1 -1
  55. package/dist/client/assets/{connection-form-helpers-D_o8vWS8.js → connection-form-helpers-BFnOvbFy.js} +1 -1
  56. package/dist/client/assets/{connections-B0_zSoBW.js → connections-BzqA2cUL.js} +1 -1
  57. package/dist/client/assets/{constants-Ccic_WNi.js → constants-BmLTAQzq.js} +1 -1
  58. package/dist/client/assets/{constants-BgsGWL53.js → constants-Df56C9B1.js} +1 -1
  59. package/dist/client/assets/{dialog-BG4etlBR.js → dialog-HqMwvS0c.js} +1 -1
  60. package/dist/client/assets/{domain-settings-DrdMk60b.js → domain-settings-8zUtZk7o.js} +1 -1
  61. package/dist/client/assets/{drawer-Buc4-066.js → drawer-hkToOxOG.js} +1 -1
  62. package/dist/client/assets/{dropdown-menu-C5QgSZ0t.js → dropdown-menu-CD1YJIi0.js} +1 -1
  63. package/dist/client/assets/{dynamic-plugin-layout-CaV8IAmp.js → dynamic-plugin-layout--sGvQXk2.js} +1 -1
  64. package/dist/client/assets/{empty-state-CcdlS-eW.js → empty-state-B29HN9Vl.js} +1 -1
  65. package/dist/client/assets/{empty-state-CAqrQ-6W.js → empty-state-CElAqeAn.js} +1 -1
  66. package/dist/client/assets/{extract-connection-data-DbON8nO3.js → extract-connection-data-DYXiFLZH.js} +1 -1
  67. package/dist/client/assets/{features-ByRqjbyV.js → features-Dvru3uGD.js} +1 -1
  68. package/dist/client/assets/{form-BbDzJOpZ.js → form-CKajJk24.js} +1 -1
  69. package/dist/client/assets/{general-e5vvtodI.js → general-D8u2dVV2.js} +1 -1
  70. package/dist/client/assets/{index-CAEMKqmE.js → index--52kuhAD.js} +1 -1
  71. package/dist/client/assets/{index-BdxUoNpQ.js → index-BPbckF-i.js} +3 -3
  72. package/dist/client/assets/{index-C6BloEPE.js → index-BPgW_PVH.js} +1 -1
  73. package/dist/client/assets/index-BTded5vd.js +1 -0
  74. package/dist/client/assets/{index-BYF0TDJs.js → index-Boo37gVZ.js} +1 -1
  75. package/dist/client/assets/{index-17qzAK95.js → index-CHpjwsZ-.js} +1 -1
  76. package/dist/client/assets/{index-Bt0njY-h.js → index-CMbhqARA.js} +1 -1
  77. package/dist/client/assets/{index-DDAuFNoU.js → index-CO402MfB.js} +1 -1
  78. package/dist/client/assets/{index-BZSXOPw-.js → index-CgQG3OxM.js} +1 -1
  79. package/dist/client/assets/{index-BBwsyhew.js → index-ClxNnAsp.js} +1 -1
  80. package/dist/client/assets/{index-Bu6OchAc.js → index-CnR4TnGO.js} +1 -1
  81. package/dist/client/assets/{index-Bo98JLt6.js → index-D7rGFiVq.js} +1 -1
  82. package/dist/client/assets/{index-B-lZvo-3.js → index-D9-ppQFz.js} +1 -1
  83. package/dist/client/assets/{index-DwFLYZMx.js → index-DVk4aJ0j.js} +1 -1
  84. package/dist/client/assets/{index-viV87izi.js → index-Y4klGMPr.js} +1 -1
  85. package/dist/client/assets/{index-CsPnm66A.js → index-k8njt3_A.js} +2 -2
  86. package/dist/client/assets/{infiniteQueryObserver-BD3sb9pN.js → infiniteQueryObserver-IG8f9wWg.js} +1 -1
  87. package/dist/client/assets/{input-BOyPyslv.js → input-DrFzs1Yw.js} +1 -1
  88. package/dist/client/assets/{integration-icon-BXKm0FXI.js → integration-icon-DUMCOZJc.js} +1 -1
  89. package/dist/client/assets/{label-C1HjlN95.js → label-0J4Z8Ji8.js} +1 -1
  90. package/dist/client/assets/{layout-BoLVBNZl.js → layout-zbF9c9kI.js} +1 -1
  91. package/dist/client/assets/{lean-canvas-recruit-modal-BXaOF7Ji.js → lean-canvas-recruit-modal-D2QgFiqW.js} +1 -1
  92. package/dist/client/assets/{login-BNbNZ57q.js → login-m1plet6k.js} +1 -1
  93. package/dist/client/assets/{members-CZREN_th.js → members-DsVQeYYP.js} +1 -1
  94. package/dist/client/assets/{monaco-editor-3btV5byi.js → monaco-editor-Br1M5lwR.js} +1 -1
  95. package/dist/client/assets/{monitoring-stats-row-TeqbUQfb.js → monitoring-stats-row-BtBHpMXc.js} +1 -1
  96. package/dist/client/assets/{oauth-callback-CASHqw5B.js → oauth-callback-D6DOFeyW.js} +1 -1
  97. package/dist/client/assets/{oauth-callback-ai-provider-DRX_3ZGd.js → oauth-callback-ai-provider-wUhwntlH.js} +1 -1
  98. package/dist/client/assets/{onboarding-snq0kuQC.js → onboarding-dml5YruP.js} +1 -1
  99. package/dist/client/assets/{org-layout-BlsnG8tD.js → org-layout-QSP-N9k0.js} +1 -1
  100. package/dist/client/assets/{org-plugin-layout-CkIHlyUf.js → org-plugin-layout-ZONr0rlX.js} +1 -1
  101. package/dist/client/assets/{pair-DoCidCoS.js → pair-mf97TAS_.js} +2 -2
  102. package/dist/client/assets/{plugin-empty-state-BEExeVzS.js → plugin-empty-state-CFxEUNdF.js} +1 -1
  103. package/dist/client/assets/{plugin-header-DONB160y.js → plugin-header-HXnwUdYS.js} +1 -1
  104. package/dist/client/assets/{plugin-layout-LrDjSSJL.js → plugin-layout-ZwMLw5wK.js} +1 -1
  105. package/dist/client/assets/{popover-DJTDvTFH.js → popover-DUMNq33j.js} +1 -1
  106. package/dist/client/assets/{profile-DvNhWfFq.js → profile-CyqjRQfg.js} +1 -1
  107. package/dist/client/assets/{project-app-view-DH36c9up.js → project-app-view-Di4yF5Oz.js} +1 -1
  108. package/dist/client/assets/registry-DgOCTdY8.js +2 -0
  109. package/dist/client/assets/{registry-layout-cP1e-tCx.js → registry-layout-B2U_9fgO.js} +1 -1
  110. package/dist/client/assets/{required-auth-layout-Aj03mUWl.js → required-auth-layout-PH0-_blQ.js} +1 -1
  111. package/dist/client/assets/{reset-password-DaTq0ZPl.js → reset-password-5ioWEbN5.js} +1 -1
  112. package/dist/client/assets/{roles-BevJu7Hb.js → roles-4ojRgHgc.js} +1 -1
  113. package/dist/client/assets/{scroll-area-Dlh0OJL1.js → scroll-area-D_tsHfC-.js} +1 -1
  114. package/dist/client/assets/{search-input-BbuJZtoW.js → search-input-Boj5tfQn.js} +1 -1
  115. package/dist/client/assets/{select-BkJAPRFR.js → select-B3lWwv9y.js} +1 -1
  116. package/dist/client/assets/{select-model-Cx6hCHLC.js → select-model-C-fLwr4k.js} +1 -1
  117. package/dist/client/assets/{settings-layout-BBbpwWqq.js → settings-layout-U-ZhWkRq.js} +1 -1
  118. package/dist/client/assets/{settings-section-OhWt9Ooj.js → settings-section-qufbNRCL.js} +1 -1
  119. package/dist/client/assets/{shell-layout-CwAongAC.js → shell-layout-G8D-0WXl.js} +1 -1
  120. package/dist/client/assets/{skeleton-BkdIXnLT.js → skeleton-BfKJMKYc.js} +1 -1
  121. package/dist/client/assets/{sso-BpRBatM1.js → sso-BdojNoX2.js} +1 -1
  122. package/dist/client/assets/{store-CE6jKSPr.js → store-DGVb_5C1.js} +1 -1
  123. package/dist/client/assets/store-registry-KlW3QwUJ.js +2 -0
  124. package/dist/client/assets/{switch-Bipu3FI7.js → switch-YLfAn92x.js} +1 -1
  125. package/dist/client/assets/{table-Bk_qf725.js → table-wHPRdxYv.js} +1 -1
  126. package/dist/client/assets/{tabs-BZ0uT4sS.js → tabs-8aX3BTo-.js} +1 -1
  127. package/dist/client/assets/{task-status-DiRItLYw.js → task-status-CY3ltf_M.js} +1 -1
  128. package/dist/client/assets/{textarea-BrWSFj_2.js → textarea-BJZt5-vN.js} +1 -1
  129. package/dist/client/assets/{toggle-group-CG-UehNQ.js → toggle-group-C_B32Tm8.js} +1 -1
  130. package/dist/client/assets/{tools-list-BRI0XzAw.js → tools-list-bxPeEc0p.js} +1 -1
  131. package/dist/client/assets/{tooltip-DKSC_TlS.js → tooltip-B26xbtws.js} +1 -1
  132. package/dist/client/assets/{types-ClrLgxxx.js → types-DfgXo_cD.js} +1 -1
  133. package/dist/client/assets/{use-ai-providers-DeSA23rL.js → use-ai-providers-CnyJW7s-.js} +1 -1
  134. package/dist/client/assets/{use-collections-P_xycvTV.js → use-collections-D66SnH5Q.js} +1 -1
  135. package/dist/client/assets/{use-connection-BPL4_0km.js → use-connection-9VrA1Bg7.js} +1 -1
  136. package/dist/client/assets/{use-copy-CTq_kAqD.js → use-copy-DpxSUjqd.js} +1 -1
  137. package/dist/client/assets/{use-create-virtual-mcp-D1V6z6nu.js → use-create-virtual-mcp-DBfs4FWm.js} +1 -1
  138. package/dist/client/assets/{use-debounced-autosave-BN0dAXmt.js → use-debounced-autosave-Ja8PcJv_.js} +1 -1
  139. package/dist/client/assets/{use-decopilot-events-FPrAaowc.js → use-decopilot-events-DjAxcjIH.js} +1 -1
  140. package/dist/client/assets/{use-delete-connection-BnyXIIOY.js → use-delete-connection-7Blp6D0s.js} +1 -1
  141. package/dist/client/assets/{use-infinite-scroll-CRwUMH1o.js → use-infinite-scroll-IwyU_OvC.js} +1 -1
  142. package/dist/client/assets/{use-list-state-41gWh47f.js → use-list-state-Dk2QFrYd.js} +1 -1
  143. package/dist/client/assets/{use-mcp-tools-BItotVJ3.js → use-mcp-tools-C7yIpDHe.js} +1 -1
  144. package/dist/client/assets/{use-members-CI97myG6.js → use-members-Bg4ZFsu9.js} +1 -1
  145. package/dist/client/assets/{use-navigate-to-agent-CVA2Amec.js → use-navigate-to-agent-BehsrrsA.js} +1 -1
  146. package/dist/client/assets/{use-org-auth-client-C8ofbFUE.js → use-org-auth-client-mkgKwCAh.js} +1 -1
  147. package/dist/client/assets/{use-org-sso-BxOse5AC.js → use-org-sso-Xv4QV2bL.js} +1 -1
  148. package/dist/client/assets/{use-organization-roles-5CJlDHYt.js → use-organization-roles-BmH8DM7C.js} +1 -1
  149. package/dist/client/assets/{use-organization-settings-DkdX8Pu1.js → use-organization-settings-Coi7Ggqq.js} +1 -1
  150. package/dist/client/assets/{use-registry-connections-BOLgJOOJ.js → use-registry-connections-_83vUYHS.js} +1 -1
  151. package/dist/client/assets/{use-status-sounds-C2j9qKjC.js → use-status-sounds-DLYnzZvv.js} +1 -1
  152. package/dist/client/assets/{use-tasks-B1tiIeuc.js → use-tasks-CUt44N_R.js} +1 -1
  153. package/dist/client/assets/{use-view-mode-ZXMMFhU_.js → use-view-mode-CZXZPLm6.js} +1 -1
  154. package/dist/client/assets/{use-virtual-mcp-BAEgLpb5.js → use-virtual-mcp-BlYQqAfZ.js} +1 -1
  155. package/dist/client/assets/useInfiniteQuery-BJ1I2JSf.js +1 -0
  156. package/dist/client/assets/useSuspenseInfiniteQuery-BpfkmtaB.js +1 -0
  157. package/dist/client/assets/{user-CHucb2Kt.js → user-BFqIXUgg.js} +1 -1
  158. package/dist/client/assets/{view-mode-toggle-DR7xk3lS.js → view-mode-toggle-BC7A6oBR.js} +1 -1
  159. package/dist/client/assets/{workflow-BYv_2auF.js → workflow-B3ajRQIi.js} +1 -1
  160. package/dist/client/assets/workflow-detail-l83JU-Mp.js +1 -0
  161. package/dist/client/index.html +1 -1
  162. package/dist/server/cli.js +4 -4
  163. package/dist/server/node_modules/pg-int8/LICENSE +13 -0
  164. package/dist/server/node_modules/pg-int8/README.md +16 -0
  165. package/dist/server/node_modules/pg-int8/index.js +100 -0
  166. package/dist/server/node_modules/pg-int8/package.json +24 -0
  167. package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
  168. package/dist/server/node_modules/postgres-array/index.js +97 -0
  169. package/dist/server/node_modules/postgres-array/license +21 -0
  170. package/dist/server/node_modules/postgres-array/package.json +35 -0
  171. package/dist/server/node_modules/postgres-array/readme.md +43 -0
  172. package/dist/server/node_modules/postgres-bytea/index.js +33 -0
  173. package/dist/server/node_modules/postgres-bytea/license +21 -0
  174. package/dist/server/node_modules/postgres-bytea/package.json +34 -0
  175. package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
  176. package/dist/server/node_modules/postgres-date/index.js +116 -0
  177. package/dist/server/node_modules/postgres-date/license +21 -0
  178. package/dist/server/node_modules/postgres-date/package.json +33 -0
  179. package/dist/server/node_modules/postgres-date/readme.md +49 -0
  180. package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
  181. package/dist/server/node_modules/postgres-interval/index.js +125 -0
  182. package/dist/server/node_modules/postgres-interval/license +21 -0
  183. package/dist/server/node_modules/postgres-interval/package.json +36 -0
  184. package/dist/server/node_modules/postgres-interval/readme.md +48 -0
  185. package/dist/server/node_modules/split2/LICENSE +13 -0
  186. package/dist/server/node_modules/split2/README.md +85 -0
  187. package/dist/server/node_modules/split2/bench.js +27 -0
  188. package/dist/server/node_modules/split2/index.js +141 -0
  189. package/dist/server/node_modules/split2/package.json +39 -0
  190. package/dist/server/node_modules/split2/test.js +409 -0
  191. package/dist/server/server.js +3 -3
  192. package/package.json +1 -1
  193. package/dist/client/assets/ai-providers-CHwiNXP4.js +0 -1
  194. package/dist/client/assets/index-7mXC8lS4.js +0 -1
  195. package/dist/client/assets/registry-BZEongCI.js +0 -2
  196. package/dist/client/assets/store-registry-MTXbjb_8.js +0 -2
  197. package/dist/client/assets/useInfiniteQuery-Y9Nb1sum.js +0 -1
  198. package/dist/client/assets/useSuspenseInfiniteQuery-CIGmGEj7.js +0 -1
  199. package/dist/client/assets/workflow-detail-D3A--f-7.js +0 -1
@@ -0,0 +1,409 @@
1
+ 'use strict'
2
+
3
+ const test = require('tape')
4
+ const split = require('./')
5
+ const callback = require('callback-stream')
6
+ const strcb = callback.bind(null, { decodeStrings: false })
7
+ const objcb = callback.bind(null, { objectMode: true })
8
+
9
+ test('split two lines on end', function (t) {
10
+ t.plan(2)
11
+
12
+ const input = split()
13
+
14
+ input.pipe(strcb(function (err, list) {
15
+ t.error(err)
16
+ t.deepEqual(list, ['hello', 'world'])
17
+ }))
18
+
19
+ input.end('hello\nworld')
20
+ })
21
+
22
+ test('split two lines on two writes', function (t) {
23
+ t.plan(2)
24
+
25
+ const input = split()
26
+
27
+ input.pipe(strcb(function (err, list) {
28
+ t.error(err)
29
+ t.deepEqual(list, ['hello', 'world'])
30
+ }))
31
+
32
+ input.write('hello')
33
+ input.write('\nworld')
34
+ input.end()
35
+ })
36
+
37
+ test('split four lines on three writes', function (t) {
38
+ t.plan(2)
39
+
40
+ const input = split()
41
+
42
+ input.pipe(strcb(function (err, list) {
43
+ t.error(err)
44
+ t.deepEqual(list, ['hello', 'world', 'bye', 'world'])
45
+ }))
46
+
47
+ input.write('hello\nwor')
48
+ input.write('ld\nbye\nwo')
49
+ input.write('rld')
50
+ input.end()
51
+ })
52
+
53
+ test('accumulate multiple writes', function (t) {
54
+ t.plan(2)
55
+
56
+ const input = split()
57
+
58
+ input.pipe(strcb(function (err, list) {
59
+ t.error(err)
60
+ t.deepEqual(list, ['helloworld'])
61
+ }))
62
+
63
+ input.write('hello')
64
+ input.write('world')
65
+ input.end()
66
+ })
67
+
68
+ test('split using a custom string matcher', function (t) {
69
+ t.plan(2)
70
+
71
+ const input = split('~')
72
+
73
+ input.pipe(strcb(function (err, list) {
74
+ t.error(err)
75
+ t.deepEqual(list, ['hello', 'world'])
76
+ }))
77
+
78
+ input.end('hello~world')
79
+ })
80
+
81
+ test('split using a custom regexp matcher', function (t) {
82
+ t.plan(2)
83
+
84
+ const input = split(/~/)
85
+
86
+ input.pipe(strcb(function (err, list) {
87
+ t.error(err)
88
+ t.deepEqual(list, ['hello', 'world'])
89
+ }))
90
+
91
+ input.end('hello~world')
92
+ })
93
+
94
+ test('support an option argument', function (t) {
95
+ t.plan(2)
96
+
97
+ const input = split({ highWaterMark: 2 })
98
+
99
+ input.pipe(strcb(function (err, list) {
100
+ t.error(err)
101
+ t.deepEqual(list, ['hello', 'world'])
102
+ }))
103
+
104
+ input.end('hello\nworld')
105
+ })
106
+
107
+ test('support a mapper function', function (t) {
108
+ t.plan(2)
109
+
110
+ const a = { a: '42' }
111
+ const b = { b: '24' }
112
+
113
+ const input = split(JSON.parse)
114
+
115
+ input.pipe(objcb(function (err, list) {
116
+ t.error(err)
117
+ t.deepEqual(list, [a, b])
118
+ }))
119
+
120
+ input.write(JSON.stringify(a))
121
+ input.write('\n')
122
+ input.end(JSON.stringify(b))
123
+ })
124
+
125
+ test('split lines windows-style', function (t) {
126
+ t.plan(2)
127
+
128
+ const input = split()
129
+
130
+ input.pipe(strcb(function (err, list) {
131
+ t.error(err)
132
+ t.deepEqual(list, ['hello', 'world'])
133
+ }))
134
+
135
+ input.end('hello\r\nworld')
136
+ })
137
+
138
+ test('splits a buffer', function (t) {
139
+ t.plan(2)
140
+
141
+ const input = split()
142
+
143
+ input.pipe(strcb(function (err, list) {
144
+ t.error(err)
145
+ t.deepEqual(list, ['hello', 'world'])
146
+ }))
147
+
148
+ input.end(Buffer.from('hello\nworld'))
149
+ })
150
+
151
+ test('do not end on undefined', function (t) {
152
+ t.plan(2)
153
+
154
+ const input = split(function (line) { })
155
+
156
+ input.pipe(strcb(function (err, list) {
157
+ t.error(err)
158
+ t.deepEqual(list, [])
159
+ }))
160
+
161
+ input.end(Buffer.from('hello\nworld'))
162
+ })
163
+
164
+ test('has destroy method', function (t) {
165
+ t.plan(1)
166
+
167
+ const input = split(function (line) { })
168
+
169
+ input.on('close', function () {
170
+ t.ok(true, 'close emitted')
171
+ t.end()
172
+ })
173
+
174
+ input.destroy()
175
+ })
176
+
177
+ test('support custom matcher and mapper', function (t) {
178
+ t.plan(4)
179
+
180
+ const a = { a: '42' }
181
+ const b = { b: '24' }
182
+ const input = split('~', JSON.parse)
183
+
184
+ t.equal(input.matcher, '~')
185
+ t.equal(typeof input.mapper, 'function')
186
+
187
+ input.pipe(objcb(function (err, list) {
188
+ t.notOk(err, 'no errors')
189
+ t.deepEqual(list, [a, b])
190
+ }))
191
+
192
+ input.write(JSON.stringify(a))
193
+ input.write('~')
194
+ input.end(JSON.stringify(b))
195
+ })
196
+
197
+ test('support custom matcher and options', function (t) {
198
+ t.plan(6)
199
+
200
+ const input = split('~', { highWaterMark: 1024 })
201
+
202
+ t.equal(input.matcher, '~')
203
+ t.equal(typeof input.mapper, 'function')
204
+ t.equal(input._readableState.highWaterMark, 1024)
205
+ t.equal(input._writableState.highWaterMark, 1024)
206
+
207
+ input.pipe(strcb(function (err, list) {
208
+ t.error(err)
209
+ t.deepEqual(list, ['hello', 'world'])
210
+ }))
211
+
212
+ input.end('hello~world')
213
+ })
214
+
215
+ test('support mapper and options', function (t) {
216
+ t.plan(6)
217
+
218
+ const a = { a: '42' }
219
+ const b = { b: '24' }
220
+ const input = split(JSON.parse, { highWaterMark: 1024 })
221
+
222
+ t.ok(input.matcher instanceof RegExp, 'matcher is RegExp')
223
+ t.equal(typeof input.mapper, 'function')
224
+ t.equal(input._readableState.highWaterMark, 1024)
225
+ t.equal(input._writableState.highWaterMark, 1024)
226
+
227
+ input.pipe(objcb(function (err, list) {
228
+ t.error(err)
229
+ t.deepEqual(list, [a, b])
230
+ }))
231
+
232
+ input.write(JSON.stringify(a))
233
+ input.write('\n')
234
+ input.end(JSON.stringify(b))
235
+ })
236
+
237
+ test('split utf8 chars', function (t) {
238
+ t.plan(2)
239
+
240
+ const input = split()
241
+
242
+ input.pipe(strcb(function (err, list) {
243
+ t.error(err)
244
+ t.deepEqual(list, ['烫烫烫', '锟斤拷'])
245
+ }))
246
+
247
+ const buf = Buffer.from('烫烫烫\r\n锟斤拷', 'utf8')
248
+ for (let i = 0; i < buf.length; ++i) {
249
+ input.write(buf.slice(i, i + 1))
250
+ }
251
+ input.end()
252
+ })
253
+
254
+ test('split utf8 chars 2by2', function (t) {
255
+ t.plan(2)
256
+
257
+ const input = split()
258
+
259
+ input.pipe(strcb(function (err, list) {
260
+ t.error(err)
261
+ t.deepEqual(list, ['烫烫烫', '烫烫烫'])
262
+ }))
263
+
264
+ const str = '烫烫烫\r\n烫烫烫'
265
+ const buf = Buffer.from(str, 'utf8')
266
+ for (let i = 0; i < buf.length; i += 2) {
267
+ input.write(buf.slice(i, i + 2))
268
+ }
269
+ input.end()
270
+ })
271
+
272
+ test('split lines when the \n comes at the end of a chunk', function (t) {
273
+ t.plan(2)
274
+
275
+ const input = split()
276
+
277
+ input.pipe(strcb(function (err, list) {
278
+ t.error(err)
279
+ t.deepEqual(list, ['hello', 'world'])
280
+ }))
281
+
282
+ input.write('hello\n')
283
+ input.end('world')
284
+ })
285
+
286
+ test('truncated utf-8 char', function (t) {
287
+ t.plan(2)
288
+
289
+ const input = split()
290
+
291
+ input.pipe(strcb(function (err, list) {
292
+ t.error(err)
293
+ t.deepEqual(list, ['烫' + Buffer.from('e7', 'hex').toString()])
294
+ }))
295
+
296
+ const str = '烫烫'
297
+ const buf = Buffer.from(str, 'utf8')
298
+
299
+ input.write(buf.slice(0, 3))
300
+ input.end(buf.slice(3, 4))
301
+ })
302
+
303
+ test('maximum buffer limit', function (t) {
304
+ t.plan(1)
305
+
306
+ const input = split({ maxLength: 2 })
307
+ input.on('error', function (err) {
308
+ t.ok(err)
309
+ })
310
+
311
+ input.resume()
312
+
313
+ input.write('hey')
314
+ })
315
+
316
+ test('readable highWaterMark', function (t) {
317
+ const input = split()
318
+ t.equal(input._readableState.highWaterMark, 16)
319
+ t.end()
320
+ })
321
+
322
+ test('maxLength < chunk size', function (t) {
323
+ t.plan(2)
324
+
325
+ const input = split({ maxLength: 2 })
326
+
327
+ input.pipe(strcb(function (err, list) {
328
+ t.error(err)
329
+ t.deepEqual(list, ['a', 'b'])
330
+ }))
331
+
332
+ input.end('a\nb')
333
+ })
334
+
335
+ test('maximum buffer limit w/skip', function (t) {
336
+ t.plan(2)
337
+
338
+ const input = split({ maxLength: 2, skipOverflow: true })
339
+
340
+ input.pipe(strcb(function (err, list) {
341
+ t.error(err)
342
+ t.deepEqual(list, ['a', 'b', 'c'])
343
+ }))
344
+
345
+ input.write('a\n123')
346
+ input.write('456')
347
+ input.write('789\nb\nc')
348
+ input.end()
349
+ })
350
+
351
+ test("don't modify the options object", function (t) {
352
+ t.plan(2)
353
+
354
+ const options = {}
355
+ const input = split(options)
356
+
357
+ input.pipe(strcb(function (err, list) {
358
+ t.error(err)
359
+ t.same(options, {})
360
+ }))
361
+
362
+ input.end()
363
+ })
364
+
365
+ test('mapper throws flush', function (t) {
366
+ t.plan(1)
367
+ const error = new Error()
368
+ const input = split(function () {
369
+ throw error
370
+ })
371
+
372
+ input.on('error', (err, list) => {
373
+ t.same(err, error)
374
+ })
375
+ input.end('hello')
376
+ })
377
+
378
+ test('mapper throws on transform', function (t) {
379
+ t.plan(1)
380
+
381
+ const error = new Error()
382
+ const input = split(function (l) {
383
+ throw error
384
+ })
385
+
386
+ input.on('error', (err) => {
387
+ t.same(err, error)
388
+ })
389
+ input.write('a')
390
+ input.write('\n')
391
+ input.end('b')
392
+ })
393
+
394
+ test('supports Symbol.split', function (t) {
395
+ t.plan(2)
396
+
397
+ const input = split({
398
+ [Symbol.split] (str) {
399
+ return str.split('~')
400
+ }
401
+ })
402
+
403
+ input.pipe(strcb(function (err, list) {
404
+ t.error(err)
405
+ t.deepEqual(list, ['hello', 'world'])
406
+ }))
407
+
408
+ input.end('hello~world')
409
+ })