decocms 2.312.7 → 2.313.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-C2o5q6vc.js → AlertCircle-VR9e1Kdm.js} +1 -1
- package/dist/client/assets/{Archive-DFar6uKs.js → Archive-C8b1PbwD.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-Dc1sniQF.js → ArrowNarrowLeft-BomndbPT.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DoW21rsG.js → ArrowUpRight-BBedSsf2.js} +1 -1
- package/dist/client/assets/{Check-C6Q1bblL.js → Check-_x9Smiby.js} +1 -1
- package/dist/client/assets/{CheckCircle-BAZINfwL.js → CheckCircle-DqkJltcw.js} +1 -1
- package/dist/client/assets/{ChevronDown-CLABqX5x.js → ChevronDown-B0KKFW7z.js} +1 -1
- package/dist/client/assets/{ChevronRight-srFzWZbn.js → ChevronRight-DmzXQRyN.js} +1 -1
- package/dist/client/assets/{ChevronUp-CYhx7PBM.js → ChevronUp-D80nIxW6.js} +1 -1
- package/dist/client/assets/{Container-CDeA-o5s.js → Container-hPWrMd_K.js} +1 -1
- package/dist/client/assets/{DotsVertical-Cr_XWVYH.js → DotsVertical-DTAmMuFp.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D10kQiES.js → LayoutLeft-CvHk6_1v.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D7Bf92jL.js → LinkExternal01-ChBg4lCh.js} +1 -1
- package/dist/client/assets/{Lock01-B5nxky6K.js → Lock01-omvVfDsq.js} +1 -1
- package/dist/client/assets/{Palette-BzdGUPw1.js → Palette-Rwaz6Ux1.js} +1 -1
- package/dist/client/assets/{Play-Cv1sPHtp.js → Play-B5Y5OgEF.js} +1 -1
- package/dist/client/assets/{Plus-D7J-ZpF_.js → Plus-BfYJ_fhU.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-1mb0qscd.js → RefreshCcw01-BVYIhLNw.js} +1 -1
- package/dist/client/assets/{SearchMd-B0Lvg3Xk.js → SearchMd-x9jEzWto.js} +1 -1
- package/dist/client/assets/{Settings02-CxQQ6hnP.js → Settings02-A2QUyA04.js} +1 -1
- package/dist/client/assets/{Shield01-CWlsOsl1.js → Shield01-VFZnVzgJ.js} +1 -1
- package/dist/client/assets/{Star01-DxYo9bx0.js → Star01-Bsoh5hNL.js} +1 -1
- package/dist/client/assets/{Sun-C3FNZe_T.js → Sun-Bp5SyQ9x.js} +1 -1
- package/dist/client/assets/{Tool01-8PZBFCSr.js → Tool01-1p7InVa9.js} +1 -1
- package/dist/client/assets/{Trash01-sqipAjJs.js → Trash01-CCICAviE.js} +1 -1
- package/dist/client/assets/{User01-CMGdQkcX.js → User01-DYAGpiu4.js} +1 -1
- package/dist/client/assets/{Users03-B2lBHlGZ.js → Users03-C-LNtnHq.js} +1 -1
- package/dist/client/assets/{X-UcFDhK-I.js → X-DOmcQBqy.js} +1 -1
- package/dist/client/assets/{XCircle-Rqvc6PWM.js → XCircle-DHsXO2jG.js} +1 -1
- package/dist/client/assets/{XClose-BEPgM0J7.js → XClose-C9tO3uLm.js} +1 -1
- package/dist/client/assets/{Zap-CV9G-Zfk.js → Zap-Cr3JL-JC.js} +1 -1
- package/dist/client/assets/{ZapSquare-BTR8NCmq.js → ZapSquare-CLYRUiny.js} +1 -1
- package/dist/client/assets/{accordion-CvWJabH1.js → accordion-B8b6ADv4.js} +1 -1
- package/dist/client/assets/{agent-icon-D6T8ZDaV.js → agent-icon-B3dbwQQF.js} +1 -1
- package/dist/client/assets/{agents-list-DyNXshyO.js → agents-list-BOs5vYpf.js} +1 -1
- package/dist/client/assets/{ai-providers-7aj7Dvnr.js → ai-providers-DHyC2swB.js} +1 -1
- package/dist/client/assets/{alert-dialog-CL1ufXLZ.js → alert-dialog-BJTNrOhl.js} +1 -1
- package/dist/client/assets/{auth-catchall-B-Lg7W2q.js → auth-catchall-BaS7NCCR.js} +1 -1
- package/dist/client/assets/{automation-list-row-CKuBxKCh.js → automation-list-row-CjV4TdfL.js} +1 -1
- package/dist/client/assets/{automations-b35IyYNi.js → automations-DDxuxMI7.js} +1 -1
- package/dist/client/assets/{avatar-Cz84VRfi.js → avatar-CVlDCU5h.js} +1 -1
- package/dist/client/assets/{badge-BDIezRWl.js → badge-DOjxQOhJ.js} +1 -1
- package/dist/client/assets/{brand-context-Bw8yIqM4.js → brand-context-Dx6aAWU2.js} +1 -1
- package/dist/client/assets/{card-BkUSFoeH.js → card-DotruZR7.js} +1 -1
- package/dist/client/assets/{chat-context-COr23Pvp.js → chat-context-CgTzImbK.js} +1 -1
- package/dist/client/assets/{checkbox-D9uJNURD.js → checkbox-DrmZvzrT.js} +1 -1
- package/dist/client/assets/{collection-detail-r3yDw2nE.js → collection-detail-CcTNmbP8.js} +1 -1
- package/dist/client/assets/{collection-display-button-BkhKa8Fq.js → collection-display-button-C4cuirx7.js} +1 -1
- package/dist/client/assets/{collection-search-CYRwFc6W.js → collection-search-BF8ZdP7L.js} +1 -1
- package/dist/client/assets/{collection-search-CC32ghxz.js → collection-search-DWrG5qGb.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CsPeZBHE.js → collection-table-wrapper-B4KtrooZ.js} +1 -1
- package/dist/client/assets/{collection-tabs-DjuikHg2.js → collection-tabs-JbvPv0ww.js} +1 -1
- package/dist/client/assets/{collections-h6SIG2VD.js → collections-BccjtmBC.js} +1 -1
- package/dist/client/assets/{command-B6Opzxt3.js → command-BJCrWXQl.js} +1 -1
- package/dist/client/assets/{connection-card-Do5z7MRC.js → connection-card-BHwpWrBx.js} +1 -1
- package/dist/client/assets/{connection-detail-CCkyT_oS.js → connection-detail-DYbyDpiw.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DTUZBSNs.js → connection-form-helpers-B_EAPKs9.js} +1 -1
- package/dist/client/assets/{connections-D1l0zvWe.js → connections-Cr6QbSRh.js} +1 -1
- package/dist/client/assets/{constants-CkJVGrih.js → constants-CImNHUX-.js} +1 -1
- package/dist/client/assets/{constants-eHuCaQ_P.js → constants-kgqnlOHa.js} +1 -1
- package/dist/client/assets/{dialog-BCrxZaWW.js → dialog-CK63STP4.js} +1 -1
- package/dist/client/assets/{domain-settings-DjfYV1So.js → domain-settings-6QMSs4wn.js} +1 -1
- package/dist/client/assets/{drawer-CAqFFbhs.js → drawer-wCIWEAI5.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CapVicMN.js → dropdown-menu-B7T7Iogo.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-vfq9KprT.js → dynamic-plugin-layout-C3G8K_nu.js} +1 -1
- package/dist/client/assets/{empty-state-DrcmKKqy.js → empty-state-BU8pZLnA.js} +1 -1
- package/dist/client/assets/{empty-state-CyNHLjJr.js → empty-state-Du82mGBp.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DkJkN3o2.js → extract-connection-data-BVruRO7o.js} +1 -1
- package/dist/client/assets/{features-C2-XIDYj.js → features-BQ0vyboB.js} +1 -1
- package/dist/client/assets/{form-te3NdICa.js → form-ePgXfPjK.js} +1 -1
- package/dist/client/assets/{general-B-vosNM8.js → general-B_ZIET5j.js} +1 -1
- package/dist/client/assets/{index-CBCw04gM.js → index-3_pBkl9I.js} +1 -1
- package/dist/client/assets/{index-C_s96l4K.js → index-BUosmNAK.js} +1 -1
- package/dist/client/assets/{index-CkV3bKsF.js → index-BziHhYLY.js} +1 -1
- package/dist/client/assets/{index-CKCUmH_m.js → index-CJcKkFSf.js} +3 -3
- package/dist/client/assets/{index-Csm4dluq.js → index-CPA6TTAv.js} +1 -1
- package/dist/client/assets/{index-Dt8YClUX.js → index-CYtBy4YL.js} +1 -1
- package/dist/client/assets/index-CcjQJiQG.js +547 -0
- package/dist/client/assets/{index-CzeuUc9U.css → index-Cm3pqTt-.css} +1 -1
- package/dist/client/assets/{index-C7jN5neb.js → index-CsKe3YZC.js} +3 -3
- package/dist/client/assets/{index-CwW_wLKg.js → index-DMzQ42Ay.js} +1 -1
- package/dist/client/assets/{index-fexbvrAq.js → index-Dtca8DdX.js} +1 -1
- package/dist/client/assets/{index-BRxzMJGJ.js → index-Q_nE-B09.js} +1 -1
- package/dist/client/assets/{index-zwJpQueu.js → index-SHpCCFvp.js} +1 -1
- package/dist/client/assets/{index-5jrl6Co-.js → index-_CUdtdz8.js} +2 -2
- package/dist/client/assets/{index-B_6WEs0q.js → index-aVeyrrsb.js} +1 -1
- package/dist/client/assets/{index-BKbuKSG2.js → index-ig98RAvX.js} +1 -1
- package/dist/client/assets/{index-Bg-dgfxo.js → index-pKuooFel.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DUrDxQsV.js → infiniteQueryObserver-7fxmXXdp.js} +1 -1
- package/dist/client/assets/{input-D-ZjkErJ.js → input-Ko_SrZ4_.js} +1 -1
- package/dist/client/assets/{integration-icon-Cnjj_f25.js → integration-icon-DcYB2a8l.js} +1 -1
- package/dist/client/assets/{label-BYocE4uU.js → label-D_dfHcwE.js} +1 -1
- package/dist/client/assets/{layout-DZBilHGN.js → layout-Dw6LlsHX.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-DTNkFQF7.js → lean-canvas-recruit-modal-CFAZK9w1.js} +1 -1
- package/dist/client/assets/{login-TpNdCcSE.js → login-CWpiwEaq.js} +1 -1
- package/dist/client/assets/{members-Bc9_guMN.js → members-C4z0efAZ.js} +1 -1
- package/dist/client/assets/{monaco-editor-Bk3MeNtT.js → monaco-editor-C6DOPPfO.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-atuJDMtL.js → monitoring-stats-row-BKcjpP7m.js} +1 -1
- package/dist/client/assets/{oauth-callback-BU51YAFZ.js → oauth-callback-BN7age-F.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DHobA1oV.js → oauth-callback-ai-provider-RkxZgbDA.js} +1 -1
- package/dist/client/assets/{onboarding-xa_XNWs7.js → onboarding-BYACWd1_.js} +1 -1
- package/dist/client/assets/{org-layout-DfZsgPJH.js → org-layout-kAlrK_Sz.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-BNtiSb4W.js → org-plugin-layout-DUXHrilB.js} +1 -1
- package/dist/client/assets/{pair-DlFSBO5g.js → pair-7uYiW7Rh.js} +39 -39
- package/dist/client/assets/{plugin-empty-state-B9V3iWPP.js → plugin-empty-state-DBdc9DDY.js} +1 -1
- package/dist/client/assets/{plugin-header-Sl8TyoFF.js → plugin-header-_TX1Y9Vb.js} +1 -1
- package/dist/client/assets/{plugin-layout-rl6DCWgI.js → plugin-layout-BNL2k5o3.js} +1 -1
- package/dist/client/assets/{popover-Dn4j0mPz.js → popover-B166_aeY.js} +1 -1
- package/dist/client/assets/{profile-DUg1r9pS.js → profile-DVs_o4X-.js} +1 -1
- package/dist/client/assets/{project-app-view-Ba31KrUb.js → project-app-view-CsESRZfU.js} +1 -1
- package/dist/client/assets/registry-Cf9xWu3H.js +2 -0
- package/dist/client/assets/{registry-layout-ZGApx0j6.js → registry-layout-CiycvO4e.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DZwCJHl_.js → required-auth-layout-CzyyMsWp.js} +1 -1
- package/dist/client/assets/{reset-password-DPn3UIPm.js → reset-password-CAqQV6rn.js} +1 -1
- package/dist/client/assets/{roles-CKivK7GA.js → roles-DwmHbB0D.js} +1 -1
- package/dist/client/assets/{scroll-area-CEHywN8A.js → scroll-area-CYD6rIcU.js} +1 -1
- package/dist/client/assets/{search-input-DQUdthWP.js → search-input-DDZfQYkG.js} +1 -1
- package/dist/client/assets/{select-B5UhPE3o.js → select-DhMWgQ3s.js} +1 -1
- package/dist/client/assets/{select-model-CTDZYKlK.js → select-model-Twg2cKHt.js} +1 -1
- package/dist/client/assets/{settings-layout-C7k8LFse.js → settings-layout-DLGNEr9H.js} +1 -1
- package/dist/client/assets/{settings-section-CLiE2XoW.js → settings-section-CIvaDAqO.js} +1 -1
- package/dist/client/assets/{shell-layout-CSQshMOg.js → shell-layout-Ddrq5Nx0.js} +1 -1
- package/dist/client/assets/{sidebar-yJ2bKdp0.js → sidebar-C6KGCyfz.js} +1 -1
- package/dist/client/assets/{skeleton-DO9x4Rmx.js → skeleton-CAInevCf.js} +1 -1
- package/dist/client/assets/{spinner-DKEalby6.js → spinner-DIWCCR1u.js} +1 -1
- package/dist/client/assets/{sso-DOSWI8BP.js → sso-BF1j_yNV.js} +1 -1
- package/dist/client/assets/store-registry-WzODKi73.js +2 -0
- package/dist/client/assets/{store-D5UphBa3.js → store-tnnxPHF8.js} +1 -1
- package/dist/client/assets/{switch-DnFBbNMj.js → switch-B_6i5d1i.js} +1 -1
- package/dist/client/assets/{table-4kNaNJRz.js → table-DKmWjuZu.js} +1 -1
- package/dist/client/assets/{tabs-B-6zDMoB.js → tabs-DbLM1syJ.js} +1 -1
- package/dist/client/assets/{task-status-CH2K09YA.js → task-status-6a9U-fmJ.js} +1 -1
- package/dist/client/assets/{textarea-4YHnq21B.js → textarea-D2OceG5K.js} +1 -1
- package/dist/client/assets/{toggle-group-ClNyHH4s.js → toggle-group-DmWZZQ5J.js} +1 -1
- package/dist/client/assets/{tools-list-B79oEyUv.js → tools-list-CjYs-Nl2.js} +1 -1
- package/dist/client/assets/{tooltip-CBWMgMUA.js → tooltip-DEoNevOj.js} +1 -1
- package/dist/client/assets/{types-DzQyumzv.js → types-DLyGIXuU.js} +1 -1
- package/dist/client/assets/{use-ai-providers-6IUbUXz_.js → use-ai-providers-BRYLtBQi.js} +1 -1
- package/dist/client/assets/{use-collections-fNwAKHqm.js → use-collections-T8lAmXe-.js} +1 -1
- package/dist/client/assets/{use-connection-kZb9ifhw.js → use-connection-CHxcvnwB.js} +1 -1
- package/dist/client/assets/{use-copy-B9Cl132r.js → use-copy-DTsrGSHm.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D4YXt-ZE.js → use-create-virtual-mcp-1k0qsXpZ.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BsxczRNv.js → use-debounced-autosave-DkSi9ajl.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BHxLXAgz.js → use-decopilot-events-ChHy1YwQ.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DzBX3Y5X.js → use-delete-connection-Da8pd8GR.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DC9PNnqU.js → use-infinite-scroll-4R3Erhbk.js} +1 -1
- package/dist/client/assets/{use-list-state-Cm9upsvA.js → use-list-state-DD5dSsUl.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CwvPDTWi.js → use-mcp-tools-DLLnZTwr.js} +1 -1
- package/dist/client/assets/{use-members-ClIilp4X.js → use-members-Du6jDL4h.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DYmmiFA6.js → use-navigate-to-agent-BOtA8s0B.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DgUDC_02.js → use-org-auth-client-CLIYZ8XR.js} +1 -1
- package/dist/client/assets/{use-org-sso-DnHHFQsb.js → use-org-sso-cXprxxGV.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Bz3GUN0h.js → use-organization-roles-BfqEa00I.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DfjHTWfJ.js → use-organization-settings-DH3Cx32-.js} +1 -1
- package/dist/client/assets/{use-registry-connections-B6kptdp7.js → use-registry-connections-Di-IdwT_.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BqG86mfx.js → use-status-sounds-CowwkJT4.js} +1 -1
- package/dist/client/assets/{use-tasks-POUiiV_o.js → use-tasks-2n2QJ_JS.js} +1 -1
- package/dist/client/assets/{use-view-mode-CrZp_Guy.js → use-view-mode-Bv0IukaU.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BQvDkFLT.js → use-virtual-mcp-MITPdtzC.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CY-Wzev4.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DV-M7yay.js +1 -0
- package/dist/client/assets/{user-DSZMPWc6.js → user-DiRuL5kE.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Cgp8wSpL.js → view-mode-toggle-cZTPYUmn.js} +1 -1
- package/dist/client/assets/{workflow-Dywulu_i.js → workflow-Cnw6Z3Ej.js} +1 -1
- package/dist/client/assets/workflow-detail-CkzZBhlC.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- 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/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/package.json +1 -1
- package/dist/client/assets/index-C_gN6VMh.js +0 -547
- package/dist/client/assets/registry-EC12Boik.js +0 -2
- package/dist/client/assets/store-registry-DipUkX4F.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BiqW5IFh.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-ZvSBUcQH.js +0 -1
- package/dist/client/assets/workflow-detail-CnTjiGvc.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
|
+
})
|