decocms 2.186.6 → 2.186.7
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-CMykqSBg.js → AlertCircle-CE4aMC_6.js} +1 -1
- package/dist/client/assets/{ArrowLeft-uGR-9mNu.js → ArrowLeft-VzQjF5nf.js} +1 -1
- package/dist/client/assets/{ArrowUp-nzMjud7y.js → ArrowUp-DVMY0e13.js} +1 -1
- package/dist/client/assets/{Check-xiDQ8BtU.js → Check-BgcEZAFd.js} +1 -1
- package/dist/client/assets/{ChevronDown-Br-9w7at.js → ChevronDown-Ca93y5Zg.js} +1 -1
- package/dist/client/assets/{ChevronRight-9oNUepCi.js → ChevronRight-iThFOnTS.js} +1 -1
- package/dist/client/assets/{ChevronUp-Cn8mueH6.js → ChevronUp-Dfrjh0kb.js} +1 -1
- package/dist/client/assets/{Container-2jV0v6El.js → Container-BQWbDEy6.js} +1 -1
- package/dist/client/assets/{Dataflow03-DxoSS6Mb.js → Dataflow03-DdTzEDv9.js} +1 -1
- package/dist/client/assets/{FolderClosed-rSkxBpcc.js → FolderClosed-jb7WzUeW.js} +1 -1
- package/dist/client/assets/{Loading01-BcvCGReP.js → Loading01-CrI0NwPE.js} +1 -1
- package/dist/client/assets/{Play-CfPk1Jil.js → Play-DSddPPya.js} +1 -1
- package/dist/client/assets/{Plus-_0WPT4fC.js → Plus-ltkKoqJz.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-7vLfxx-h.js → RefreshCcw01-DN-y3At7.js} +1 -1
- package/dist/client/assets/{SearchMd-Drvt0RJI.js → SearchMd-CS43V34Y.js} +1 -1
- package/dist/client/assets/{Settings01-BWfYiv65.js → Settings01-ClJz1ULQ.js} +1 -1
- package/dist/client/assets/{Trash01-1xYo27RH.js → Trash01-fCw8HP0s.js} +1 -1
- package/dist/client/assets/{Type01-BYtXAD5n.js → Type01-Dp2k0by5.js} +1 -1
- package/dist/client/assets/{Upload01-B0BJCQ_e.js → Upload01-3AVPYkeL.js} +1 -1
- package/dist/client/assets/{User01-BeQd85RG.js → User01-CKoZ8ZDH.js} +1 -1
- package/dist/client/assets/{X-COxH8ezg.js → X-BNpME-HX.js} +1 -1
- package/dist/client/assets/{XCircle-DF_H_9sl.js → XCircle-MpsZU5qt.js} +1 -1
- package/dist/client/assets/{XClose-DN7ytwf7.js → XClose-DKDxXEaA.js} +1 -1
- package/dist/client/assets/{Zap-EKbyzC1z.js → Zap-kD49gPEF.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-BJR4An4x.js → agent-connections-preview-DusvXNLB.js} +1 -1
- package/dist/client/assets/{agent-detail-S7Xnyf74.js → agent-detail-B-PecVBx.js} +1 -1
- package/dist/client/assets/{agents-DGMB2xM-.js → agents-DTWgODy0.js} +1 -1
- package/dist/client/assets/{ai-providers-logos-AsQMrQkI.js → ai-providers-logos-Bp_JBc4Z.js} +1 -1
- package/dist/client/assets/{alert-dialog-CahR3t2-.js → alert-dialog-DPu-w5FH.js} +1 -1
- package/dist/client/assets/{auth-catchall-CuUUPNMf.js → auth-catchall-CVoq5acq.js} +1 -1
- package/dist/client/assets/{automation-detail-D21R_NZo.js → automation-detail-BtlNzqYH.js} +1 -1
- package/dist/client/assets/{automations-BDE5mXwW.js → automations-B9MMi9MY.js} +1 -1
- package/dist/client/assets/{avatar-CUJtyPo2.js → avatar-DJ_eE6FL.js} +1 -1
- package/dist/client/assets/{badge-CED9DV1z.js → badge-Dg_rRuRo.js} +1 -1
- package/dist/client/assets/{breadcrumb-CCQEGtsd.js → breadcrumb-B3Pzyfpg.js} +1 -1
- package/dist/client/assets/{card-CPxXaS9B.js → card-CQTuw0Xi.js} +1 -1
- package/dist/client/assets/{checkbox-BkHtMStR.js → checkbox-pwwqVDt-.js} +1 -1
- package/dist/client/assets/{collapsible-B030Rvpo.js → collapsible-BpfdSPbv.js} +1 -1
- package/dist/client/assets/{collection-detail-6j0HNb-_.js → collection-detail-7hb0Mplz.js} +1 -1
- package/dist/client/assets/{collection-display-button--wDfVH13.js → collection-display-button-DgaN6ief.js} +1 -1
- package/dist/client/assets/{collection-search-DpxIEj2Y.js → collection-search-BxbLLE-D.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-fDncVs5S.js → collection-table-wrapper-DhM52ivn.js} +1 -1
- package/dist/client/assets/{collection-tabs-CqPectm8.js → collection-tabs-B87Atjwc.js} +1 -1
- package/dist/client/assets/{collections-D4sy0Xs0.js → collections-pcWRi6G6.js} +1 -1
- package/dist/client/assets/{command-BeBA7wJA.js → command-CIWQeRGP.js} +1 -1
- package/dist/client/assets/{connection-card-Bji8m80q.js → connection-card-CM5AlZwH.js} +1 -1
- package/dist/client/assets/{connection-detail-CGya4X8s.js → connection-detail-O3fmkpqe.js} +1 -1
- package/dist/client/assets/{connections-CzVW7p9D.js → connections-BCkT2NPr.js} +1 -1
- package/dist/client/assets/{constants-C2mKle9u.js → constants-B7D0VCWO.js} +1 -1
- package/dist/client/assets/constants-B_S2_Dfe.js +1 -0
- package/dist/client/assets/{context-BiAMhAiB.js → context-IJmL4QO_.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-MUEiKqL8.js → create-organization-dialog-ixA2WoW7.js} +1 -1
- package/dist/client/assets/{create-project-dialog-B8VM2kbV.js → create-project-dialog-B6n_03Ug.js} +1 -1
- package/dist/client/assets/{danger-CCuvZ302.js → danger-CYvp_RGb.js} +1 -1
- package/dist/client/assets/{danger-zone-R1YnFMha.js → danger-zone-xpmW0-9o.js} +1 -1
- package/dist/client/assets/{dependencies-usSRHhHV.js → dependencies-C9e_dQDy.js} +1 -1
- package/dist/client/assets/{dialog-DkflQEEK.js → dialog-Ce95gXqs.js} +1 -1
- package/dist/client/assets/{drawer-CWTdsYcu.js → drawer-ByM8CEL_.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CPUZgeQt.js → dropdown-menu-BT7g2ayh.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-COn0BiTQ.js → dynamic-plugin-layout-exCUjntN.js} +1 -1
- package/dist/client/assets/{editable-task-title-CXF21pnu.js → editable-task-title-wQy-5KA-.js} +1 -1
- package/dist/client/assets/{empty-state-mZytJ7Og.js → empty-state-8546_PpL.js} +1 -1
- package/dist/client/assets/{empty-state-DLNIkqnc.js → empty-state-CjwgvmoI.js} +1 -1
- package/dist/client/assets/{env-vars-editor-74-7rifU.js → env-vars-editor-Cn7u3DNm.js} +1 -1
- package/dist/client/assets/{extract-connection-data-0iT2_wST.js → extract-connection-data-OUAaU9Od.js} +1 -1
- package/dist/client/assets/{form-DTthvfe9.js → form-BxnLhCD_.js} +1 -1
- package/dist/client/assets/{general-g1xkIict.js → general-CnJT7yxb.js} +1 -1
- package/dist/client/assets/{home-29e6ki_m.js → home-CVvG2Fqq.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-1gjK7_AP.js → import-from-deco-dialog-Chrnp3Cw.js} +1 -1
- package/dist/client/assets/{index-ZixwJ1Pk.js → index-3yf2NnlI.js} +1 -1
- package/dist/client/assets/{index-DIir8pgm.js → index-B62MiQAu.js} +2 -2
- package/dist/client/assets/{index-DTnP3oIT.js → index-BcOdsrKl.js} +1 -1
- package/dist/client/assets/{index-CuI-2Tt-.js → index-C-wrel8E.js} +1 -1
- package/dist/client/assets/{index--5l6Kd5l.js → index-CMA-66KF.js} +1 -1
- package/dist/client/assets/{index-Cb6NnGWb.js → index-CsLoKsqY.js} +1 -1
- package/dist/client/assets/{index-DIiriVeM.js → index-DAKvcNkQ.js} +1 -1
- package/dist/client/assets/{index-B_aEJlRD.js → index-DNarCA5m.js} +1 -1
- package/dist/client/assets/{index-DcP_WR0J.js → index-DXw26Swq.js} +1 -1
- package/dist/client/assets/{index-Dz9R7lP6.js → index-DehDS4SM.js} +1 -1
- package/dist/client/assets/{index-DoQQIBf1.js → index-DrtlaMfG.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-D_1D5AYq.js → infiniteQueryObserver-C4rkYsAc.js} +1 -1
- package/dist/client/assets/{input-BVAvDQ_C.js → input-BNSWRvAr.js} +1 -1
- package/dist/client/assets/{integration-icon-B_0G_X87.js → integration-icon-BByVvYW2.js} +1 -1
- package/dist/client/assets/{label-C6omQTs_.js → label-C-5U7XF4.js} +1 -1
- package/dist/client/assets/{layout-D4tWA0bw.js → layout-CxMMzlDg.js} +1 -1
- package/dist/client/assets/{layout-AYXb28rc.js → layout-DuIBVgOo.js} +1 -1
- package/dist/client/assets/{login-Cx7hoJoT.js → login-ayW5J8kp.js} +1 -1
- package/dist/client/assets/{logo-upload-FTAEWKjw.js → logo-upload-Cnlppzw5.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DDZtzzcL.js → mcp-app-renderer-C5hh7NUh.js} +1 -1
- package/dist/client/assets/{mcp-server-card-C8wXu9yO.js → mcp-server-card-3TrMzryK.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-BVknczom.js → mcp-server-detail-BHg2jU2j.js} +2 -2
- package/dist/client/assets/{members-CczX95O-.js → members-DR64AFBa.js} +1 -1
- package/dist/client/assets/{monaco-editor-BF2WLfQD.js → monaco-editor-0MGgMe6Z.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-6dYajQ_1.js → monitoring-dashboard-edit-D0wDbirt.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-C154UPGx.js → monitoring-dashboard-view-Cye--xow.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C6qBbHow.js → monitoring-stats-row-Br-gOcw_.js} +1 -1
- package/dist/client/assets/{monitoring-9XsThidn.js → monitoring-zjAHbr2Y.js} +1 -1
- package/dist/client/assets/{oauth-callback-3Syoq1nk.js → oauth-callback-C5qRKz1E.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-udnTMnIE.js → oauth-callback-ai-provider-Belxh9YS.js} +1 -1
- package/dist/client/assets/{org-ai-providers-BZX8CBbC.js → org-ai-providers-vLOcM2IN.js} +1 -1
- package/dist/client/assets/{page-B8I6CLK9.js → page-Bk-6gYjF.js} +1 -1
- package/dist/client/assets/{page-DG6axqmW.js → page-D9taTz3x.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-Bt8UXvj0.js → plugin-empty-state-DwTx3Irb.js} +1 -1
- package/dist/client/assets/{plugin-header-DT9lR12I.js → plugin-header-_SJ-AMks.js} +1 -1
- package/dist/client/assets/plugins-_-cF0kV-.js +1 -0
- package/dist/client/assets/{popover-BMBGvHQ_.js → popover-CW4G5neq.js} +1 -1
- package/dist/client/assets/{project-app-view-fuhRg8H7.js → project-app-view-Cxge46GP.js} +1 -1
- package/dist/client/assets/{project-layout-DWnRAr4s.js → project-layout-CszLr05H.js} +1 -1
- package/dist/client/assets/{project-plugins-CRqpdPvu.js → project-plugins-CB_lBTqe.js} +1 -1
- package/dist/client/assets/{projects-list-Dl8bD1xL.js → projects-list-BAFLJ8Ur.js} +1 -1
- package/dist/client/assets/{registry-layout-CdBoBkB6.js → registry-layout-BFPpF2ab.js} +1 -1
- package/dist/client/assets/{registry-utils-pfpET92F.js → registry-utils-DWGplsmC.js} +1 -1
- package/dist/client/assets/{reset-password-BL4AtRcT.js → reset-password-D2kT9zWB.js} +1 -1
- package/dist/client/assets/{resizable-CcW4J8VD.js → resizable-DFwU4W6w.js} +1 -1
- package/dist/client/assets/{save-actions-3dOJ5Mjm.js → save-actions-CmbT6lbz.js} +1 -1
- package/dist/client/assets/{scroll-area-Bqfa6wPc.js → scroll-area-DEb4D9kS.js} +1 -1
- package/dist/client/assets/{select-CBE7xbF4.js → select-BY6esNmT.js} +1 -1
- package/dist/client/assets/{select-virtual-mcp-Bco91LS8.js → select-virtual-mcp-C6Eik732.js} +1 -1
- package/dist/client/assets/{shell-layout-BVpZ2wZ-.js → shell-layout-BPQbdNig.js} +2 -2
- package/dist/client/assets/{sidebar-settings-BpXHJmnQ.js → sidebar-settings-LoxM-jfH.js} +1 -1
- package/dist/client/assets/{skeleton-CQd2QEI9.js → skeleton-H6tvOoEj.js} +1 -1
- package/dist/client/assets/{spinner-DCPsu4ZG.js → spinner-X15c9Qjw.js} +1 -1
- package/dist/client/assets/{store-invite-D4qgWC83.js → store-invite-CbJMqLqm.js} +1 -1
- package/dist/client/assets/{switch-CDhXZx5x.js → switch-1W8o5vam.js} +1 -1
- package/dist/client/assets/{table-CGhKFeKb.js → table-oKRuJlES.js} +1 -1
- package/dist/client/assets/{tabs-BMh4okm_.js → tabs-wloAa-G_.js} +1 -1
- package/dist/client/assets/{task-status-2ts0kYwT.js → task-status-DtA3vCfp.js} +1 -1
- package/dist/client/assets/tasks-DYQdfmG5.js +1 -0
- package/dist/client/assets/{tasks-panel-0RmxrVW1.js → tasks-panel-CfTCpIaN.js} +1 -1
- package/dist/client/assets/{textarea-CdQzy4Ij.js → textarea-Db5eGrte.js} +1 -1
- package/dist/client/assets/{time-range-picker-obtb96_y.js → time-range-picker-kvCom5E0.js} +1 -1
- package/dist/client/assets/{toggle-group-BvQ8i1-N.js → toggle-group-nuX--X8U.js} +1 -1
- package/dist/client/assets/{tools-list-SV45eRcg.js → tools-list-CzNHOfxQ.js} +1 -1
- package/dist/client/assets/{tooltip-iG9fvlrZ.js → tooltip-Cz2tQy7f.js} +1 -1
- package/dist/client/assets/{types-BJ15oicG.js → types-B85FeN8J.js} +1 -1
- package/dist/client/assets/{use-automations-DDYigIn8.js → use-automations-Bmzs_h6Z.js} +1 -1
- package/dist/client/assets/{use-collections-CeVeE6L5.js → use-collections-Cw-CkhM5.js} +1 -1
- package/dist/client/assets/{use-connection-B3ekSVUc.js → use-connection-u5F7YTDM.js} +1 -1
- package/dist/client/assets/{use-copy-DFqHt08d.js → use-copy-DXoYLkGY.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-J-6A5Uhg.js → use-create-virtual-mcp-B6BY4hNy.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DbO9lGzn.js → use-infinite-scroll-BCAoqpbu.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-BKwLRanW.js → use-install-from-registry-Bh4CcElp.js} +1 -1
- package/dist/client/assets/{use-list-state-BSx7RPGJ.js → use-list-state-J17yqbOy.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-ClavsAnj.js → use-mcp-prompts-C4rv2YNo.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-BuE1rP0c.js → use-mcp-resources-C2RRZo8d.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-JDKA9UZ8.js → use-mcp-tools-CS9dH9Hk.js} +1 -1
- package/dist/client/assets/{use-members-DNGgajFa.js → use-members-L6twvwj_.js} +1 -1
- package/dist/client/assets/{use-project-DvVOFuu-.js → use-project-DmzlV8IR.js} +1 -1
- package/dist/client/assets/{use-store-discovery-dPavPbA-.js → use-store-discovery-B_zVCnQi.js} +1 -1
- package/dist/client/assets/{use-view-mode-BijqAGDe.js → use-view-mode-DDZQlalb.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DXFVfjMZ.js → use-virtual-mcp-BQ1ML2v_.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-D_7z7Ekt.js +1 -0
- package/dist/client/assets/{useMutation-DPjXSTSD.js → useMutation-5tF0rOhi.js} +1 -1
- package/dist/client/assets/useQuery-Cr3Ibn6v.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-UikfpG9C.js +1 -0
- package/dist/client/assets/{user-BAgoGcDp.js → user-Wn7CHNY8.js} +1 -1
- package/dist/client/assets/{workflow-CrjjFLE3.js → workflow-CehUk0kO.js} +1 -1
- package/dist/client/assets/{workflow-DCKJ21al.js → workflow-DGOWYrJv.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +338 -337
- 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/license +9 -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/mimic-fn/index.d.ts +54 -0
- package/dist/server/node_modules/mimic-fn/index.js +13 -0
- package/dist/server/node_modules/mimic-fn/license +9 -0
- package/dist/server/node_modules/mimic-fn/package.json +42 -0
- package/dist/server/node_modules/mimic-fn/readme.md +69 -0
- package/dist/server/node_modules/pg-int8/LICENSE +13 -0
- package/dist/server/node_modules/pg-int8/README.md +16 -0
- package/dist/server/node_modules/pg-int8/index.js +100 -0
- package/dist/server/node_modules/pg-int8/package.json +24 -0
- package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
- package/dist/server/node_modules/postgres-array/index.js +97 -0
- package/dist/server/node_modules/postgres-array/license +21 -0
- package/dist/server/node_modules/postgres-array/package.json +35 -0
- package/dist/server/node_modules/postgres-array/readme.md +43 -0
- package/dist/server/node_modules/postgres-bytea/index.js +33 -0
- package/dist/server/node_modules/postgres-bytea/license +21 -0
- package/dist/server/node_modules/postgres-bytea/package.json +34 -0
- package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
- package/dist/server/node_modules/postgres-date/index.js +116 -0
- package/dist/server/node_modules/postgres-date/license +21 -0
- package/dist/server/node_modules/postgres-date/package.json +33 -0
- package/dist/server/node_modules/postgres-date/readme.md +49 -0
- package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
- package/dist/server/node_modules/postgres-interval/index.js +125 -0
- package/dist/server/node_modules/postgres-interval/license +21 -0
- package/dist/server/node_modules/postgres-interval/package.json +36 -0
- package/dist/server/node_modules/postgres-interval/readme.md +48 -0
- package/dist/server/node_modules/split2/LICENSE +13 -0
- package/dist/server/node_modules/split2/README.md +85 -0
- package/dist/server/node_modules/split2/bench.js +27 -0
- package/dist/server/node_modules/split2/index.js +141 -0
- package/dist/server/node_modules/split2/package.json +39 -0
- package/dist/server/node_modules/split2/test.js +409 -0
- package/dist/server/node_modules/xtend/.jshintrc +30 -0
- package/dist/server/node_modules/{pg → xtend}/LICENSE +6 -7
- package/dist/server/node_modules/xtend/README.md +32 -0
- package/dist/server/node_modules/xtend/immutable.js +19 -0
- package/dist/server/node_modules/xtend/mutable.js +17 -0
- package/dist/server/node_modules/xtend/package.json +55 -0
- package/dist/server/node_modules/xtend/test.js +103 -0
- package/dist/server/server.js +269 -269
- package/package.json +1 -1
- package/dist/client/assets/constants-CUwoz2Qc.js +0 -1
- package/dist/client/assets/plugins-S0nxg7Xk.js +0 -1
- package/dist/client/assets/tasks-DR3nWr8j.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DfmHdhse.js +0 -1
- package/dist/client/assets/useQuery-BJg_09kQ.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-xbYvMmn4.js +0 -1
- package/dist/server/node_modules/pg/README.md +0 -95
- package/dist/server/node_modules/pg/esm/index.mjs +0 -20
- package/dist/server/node_modules/pg/lib/client.js +0 -743
- package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
- package/dist/server/node_modules/pg/lib/connection.js +0 -221
- package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
- package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
- package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
- package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
- package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
- package/dist/server/node_modules/pg/lib/defaults.js +0 -91
- package/dist/server/node_modules/pg/lib/index.js +0 -73
- package/dist/server/node_modules/pg/lib/native/client.js +0 -323
- package/dist/server/node_modules/pg/lib/native/index.js +0 -2
- package/dist/server/node_modules/pg/lib/native/query.js +0 -165
- package/dist/server/node_modules/pg/lib/query.js +0 -252
- package/dist/server/node_modules/pg/lib/result.js +0 -109
- package/dist/server/node_modules/pg/lib/stream.js +0 -83
- package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
- package/dist/server/node_modules/pg/lib/utils.js +0 -217
- package/dist/server/node_modules/pg/package.json +0 -76
|
@@ -0,0 +1,141 @@
|
|
|
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
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
}
|
|
@@ -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
|
+
})
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"maxdepth": 4,
|
|
3
|
+
"maxstatements": 200,
|
|
4
|
+
"maxcomplexity": 12,
|
|
5
|
+
"maxlen": 80,
|
|
6
|
+
"maxparams": 5,
|
|
7
|
+
|
|
8
|
+
"curly": true,
|
|
9
|
+
"eqeqeq": true,
|
|
10
|
+
"immed": true,
|
|
11
|
+
"latedef": false,
|
|
12
|
+
"noarg": true,
|
|
13
|
+
"noempty": true,
|
|
14
|
+
"nonew": true,
|
|
15
|
+
"undef": true,
|
|
16
|
+
"unused": "vars",
|
|
17
|
+
"trailing": true,
|
|
18
|
+
|
|
19
|
+
"quotmark": true,
|
|
20
|
+
"expr": true,
|
|
21
|
+
"asi": true,
|
|
22
|
+
|
|
23
|
+
"browser": false,
|
|
24
|
+
"esnext": true,
|
|
25
|
+
"devel": false,
|
|
26
|
+
"node": false,
|
|
27
|
+
"nonstandard": false,
|
|
28
|
+
|
|
29
|
+
"predef": ["require", "module", "__dirname", "__filename"]
|
|
30
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2010 - 2021 Brian Carlson
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
Copyright (c) 2012-2014 Raynos.
|
|
4
3
|
|
|
5
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
5
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -9,13 +8,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
9
8
|
copies of the Software, and to permit persons to whom the Software is
|
|
10
9
|
furnished to do so, subject to the following conditions:
|
|
11
10
|
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
copies or substantial portions of the Software.
|
|
11
|
+
The above copyright notice and this permission notice shall be included in
|
|
12
|
+
all copies or substantial portions of the Software.
|
|
14
13
|
|
|
15
14
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
15
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
16
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
17
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
18
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
SOFTWARE.
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
20
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# xtend
|
|
2
|
+
|
|
3
|
+
[![browser support][3]][4]
|
|
4
|
+
|
|
5
|
+
[](http://github.com/badges/stability-badges)
|
|
6
|
+
|
|
7
|
+
Extend like a boss
|
|
8
|
+
|
|
9
|
+
xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence.
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
var extend = require("xtend")
|
|
15
|
+
|
|
16
|
+
// extend returns a new object. Does not mutate arguments
|
|
17
|
+
var combination = extend({
|
|
18
|
+
a: "a",
|
|
19
|
+
b: "c"
|
|
20
|
+
}, {
|
|
21
|
+
b: "b"
|
|
22
|
+
})
|
|
23
|
+
// { a: "a", b: "b" }
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Stability status: Locked
|
|
27
|
+
|
|
28
|
+
## MIT Licensed
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
[3]: http://ci.testling.com/Raynos/xtend.png
|
|
32
|
+
[4]: http://ci.testling.com/Raynos/xtend
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module.exports = extend
|
|
2
|
+
|
|
3
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
4
|
+
|
|
5
|
+
function extend() {
|
|
6
|
+
var target = {}
|
|
7
|
+
|
|
8
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
9
|
+
var source = arguments[i]
|
|
10
|
+
|
|
11
|
+
for (var key in source) {
|
|
12
|
+
if (hasOwnProperty.call(source, key)) {
|
|
13
|
+
target[key] = source[key]
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return target
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module.exports = extend
|
|
2
|
+
|
|
3
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
4
|
+
|
|
5
|
+
function extend(target) {
|
|
6
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
7
|
+
var source = arguments[i]
|
|
8
|
+
|
|
9
|
+
for (var key in source) {
|
|
10
|
+
if (hasOwnProperty.call(source, key)) {
|
|
11
|
+
target[key] = source[key]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return target
|
|
17
|
+
}
|