decocms 2.311.9 → 2.311.10
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-DenZ2tH1.js → AlertCircle-CBFejk6X.js} +1 -1
- package/dist/client/assets/{Archive-CUyKZVLi.js → Archive-iAwIFcLN.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-CdHYti4b.js → ArrowNarrowLeft-C0NWe8i5.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DQA2yLzS.js → ArrowUpRight-wDGVfxe4.js} +1 -1
- package/dist/client/assets/{Check-B1QjP0lW.js → Check-BzVO1AiZ.js} +1 -1
- package/dist/client/assets/{CheckCircle-uoVBaQQY.js → CheckCircle-B7pbvHXn.js} +1 -1
- package/dist/client/assets/{ChevronDown-CW5suF8w.js → ChevronDown-Deq9bkeU.js} +1 -1
- package/dist/client/assets/{ChevronRight-C75N1vRO.js → ChevronRight-De9CjTSZ.js} +1 -1
- package/dist/client/assets/{ChevronUp-D9vKVRMW.js → ChevronUp-B22gTkPS.js} +1 -1
- package/dist/client/assets/{Container-e4KoMY54.js → Container-10kbY0mV.js} +1 -1
- package/dist/client/assets/{DotsVertical-Bl74LMdL.js → DotsVertical-B0gKWs5D.js} +1 -1
- package/dist/client/assets/{LinkExternal01-JpLMSezj.js → LinkExternal01-DkQ5Dk0s.js} +1 -1
- package/dist/client/assets/{Lock01-ChyzS6Qk.js → Lock01-CHNFEFTO.js} +1 -1
- package/dist/client/assets/{Palette-DxkFGkUo.js → Palette-B7UA48pi.js} +1 -1
- package/dist/client/assets/{Play-DNddfPVv.js → Play-BunaO9my.js} +1 -1
- package/dist/client/assets/{Plus-BdkW25go.js → Plus-DlXyaJQM.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-Bv9_h0OY.js → RefreshCcw01-BsycvfGb.js} +1 -1
- package/dist/client/assets/{SearchMd-DENJ3C2Y.js → SearchMd-15kzRVQe.js} +1 -1
- package/dist/client/assets/{Settings02-B4xVAQg7.js → Settings02-DVi1PM0X.js} +1 -1
- package/dist/client/assets/{Shield01-CISf8vls.js → Shield01-B70wMBqd.js} +1 -1
- package/dist/client/assets/{Star01-B90yQrQf.js → Star01-CJoi6RDa.js} +1 -1
- package/dist/client/assets/{Sun-jOb3MXPJ.js → Sun-CGoBYMaF.js} +1 -1
- package/dist/client/assets/{Tool01-CBOCDbIq.js → Tool01-D48iIlf1.js} +1 -1
- package/dist/client/assets/{Trash01-CqvPY4I1.js → Trash01-r5gnirq_.js} +1 -1
- package/dist/client/assets/{User01-DcOBCx9n.js → User01-DJ7t0J9b.js} +1 -1
- package/dist/client/assets/{Users03-l6fjto8R.js → Users03-DYLtKI27.js} +1 -1
- package/dist/client/assets/{X-CuBCe85s.js → X-BkKDRlJI.js} +1 -1
- package/dist/client/assets/{XCircle-CwRlSPkG.js → XCircle-sedM5Yzu.js} +1 -1
- package/dist/client/assets/{XClose-BYpD-FW2.js → XClose-Bx_xQQD_.js} +1 -1
- package/dist/client/assets/{Zap-BBT7v7w5.js → Zap-Cf_cpNNU.js} +1 -1
- package/dist/client/assets/{ZapSquare-q2bTQS4w.js → ZapSquare-DlRSLgAv.js} +1 -1
- package/dist/client/assets/{accordion-ChtmP3A-.js → accordion-DT47aOa3.js} +1 -1
- package/dist/client/assets/{agent-icon-aCG4rJO5.js → agent-icon-DUbGEO2S.js} +1 -1
- package/dist/client/assets/{agents-list-z6-U6t17.js → agents-list-rwKMRHld.js} +1 -1
- package/dist/client/assets/ai-providers-CRf0IUiu.js +1 -0
- package/dist/client/assets/{alert-dialog-DbOFkimV.js → alert-dialog-2Jj762BJ.js} +1 -1
- package/dist/client/assets/{auth-catchall-gGMZKA1c.js → auth-catchall-DTur9gCU.js} +1 -1
- package/dist/client/assets/{automation-list-row-CW7pxb1d.js → automation-list-row-Cuemsvmv.js} +1 -1
- package/dist/client/assets/{automations-BGGEy84S.js → automations-DN3LYNZV.js} +1 -1
- package/dist/client/assets/{avatar-aIgMbJGD.js → avatar-BoueLWcb.js} +1 -1
- package/dist/client/assets/{badge-DVYtPj3Q.js → badge-kdIe7Szq.js} +1 -1
- package/dist/client/assets/{brand-context-CWGrLOUV.js → brand-context-C39FhTOD.js} +1 -1
- package/dist/client/assets/{card-DF88hzU1.js → card-1EoqQ-Q7.js} +1 -1
- package/dist/client/assets/{chat-context-C_Gvp66M.js → chat-context-CqLR71Tu.js} +1 -1
- package/dist/client/assets/{checkbox-KaNd7DxH.js → checkbox-CL4jg0mR.js} +1 -1
- package/dist/client/assets/{collection-detail-CsOa-wP4.js → collection-detail-Be93090Z.js} +1 -1
- package/dist/client/assets/{collection-display-button-DX3qc6dM.js → collection-display-button-BWk8xHdj.js} +1 -1
- package/dist/client/assets/{collection-search-CW10ePNY.js → collection-search-B-8Jnp5p.js} +1 -1
- package/dist/client/assets/{collection-search-B_uLWogM.js → collection-search-BOMyE6Ld.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-jrC7a888.js → collection-table-wrapper-Cb-FxojL.js} +1 -1
- package/dist/client/assets/{collection-tabs-B4ahuefD.js → collection-tabs-Li95C-8Z.js} +1 -1
- package/dist/client/assets/{collections-BGO4ETj2.js → collections-BpcdhWS9.js} +1 -1
- package/dist/client/assets/{command-CI9ISywp.js → command-D-VqtTkt.js} +1 -1
- package/dist/client/assets/{connection-card-Bpyvc28P.js → connection-card-D4MG7ceA.js} +1 -1
- package/dist/client/assets/{connection-detail-CZhT71J5.js → connection-detail-C9HOgjUN.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BfvL5eFo.js → connection-form-helpers-C96WddUN.js} +1 -1
- package/dist/client/assets/{connections-BAYG38Zt.js → connections-Dudt-pG4.js} +1 -1
- package/dist/client/assets/{constants-D5Po9Lb5.js → constants--Z68frQS.js} +1 -1
- package/dist/client/assets/{constants-P7U02cV2.js → constants-BY3slQ5k.js} +1 -1
- package/dist/client/assets/{dialog-59APH-gQ.js → dialog-2qod6XLb.js} +1 -1
- package/dist/client/assets/{domain-settings-BGvTcpHg.js → domain-settings-BXrvw6Lv.js} +1 -1
- package/dist/client/assets/{drawer-IJtapzyu.js → drawer-DSH3rjuX.js} +1 -1
- package/dist/client/assets/{dropdown-menu-B2SzMipC.js → dropdown-menu-CYyf-ZrC.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Drvp3rfz.js → dynamic-plugin-layout-RlhEpflE.js} +1 -1
- package/dist/client/assets/{empty-state-DkaEz1nV.js → empty-state-BdiBdNme.js} +1 -1
- package/dist/client/assets/{empty-state-i6xsv-YS.js → empty-state-DebOy9XU.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B7tG5T45.js → extract-connection-data-BTMDGqDD.js} +1 -1
- package/dist/client/assets/{features-amfQ2FpE.js → features-Cxt-JPsD.js} +1 -1
- package/dist/client/assets/{form-DZNe3M-o.js → form-BxsxXSuZ.js} +1 -1
- package/dist/client/assets/{general-uTGUk0Bo.js → general-u1Y39J62.js} +1 -1
- package/dist/client/assets/{index-B_OOgiEa.js → index-0enbmaSe.js} +2 -2
- package/dist/client/assets/{index-CemFt8yz.js → index-BNtQbO2i.js} +1 -1
- package/dist/client/assets/{index-B2WBo1WB.js → index-BVirFM6V.js} +1 -1
- package/dist/client/assets/{index-B9Elrkih.js → index-Bna4Mzv7.js} +1 -1
- package/dist/client/assets/{index-BT3jRQuX.js → index-CJ3mMCam.js} +1 -1
- package/dist/client/assets/{index-_Kba4LMo.js → index-CbJD4O9M.js} +3 -3
- package/dist/client/assets/{index-BlLtpzeQ.js → index-Co04TeZ5.js} +1 -1
- package/dist/client/assets/{index-PTvg3Wun.js → index-CucV4lBd.js} +1 -1
- package/dist/client/assets/{index-9smU3vak.js → index-D1Os768e.js} +1 -1
- package/dist/client/assets/{index-0FuZBqpL.js → index-D9p0G3vk.js} +1 -1
- package/dist/client/assets/{index-CfMT-svD.js → index-DKffdYnU.js} +1 -1
- package/dist/client/assets/{index-CsMR0Ypg.js → index-Dk7VTW9z.js} +1 -1
- package/dist/client/assets/index-DmW2ChV3.js +1 -0
- package/dist/client/assets/{index-s4QTWOmY.js → index-DyLEkJ9h.js} +1 -1
- package/dist/client/assets/{index-DHTAzDdj.js → index-fQuO2Dc3.js} +1 -1
- package/dist/client/assets/{index-Cs0mksI2.js → index-sxBFqhbB.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Djo7_6Dx.js → infiniteQueryObserver-sxIykUWp.js} +1 -1
- package/dist/client/assets/{input-BQQp-6KZ.js → input-CZy7VBF-.js} +1 -1
- package/dist/client/assets/{integration-icon-Box-itol.js → integration-icon-Cgu3nEbl.js} +1 -1
- package/dist/client/assets/{label-DC5mP9Z5.js → label-BhPoqbH1.js} +1 -1
- package/dist/client/assets/{layout-DtZHLBeB.js → layout-jAXEQlv4.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-Drc7dSHp.js → lean-canvas-recruit-modal-Mo-uvZiE.js} +1 -1
- package/dist/client/assets/{login-pkkTGCaQ.js → login-BgB-8JX_.js} +1 -1
- package/dist/client/assets/{members-CCFl4lVb.js → members-D5i4jyvH.js} +1 -1
- package/dist/client/assets/{monaco-editor-Bx4gABcs.js → monaco-editor-D-E1NsT_.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Bzr2EdBL.js → monitoring-stats-row-CaU12GnW.js} +1 -1
- package/dist/client/assets/{oauth-callback-D2WYRLXX.js → oauth-callback-BrTY445n.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DiQQcEIA.js → oauth-callback-ai-provider-BA8nRDph.js} +1 -1
- package/dist/client/assets/{onboarding-C-xes3uo.js → onboarding-CAft2_BY.js} +1 -1
- package/dist/client/assets/{org-layout-d5JWtma9.js → org-layout-C0XY3j3w.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-_jGAIDyT.js → org-plugin-layout-CiPGTy9y.js} +1 -1
- package/dist/client/assets/{pair-C1uVZAxc.js → pair-DyP8v5ZE.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-By7qsYCS.js → plugin-empty-state-CPC4iNPZ.js} +1 -1
- package/dist/client/assets/{plugin-header-DmxH-nDy.js → plugin-header-BaIUgM8O.js} +1 -1
- package/dist/client/assets/{plugin-layout-DHq8VP6I.js → plugin-layout-CP7WeU3S.js} +1 -1
- package/dist/client/assets/{popover-BE2Ag2Hj.js → popover-g5bCjakL.js} +1 -1
- package/dist/client/assets/{profile-BiAUdeqZ.js → profile-DE9V4UAe.js} +1 -1
- package/dist/client/assets/{project-app-view-BWIUYPZS.js → project-app-view-CsUA3eWI.js} +1 -1
- package/dist/client/assets/registry-Cth6leQk.js +2 -0
- package/dist/client/assets/{registry-layout-D6WP-9Mz.js → registry-layout-IV9o5tdh.js} +1 -1
- package/dist/client/assets/{required-auth-layout-78lMndsk.js → required-auth-layout-CbwdpaRZ.js} +1 -1
- package/dist/client/assets/{reset-password-LLOtqeM3.js → reset-password-HK92arRg.js} +1 -1
- package/dist/client/assets/{roles-CrIxGBCo.js → roles-BWPZWJaM.js} +1 -1
- package/dist/client/assets/{scroll-area-BDlizEf_.js → scroll-area-DPp3zriG.js} +1 -1
- package/dist/client/assets/{search-input-Ck2WpyGM.js → search-input-DFpePjxv.js} +1 -1
- package/dist/client/assets/{select-Bibny-1X.js → select-DNBVly7-.js} +1 -1
- package/dist/client/assets/{select-model-CUnmfM2z.js → select-model-DeUWMCqm.js} +1 -1
- package/dist/client/assets/settings-layout-D82thllZ.js +1 -0
- package/dist/client/assets/{settings-section-BNYaFgEU.js → settings-section-DLmrAiBm.js} +1 -1
- package/dist/client/assets/{shell-layout-BKENpmuK.js → shell-layout-R4iIIify.js} +1 -1
- package/dist/client/assets/{skeleton-D20a7YZ_.js → skeleton-D3XIs5gC.js} +1 -1
- package/dist/client/assets/{sso-BS0m4Gbq.js → sso-DM0bDf34.js} +1 -1
- package/dist/client/assets/{store-CxbfCzK1.js → store-DBYsfjv2.js} +1 -1
- package/dist/client/assets/store-registry-Be_BNgv2.js +2 -0
- package/dist/client/assets/{switch-B5LXqu_k.js → switch-ChHlr-0p.js} +1 -1
- package/dist/client/assets/{table-YZX5FqNR.js → table-D-EfNZTA.js} +1 -1
- package/dist/client/assets/{tabs-DrXz1mKv.js → tabs-C3Y9bmk3.js} +1 -1
- package/dist/client/assets/{task-status-50r4iWhu.js → task-status-Byb391SI.js} +1 -1
- package/dist/client/assets/{textarea-B34jNm12.js → textarea-TEFGem1K.js} +1 -1
- package/dist/client/assets/{toggle-group-CrVa8CeF.js → toggle-group-DYAaGRJB.js} +1 -1
- package/dist/client/assets/{tools-list-DoRhQ4bQ.js → tools-list-DHP55xBU.js} +1 -1
- package/dist/client/assets/{tooltip-7fE-WE8n.js → tooltip-DZ4hI4gi.js} +1 -1
- package/dist/client/assets/{types-KIGJkxYN.js → types-D599MtjY.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BlHdNIJC.js → use-ai-providers-DSutNjVp.js} +1 -1
- package/dist/client/assets/{use-collections-BvXCKCPf.js → use-collections-BbQAdI3o.js} +1 -1
- package/dist/client/assets/{use-connection-BHzWUZTk.js → use-connection-CrEyI3P_.js} +1 -1
- package/dist/client/assets/{use-copy-BM6tbEKn.js → use-copy-Df3K3sfk.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B9su0hdd.js → use-create-virtual-mcp-t8SMbFkV.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BBrYSIAA.js → use-debounced-autosave-IAh8TU4o.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DUjp4NXe.js → use-decopilot-events-CxAD33F2.js} +1 -1
- package/dist/client/assets/{use-delete-connection-D8QH8qmD.js → use-delete-connection-zP-NAmKT.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-nwbx-KTg.js → use-infinite-scroll-hrqUZmbE.js} +1 -1
- package/dist/client/assets/{use-list-state-DRAznPzR.js → use-list-state-DsStSeaC.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DkrDenYe.js → use-mcp-tools-kqffQmIa.js} +1 -1
- package/dist/client/assets/{use-members-H_2fli-8.js → use-members-BqQiitMx.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DM6COLbJ.js → use-navigate-to-agent-DkjTuG5H.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DQZC7OFW.js → use-org-auth-client-DM9zvqH-.js} +1 -1
- package/dist/client/assets/{use-org-sso-LaD6hSpN.js → use-org-sso-DFTMWioi.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Tf-ts5gx.js → use-organization-roles-CzgnOad2.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CXJ-uDFo.js → use-organization-settings-CZnRZbph.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BnSuTCtJ.js → use-registry-connections-CT-N1sCh.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CW-esQf_.js → use-status-sounds-Bewyc919.js} +1 -1
- package/dist/client/assets/{use-tasks-_5SYg2Al.js → use-tasks-9cquzKq3.js} +1 -1
- package/dist/client/assets/{use-view-mode-C2T_AD4N.js → use-view-mode-B2bqG4ko.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Bqk6k6NQ.js → use-virtual-mcp-Bl5HfgtI.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-P_vpKUlW.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-CdjREh1b.js +1 -0
- package/dist/client/assets/{user-8chVVoiM.js → user-BmqT7ATa.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Dg2K0IHy.js → view-mode-toggle-DdV_2G2i.js} +1 -1
- package/dist/client/assets/{workflow-DLu1DTyd.js → workflow-Oj5odTn3.js} +1 -1
- package/dist/client/assets/workflow-detail-BT6eq7UZ.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +77 -73
- package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
- package/dist/server/node_modules/ansi-styles/index.js +223 -0
- package/dist/server/node_modules/ansi-styles/package.json +54 -0
- package/dist/server/node_modules/ansi-styles/readme.md +173 -0
- package/dist/server/node_modules/onetime/index.d.ts +64 -0
- package/dist/server/node_modules/onetime/index.js +44 -0
- package/dist/server/node_modules/{mimic-fn → onetime}/package.json +16 -15
- package/dist/server/node_modules/onetime/readme.md +94 -0
- package/dist/server/server.js +76 -72
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-v-Xe3QBL.js +0 -1
- package/dist/client/assets/index-D9JwUOO_.js +0 -1
- package/dist/client/assets/registry-CBHaV5Tp.js +0 -2
- package/dist/client/assets/settings-layout-DHrmC_DN.js +0 -1
- package/dist/client/assets/store-registry-DaiC69PW.js +0 -2
- package/dist/client/assets/useInfiniteQuery-ZZ7aYlwI.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-UOA0UYpI.js +0 -1
- package/dist/client/assets/workflow-detail-c0UiiwlM.js +0 -1
- package/dist/server/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
- package/dist/server/node_modules/emoji-regex/README.md +0 -107
- package/dist/server/node_modules/emoji-regex/index.d.ts +0 -3
- package/dist/server/node_modules/emoji-regex/index.js +0 -4
- package/dist/server/node_modules/emoji-regex/index.mjs +0 -4
- package/dist/server/node_modules/emoji-regex/package.json +0 -45
- package/dist/server/node_modules/get-east-asian-width/index.d.ts +0 -60
- package/dist/server/node_modules/get-east-asian-width/index.js +0 -30
- package/dist/server/node_modules/get-east-asian-width/lookup-data.js +0 -18
- package/dist/server/node_modules/get-east-asian-width/lookup.js +0 -135
- package/dist/server/node_modules/get-east-asian-width/package.json +0 -71
- package/dist/server/node_modules/get-east-asian-width/readme.md +0 -65
- package/dist/server/node_modules/get-east-asian-width/utilities.js +0 -24
- package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
- package/dist/server/node_modules/is-fullwidth-code-point/index.js +0 -12
- package/dist/server/node_modules/is-fullwidth-code-point/package.json +0 -53
- package/dist/server/node_modules/is-fullwidth-code-point/readme.md +0 -31
- package/dist/server/node_modules/mimic-fn/index.d.ts +0 -54
- package/dist/server/node_modules/mimic-fn/index.js +0 -13
- package/dist/server/node_modules/mimic-fn/license +0 -9
- package/dist/server/node_modules/mimic-fn/readme.md +0 -69
- package/dist/server/node_modules/pg-int8/LICENSE +0 -13
- package/dist/server/node_modules/pg-int8/README.md +0 -16
- package/dist/server/node_modules/pg-int8/index.js +0 -100
- package/dist/server/node_modules/pg-int8/package.json +0 -24
- package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
- package/dist/server/node_modules/postgres-array/index.js +0 -97
- package/dist/server/node_modules/postgres-array/license +0 -21
- package/dist/server/node_modules/postgres-array/package.json +0 -35
- package/dist/server/node_modules/postgres-array/readme.md +0 -43
- package/dist/server/node_modules/postgres-bytea/index.js +0 -33
- package/dist/server/node_modules/postgres-bytea/license +0 -21
- package/dist/server/node_modules/postgres-bytea/package.json +0 -34
- package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
- package/dist/server/node_modules/postgres-date/index.js +0 -116
- package/dist/server/node_modules/postgres-date/license +0 -21
- package/dist/server/node_modules/postgres-date/package.json +0 -33
- package/dist/server/node_modules/postgres-date/readme.md +0 -49
- package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
- package/dist/server/node_modules/postgres-interval/index.js +0 -125
- package/dist/server/node_modules/postgres-interval/license +0 -21
- package/dist/server/node_modules/postgres-interval/package.json +0 -36
- package/dist/server/node_modules/postgres-interval/readme.md +0 -48
- package/dist/server/node_modules/split2/LICENSE +0 -13
- package/dist/server/node_modules/split2/README.md +0 -85
- package/dist/server/node_modules/split2/bench.js +0 -27
- package/dist/server/node_modules/split2/index.js +0 -141
- package/dist/server/node_modules/split2/package.json +0 -39
- package/dist/server/node_modules/split2/test.js +0 -409
- /package/dist/server/node_modules/{get-east-asian-width → ansi-styles}/license +0 -0
- /package/dist/server/node_modules/{is-fullwidth-code-point → onetime}/license +0 -0
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (c) 2014-2021, Matteo Collina <hello@matteocollina.com>
|
|
3
|
-
|
|
4
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
-
purpose with or without fee is hereby granted, provided that the above
|
|
6
|
-
copyright notice and this permission notice appear in all copies.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
9
|
-
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
10
|
-
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
11
|
-
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
12
|
-
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
13
|
-
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
14
|
-
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
'use strict'
|
|
18
|
-
|
|
19
|
-
const { Transform } = require('stream')
|
|
20
|
-
const { StringDecoder } = require('string_decoder')
|
|
21
|
-
const kLast = Symbol('last')
|
|
22
|
-
const kDecoder = Symbol('decoder')
|
|
23
|
-
|
|
24
|
-
function transform (chunk, enc, cb) {
|
|
25
|
-
let list
|
|
26
|
-
if (this.overflow) { // Line buffer is full. Skip to start of next line.
|
|
27
|
-
const buf = this[kDecoder].write(chunk)
|
|
28
|
-
list = buf.split(this.matcher)
|
|
29
|
-
|
|
30
|
-
if (list.length === 1) return cb() // Line ending not found. Discard entire chunk.
|
|
31
|
-
|
|
32
|
-
// Line ending found. Discard trailing fragment of previous line and reset overflow state.
|
|
33
|
-
list.shift()
|
|
34
|
-
this.overflow = false
|
|
35
|
-
} else {
|
|
36
|
-
this[kLast] += this[kDecoder].write(chunk)
|
|
37
|
-
list = this[kLast].split(this.matcher)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
this[kLast] = list.pop()
|
|
41
|
-
|
|
42
|
-
for (let i = 0; i < list.length; i++) {
|
|
43
|
-
try {
|
|
44
|
-
push(this, this.mapper(list[i]))
|
|
45
|
-
} catch (error) {
|
|
46
|
-
return cb(error)
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
this.overflow = this[kLast].length > this.maxLength
|
|
51
|
-
if (this.overflow && !this.skipOverflow) {
|
|
52
|
-
cb(new Error('maximum buffer reached'))
|
|
53
|
-
return
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
cb()
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function flush (cb) {
|
|
60
|
-
// forward any gibberish left in there
|
|
61
|
-
this[kLast] += this[kDecoder].end()
|
|
62
|
-
|
|
63
|
-
if (this[kLast]) {
|
|
64
|
-
try {
|
|
65
|
-
push(this, this.mapper(this[kLast]))
|
|
66
|
-
} catch (error) {
|
|
67
|
-
return cb(error)
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
cb()
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function push (self, val) {
|
|
75
|
-
if (val !== undefined) {
|
|
76
|
-
self.push(val)
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function noop (incoming) {
|
|
81
|
-
return incoming
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function split (matcher, mapper, options) {
|
|
85
|
-
// Set defaults for any arguments not supplied.
|
|
86
|
-
matcher = matcher || /\r?\n/
|
|
87
|
-
mapper = mapper || noop
|
|
88
|
-
options = options || {}
|
|
89
|
-
|
|
90
|
-
// Test arguments explicitly.
|
|
91
|
-
switch (arguments.length) {
|
|
92
|
-
case 1:
|
|
93
|
-
// If mapper is only argument.
|
|
94
|
-
if (typeof matcher === 'function') {
|
|
95
|
-
mapper = matcher
|
|
96
|
-
matcher = /\r?\n/
|
|
97
|
-
// If options is only argument.
|
|
98
|
-
} else if (typeof matcher === 'object' && !(matcher instanceof RegExp) && !matcher[Symbol.split]) {
|
|
99
|
-
options = matcher
|
|
100
|
-
matcher = /\r?\n/
|
|
101
|
-
}
|
|
102
|
-
break
|
|
103
|
-
|
|
104
|
-
case 2:
|
|
105
|
-
// If mapper and options are arguments.
|
|
106
|
-
if (typeof matcher === 'function') {
|
|
107
|
-
options = mapper
|
|
108
|
-
mapper = matcher
|
|
109
|
-
matcher = /\r?\n/
|
|
110
|
-
// If matcher and options are arguments.
|
|
111
|
-
} else if (typeof mapper === 'object') {
|
|
112
|
-
options = mapper
|
|
113
|
-
mapper = noop
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
options = Object.assign({}, options)
|
|
118
|
-
options.autoDestroy = true
|
|
119
|
-
options.transform = transform
|
|
120
|
-
options.flush = flush
|
|
121
|
-
options.readableObjectMode = true
|
|
122
|
-
|
|
123
|
-
const stream = new Transform(options)
|
|
124
|
-
|
|
125
|
-
stream[kLast] = ''
|
|
126
|
-
stream[kDecoder] = new StringDecoder('utf8')
|
|
127
|
-
stream.matcher = matcher
|
|
128
|
-
stream.mapper = mapper
|
|
129
|
-
stream.maxLength = options.maxLength
|
|
130
|
-
stream.skipOverflow = options.skipOverflow || false
|
|
131
|
-
stream.overflow = false
|
|
132
|
-
stream._destroy = function (err, cb) {
|
|
133
|
-
// Weird Node v12 bug that we need to work around
|
|
134
|
-
this._writableState.errorEmitted = false
|
|
135
|
-
cb(err)
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return stream
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
module.exports = split
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "split2",
|
|
3
|
-
"version": "4.2.0",
|
|
4
|
-
"description": "split a Text Stream into a Line Stream, using Stream 3",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"lint": "standard --verbose",
|
|
8
|
-
"unit": "nyc --lines 100 --branches 100 --functions 100 --check-coverage --reporter=text tape test.js",
|
|
9
|
-
"coverage": "nyc --reporter=html --reporter=cobertura --reporter=text tape test/test.js",
|
|
10
|
-
"test:report": "npm run lint && npm run unit:report",
|
|
11
|
-
"test": "npm run lint && npm run unit",
|
|
12
|
-
"legacy": "tape test.js"
|
|
13
|
-
},
|
|
14
|
-
"pre-commit": [
|
|
15
|
-
"test"
|
|
16
|
-
],
|
|
17
|
-
"website": "https://github.com/mcollina/split2",
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "https://github.com/mcollina/split2.git"
|
|
21
|
-
},
|
|
22
|
-
"bugs": {
|
|
23
|
-
"url": "http://github.com/mcollina/split2/issues"
|
|
24
|
-
},
|
|
25
|
-
"engines": {
|
|
26
|
-
"node": ">= 10.x"
|
|
27
|
-
},
|
|
28
|
-
"author": "Matteo Collina <hello@matteocollina.com>",
|
|
29
|
-
"license": "ISC",
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"binary-split": "^1.0.3",
|
|
32
|
-
"callback-stream": "^1.1.0",
|
|
33
|
-
"fastbench": "^1.0.0",
|
|
34
|
-
"nyc": "^15.0.1",
|
|
35
|
-
"pre-commit": "^1.1.2",
|
|
36
|
-
"standard": "^17.0.0",
|
|
37
|
-
"tape": "^5.0.0"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,409 +0,0 @@
|
|
|
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
|
-
})
|
|
File without changes
|
|
File without changes
|