decocms 2.310.1 → 2.310.2
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-BUuG9jUS.js → AlertCircle-Bjs1DRoe.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-B2WgGuUG.js → ArrowNarrowLeft-4-qtN4yo.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BRxJDyw2.js → ArrowUpRight-TOJd4tk1.js} +1 -1
- package/dist/client/assets/{Check-DNFNSXQB.js → Check-uCeCY94f.js} +1 -1
- package/dist/client/assets/{CheckCircle-fDjMIV_J.js → CheckCircle-BYjzCjZv.js} +1 -1
- package/dist/client/assets/{ChevronDown-plDbvt9_.js → ChevronDown-BCKKMGkp.js} +1 -1
- package/dist/client/assets/{ChevronRight-C6IGuK_L.js → ChevronRight-CBRO8ebn.js} +1 -1
- package/dist/client/assets/{ChevronUp-BQpSShtW.js → ChevronUp-CImlARUB.js} +1 -1
- package/dist/client/assets/{Container-cby1lpQK.js → Container-UmsQv9ox.js} +1 -1
- package/dist/client/assets/{DotsVertical-CrL41KCh.js → DotsVertical-DYz9Xowp.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DDjHJHtD.js → LinkExternal01-MfoA7_8K.js} +1 -1
- package/dist/client/assets/{Lock01-CMc8wMJA.js → Lock01-DY0dR_EF.js} +1 -1
- package/dist/client/assets/{Palette-BsSq52os.js → Palette-CYlPasQS.js} +1 -1
- package/dist/client/assets/{Play-B93BJPTD.js → Play-BOunn_Vy.js} +1 -1
- package/dist/client/assets/{Plus-CsU0klMp.js → Plus-DJQM2qca.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-GcJ7_jjW.js → RefreshCcw01-fb__YhOw.js} +1 -1
- package/dist/client/assets/{SearchMd-CLV2ZHE1.js → SearchMd-Bv6wAjVm.js} +1 -1
- package/dist/client/assets/{Settings02-CMQBJ6AU.js → Settings02-ZxqKPBpN.js} +1 -1
- package/dist/client/assets/{Shield01-Bb8uicnU.js → Shield01-DLP8JywO.js} +1 -1
- package/dist/client/assets/{Star01-DOzaFb6_.js → Star01-DO3o-Tm0.js} +1 -1
- package/dist/client/assets/{Sun-Bp560G7u.js → Sun-CZnXZvsq.js} +1 -1
- package/dist/client/assets/{Tool01-B1WXLPyp.js → Tool01-D8__PXyN.js} +1 -1
- package/dist/client/assets/{Trash01-WbvRG8Rr.js → Trash01-CaQDsaot.js} +1 -1
- package/dist/client/assets/{User01-Dqi_S_yw.js → User01-oR5RStEl.js} +1 -1
- package/dist/client/assets/{Users03-CmMFskSR.js → Users03-BsIZE4Pm.js} +1 -1
- package/dist/client/assets/{X-26aOhFK-.js → X-vjP4Msb7.js} +1 -1
- package/dist/client/assets/{XCircle-DuIm7Kpp.js → XCircle-Bjg8qJ8l.js} +1 -1
- package/dist/client/assets/{XClose-Bet7IpXN.js → XClose-CaKKQVXU.js} +1 -1
- package/dist/client/assets/{Zap-DHkXBm_R.js → Zap-CSBwa9kl.js} +1 -1
- package/dist/client/assets/{ZapSquare-B0Ev1OMS.js → ZapSquare-B2TPVAEq.js} +1 -1
- package/dist/client/assets/{accordion-D1MMgTV5.js → accordion-BtvBKlj9.js} +1 -1
- package/dist/client/assets/{agent-icon-BhSIvnHs.js → agent-icon-BwpnpUbm.js} +1 -1
- package/dist/client/assets/{agents-list-DfRZsmWN.js → agents-list-DO7W3l8_.js} +1 -1
- package/dist/client/assets/ai-providers-CHwiNXP4.js +1 -0
- package/dist/client/assets/{alert-dialog-Booud0bQ.js → alert-dialog-C-BRVgvu.js} +1 -1
- package/dist/client/assets/{auth-catchall-CfLpBYfo.js → auth-catchall-CutI2kmj.js} +1 -1
- package/dist/client/assets/{automation-list-row-3UbFqf20.js → automation-list-row-DAEvSBmb.js} +1 -1
- package/dist/client/assets/{automations-Bpw-Bphr.js → automations-CgXPCVHi.js} +1 -1
- package/dist/client/assets/{avatar-Dr_hgnh5.js → avatar-DMfNBsEa.js} +1 -1
- package/dist/client/assets/{badge-Dc_jqHv8.js → badge-IDvBfH3R.js} +1 -1
- package/dist/client/assets/{brand-context-DDkAkGby.js → brand-context-BJ_Ok-7-.js} +1 -1
- package/dist/client/assets/{card-I8QwhHay.js → card-CvuzGHjO.js} +1 -1
- package/dist/client/assets/{chat-context-DANvJNxJ.js → chat-context-CErwb6k6.js} +1 -1
- package/dist/client/assets/{checkbox-YDqzyyON.js → checkbox-Dl75QnG7.js} +1 -1
- package/dist/client/assets/{collection-detail-CEcX9P1L.js → collection-detail-D1GYoMQ-.js} +1 -1
- package/dist/client/assets/{collection-display-button-CEbXTT1D.js → collection-display-button-DuQih4HO.js} +1 -1
- package/dist/client/assets/{collection-search-54YVIzGK.js → collection-search-BbV_T-EE.js} +1 -1
- package/dist/client/assets/{collection-search-ZtrOS_FO.js → collection-search-FABAZQZ-.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CykRk2i4.js → collection-table-wrapper-BOjY1N-o.js} +1 -1
- package/dist/client/assets/{collection-tabs-BJYdyh2U.js → collection-tabs-D9DYouIo.js} +1 -1
- package/dist/client/assets/{collections-B4Ew0_5W.js → collections-CWT6-czY.js} +1 -1
- package/dist/client/assets/{command-BUdSnxPX.js → command-BcVlajkv.js} +1 -1
- package/dist/client/assets/{connection-card-CPkO4XVy.js → connection-card-5Wnkn35H.js} +1 -1
- package/dist/client/assets/{connection-detail-7MO-vamz.js → connection-detail-9LTY8cEq.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DTw0Qq7p.js → connection-form-helpers-D_o8vWS8.js} +1 -1
- package/dist/client/assets/{connections-Cae6WzSq.js → connections-B0_zSoBW.js} +1 -1
- package/dist/client/assets/{constants-C0Z_UV1B.js → constants-BgsGWL53.js} +1 -1
- package/dist/client/assets/{constants-8vN_wpoM.js → constants-Ccic_WNi.js} +1 -1
- package/dist/client/assets/{dialog-ChC8b-fd.js → dialog-BG4etlBR.js} +1 -1
- package/dist/client/assets/{domain-settings-wSm6QNFe.js → domain-settings-DrdMk60b.js} +1 -1
- package/dist/client/assets/{drawer-C1rmyAh5.js → drawer-Buc4-066.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BYnm4L0S.js → dropdown-menu-C5QgSZ0t.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-C8rDQhFA.js → dynamic-plugin-layout-CaV8IAmp.js} +1 -1
- package/dist/client/assets/{empty-state-CS1xioMM.js → empty-state-CAqrQ-6W.js} +1 -1
- package/dist/client/assets/{empty-state-B5SEGNSf.js → empty-state-CcdlS-eW.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CnZlsGuF.js → extract-connection-data-DbON8nO3.js} +1 -1
- package/dist/client/assets/{features-B16s5Y96.js → features-ByRqjbyV.js} +1 -1
- package/dist/client/assets/{form-DgLK3RL7.js → form-BbDzJOpZ.js} +1 -1
- package/dist/client/assets/{general-f6TAIn-G.js → general-e5vvtodI.js} +1 -1
- package/dist/client/assets/{index-CGzddOPN.js → index-17qzAK95.js} +1 -1
- package/dist/client/assets/index-7mXC8lS4.js +1 -0
- package/dist/client/assets/{index-BrFuw-qb.js → index-B-lZvo-3.js} +1 -1
- package/dist/client/assets/{index-DlX-BDoo.js → index-BBwsyhew.js} +1 -1
- package/dist/client/assets/{index-CgQIf70g.js → index-BYF0TDJs.js} +1 -1
- package/dist/client/assets/{index-C5EaiV0u.js → index-BZSXOPw-.js} +1 -1
- package/dist/client/assets/{index-DsyVbeAM.js → index-BdxUoNpQ.js} +3 -3
- package/dist/client/assets/{index-D3id_i25.js → index-Bo98JLt6.js} +1 -1
- package/dist/client/assets/{index-TdWHe30j.js → index-Bt0njY-h.js} +1 -1
- package/dist/client/assets/{index-CVMf-cdp.js → index-Bu6OchAc.js} +1 -1
- package/dist/client/assets/{index-CbahmBQ1.js → index-C6BloEPE.js} +1 -1
- package/dist/client/assets/{index-fsAFWsFR.js → index-CAEMKqmE.js} +1 -1
- package/dist/client/assets/{index--hcGoWBP.js → index-CsPnm66A.js} +2 -2
- package/dist/client/assets/{index-BtR3GFsv.js → index-DDAuFNoU.js} +1 -1
- package/dist/client/assets/{index-ofAY-Kzj.js → index-DwFLYZMx.js} +1 -1
- package/dist/client/assets/{index-DCa8vMMj.js → index-viV87izi.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Bw_LLK9Y.js → infiniteQueryObserver-BD3sb9pN.js} +1 -1
- package/dist/client/assets/{input-Di5VhXrx.js → input-BOyPyslv.js} +1 -1
- package/dist/client/assets/{integration-icon-BFclX5Vo.js → integration-icon-BXKm0FXI.js} +1 -1
- package/dist/client/assets/{label--CSWWgsb.js → label-C1HjlN95.js} +1 -1
- package/dist/client/assets/{layout-DGzZ7eIZ.js → layout-BoLVBNZl.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-BRNt7FNZ.js → lean-canvas-recruit-modal-BXaOF7Ji.js} +1 -1
- package/dist/client/assets/{login-CWxs7FH8.js → login-BNbNZ57q.js} +1 -1
- package/dist/client/assets/{members-D-RcZScv.js → members-CZREN_th.js} +1 -1
- package/dist/client/assets/{monaco-editor-BRZw2Ss_.js → monaco-editor-3btV5byi.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BELQHcMp.js → monitoring-stats-row-TeqbUQfb.js} +1 -1
- package/dist/client/assets/{oauth-callback-D1mU79r6.js → oauth-callback-CASHqw5B.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BI3N0zYC.js → oauth-callback-ai-provider-DRX_3ZGd.js} +1 -1
- package/dist/client/assets/{onboarding-Corplh-J.js → onboarding-snq0kuQC.js} +1 -1
- package/dist/client/assets/{org-layout-Dw015CRn.js → org-layout-BlsnG8tD.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-BhY_p3Sb.js → org-plugin-layout-CkIHlyUf.js} +1 -1
- package/dist/client/assets/{pair-BkQ-4R0Y.js → pair-DoCidCoS.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-Daxzikof.js → plugin-empty-state-BEExeVzS.js} +1 -1
- package/dist/client/assets/{plugin-header-DxSn3bJb.js → plugin-header-DONB160y.js} +1 -1
- package/dist/client/assets/{plugin-layout-CLDR8aeJ.js → plugin-layout-LrDjSSJL.js} +1 -1
- package/dist/client/assets/{popover-BxTvqO7l.js → popover-DJTDvTFH.js} +1 -1
- package/dist/client/assets/{profile-CiaA4yp_.js → profile-DvNhWfFq.js} +1 -1
- package/dist/client/assets/{project-app-view-C9qLbJFL.js → project-app-view-DH36c9up.js} +1 -1
- package/dist/client/assets/registry-BZEongCI.js +2 -0
- package/dist/client/assets/{registry-layout-DUo-P35f.js → registry-layout-cP1e-tCx.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BnqlPeG9.js → required-auth-layout-Aj03mUWl.js} +1 -1
- package/dist/client/assets/{reset-password-DHzLCFSu.js → reset-password-DaTq0ZPl.js} +1 -1
- package/dist/client/assets/{roles-qTMcTl_m.js → roles-BevJu7Hb.js} +1 -1
- package/dist/client/assets/{scroll-area-VgUNFi6v.js → scroll-area-Dlh0OJL1.js} +1 -1
- package/dist/client/assets/{search-input-Fm6Uugnb.js → search-input-BbuJZtoW.js} +1 -1
- package/dist/client/assets/{select-4BiO-1He.js → select-BkJAPRFR.js} +1 -1
- package/dist/client/assets/{select-model-DbFtB1R4.js → select-model-Cx6hCHLC.js} +1 -1
- package/dist/client/assets/{settings-layout-B4AxAY74.js → settings-layout-BBbpwWqq.js} +1 -1
- package/dist/client/assets/{settings-section-BqQHUry6.js → settings-section-OhWt9Ooj.js} +1 -1
- package/dist/client/assets/{shell-layout-CcLP72E6.js → shell-layout-CwAongAC.js} +1 -1
- package/dist/client/assets/{skeleton-D_v3jh_x.js → skeleton-BkdIXnLT.js} +1 -1
- package/dist/client/assets/{sso-BgjWtdcn.js → sso-BpRBatM1.js} +1 -1
- package/dist/client/assets/{store-IULAwEa2.js → store-CE6jKSPr.js} +1 -1
- package/dist/client/assets/store-registry-MTXbjb_8.js +2 -0
- package/dist/client/assets/{switch-Uh77-H9s.js → switch-Bipu3FI7.js} +1 -1
- package/dist/client/assets/{table-BCa0VyBS.js → table-Bk_qf725.js} +1 -1
- package/dist/client/assets/{tabs-CJMCPubd.js → tabs-BZ0uT4sS.js} +1 -1
- package/dist/client/assets/{task-status-QVkFLAWD.js → task-status-DiRItLYw.js} +1 -1
- package/dist/client/assets/{textarea-IkB1PXd2.js → textarea-BrWSFj_2.js} +1 -1
- package/dist/client/assets/{toggle-group-CxTeQVbK.js → toggle-group-CG-UehNQ.js} +1 -1
- package/dist/client/assets/{tools-list-PZv7L79s.js → tools-list-BRI0XzAw.js} +1 -1
- package/dist/client/assets/{tooltip-DwEKoS3m.js → tooltip-DKSC_TlS.js} +1 -1
- package/dist/client/assets/{types-DBa5NWuL.js → types-ClrLgxxx.js} +1 -1
- package/dist/client/assets/{use-ai-providers-hUoQ1QKn.js → use-ai-providers-DeSA23rL.js} +1 -1
- package/dist/client/assets/{use-collections-CbyJ6t6i.js → use-collections-P_xycvTV.js} +1 -1
- package/dist/client/assets/{use-connection-BZIS5d-M.js → use-connection-BPL4_0km.js} +1 -1
- package/dist/client/assets/{use-copy-BhwMe7lW.js → use-copy-CTq_kAqD.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Qup6KxHA.js → use-create-virtual-mcp-D1V6z6nu.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-De7heoii.js → use-debounced-autosave-BN0dAXmt.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BSFPv0OJ.js → use-decopilot-events-FPrAaowc.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CVL2tyXf.js → use-delete-connection-BnyXIIOY.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-B1XpJhs7.js → use-infinite-scroll-CRwUMH1o.js} +1 -1
- package/dist/client/assets/{use-list-state-NYzHNEE3.js → use-list-state-41gWh47f.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DEJYwjVI.js → use-mcp-tools-BItotVJ3.js} +1 -1
- package/dist/client/assets/{use-members-CE8F-6Pl.js → use-members-CI97myG6.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BQCBqC6w.js → use-navigate-to-agent-CVA2Amec.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DWMaaDOW.js → use-org-auth-client-C8ofbFUE.js} +1 -1
- package/dist/client/assets/{use-org-sso-DG73ueOt.js → use-org-sso-BxOse5AC.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C_InafKr.js → use-organization-roles-5CJlDHYt.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DU3tZPVG.js → use-organization-settings-DkdX8Pu1.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BB_6SUlA.js → use-registry-connections-BOLgJOOJ.js} +1 -1
- package/dist/client/assets/{use-status-sounds--S4wlp-c.js → use-status-sounds-C2j9qKjC.js} +1 -1
- package/dist/client/assets/{use-tasks-BXrbnymy.js → use-tasks-B1tiIeuc.js} +1 -1
- package/dist/client/assets/{use-view-mode-30iczyXm.js → use-view-mode-ZXMMFhU_.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DqC7TCRl.js → use-virtual-mcp-BAEgLpb5.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Y9Nb1sum.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-CIGmGEj7.js +1 -0
- package/dist/client/assets/{user-CU2SK3qY.js → user-CHucb2Kt.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-ChONnJPm.js → view-mode-toggle-DR7xk3lS.js} +1 -1
- package/dist/client/assets/{workflow-C2A8waKp.js → workflow-BYv_2auF.js} +1 -1
- package/dist/client/assets/workflow-detail-D3A--f-7.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- 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/escape-string-regexp/index.d.ts +18 -0
- package/dist/server/node_modules/escape-string-regexp/index.js +11 -0
- package/dist/server/node_modules/escape-string-regexp/package.json +43 -0
- package/dist/server/node_modules/escape-string-regexp/readme.md +29 -0
- package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
- package/dist/server/node_modules/is-fullwidth-code-point/index.js +12 -0
- package/dist/server/node_modules/{slice-ansi → is-fullwidth-code-point}/license +0 -1
- package/dist/server/node_modules/is-fullwidth-code-point/package.json +53 -0
- package/dist/server/node_modules/is-fullwidth-code-point/readme.md +31 -0
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-C2Z8tM8W.js +0 -1
- package/dist/client/assets/index-Cf1ZbDa8.js +0 -1
- package/dist/client/assets/registry-Ijr9ccjx.js +0 -2
- package/dist/client/assets/store-registry-BRPkAkWY.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Cy6k7dIo.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DvQj0VfO.js +0 -1
- package/dist/client/assets/workflow-detail-DtfIhsSe.js +0 -1
- 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/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/package.json +0 -42
- 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/slice-ansi/index.d.ts +0 -19
- package/dist/server/node_modules/slice-ansi/index.js +0 -260
- package/dist/server/node_modules/slice-ansi/package.json +0 -59
- package/dist/server/node_modules/slice-ansi/readme.md +0 -54
- package/dist/server/node_modules/slice-ansi/tokenize-ansi.js +0 -752
- 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/{mimic-fn → escape-string-regexp}/license +0 -0
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
var extend = require('xtend/mutable')
|
|
4
|
-
|
|
5
|
-
module.exports = PostgresInterval
|
|
6
|
-
|
|
7
|
-
function PostgresInterval (raw) {
|
|
8
|
-
if (!(this instanceof PostgresInterval)) {
|
|
9
|
-
return new PostgresInterval(raw)
|
|
10
|
-
}
|
|
11
|
-
extend(this, parse(raw))
|
|
12
|
-
}
|
|
13
|
-
var properties = ['seconds', 'minutes', 'hours', 'days', 'months', 'years']
|
|
14
|
-
PostgresInterval.prototype.toPostgres = function () {
|
|
15
|
-
var filtered = properties.filter(this.hasOwnProperty, this)
|
|
16
|
-
|
|
17
|
-
// In addition to `properties`, we need to account for fractions of seconds.
|
|
18
|
-
if (this.milliseconds && filtered.indexOf('seconds') < 0) {
|
|
19
|
-
filtered.push('seconds')
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (filtered.length === 0) return '0'
|
|
23
|
-
return filtered
|
|
24
|
-
.map(function (property) {
|
|
25
|
-
var value = this[property] || 0
|
|
26
|
-
|
|
27
|
-
// Account for fractional part of seconds,
|
|
28
|
-
// remove trailing zeroes.
|
|
29
|
-
if (property === 'seconds' && this.milliseconds) {
|
|
30
|
-
value = (value + this.milliseconds / 1000).toFixed(6).replace(/\.?0+$/, '')
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return value + ' ' + property
|
|
34
|
-
}, this)
|
|
35
|
-
.join(' ')
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
var propertiesISOEquivalent = {
|
|
39
|
-
years: 'Y',
|
|
40
|
-
months: 'M',
|
|
41
|
-
days: 'D',
|
|
42
|
-
hours: 'H',
|
|
43
|
-
minutes: 'M',
|
|
44
|
-
seconds: 'S'
|
|
45
|
-
}
|
|
46
|
-
var dateProperties = ['years', 'months', 'days']
|
|
47
|
-
var timeProperties = ['hours', 'minutes', 'seconds']
|
|
48
|
-
// according to ISO 8601
|
|
49
|
-
PostgresInterval.prototype.toISOString = PostgresInterval.prototype.toISO = function () {
|
|
50
|
-
var datePart = dateProperties
|
|
51
|
-
.map(buildProperty, this)
|
|
52
|
-
.join('')
|
|
53
|
-
|
|
54
|
-
var timePart = timeProperties
|
|
55
|
-
.map(buildProperty, this)
|
|
56
|
-
.join('')
|
|
57
|
-
|
|
58
|
-
return 'P' + datePart + 'T' + timePart
|
|
59
|
-
|
|
60
|
-
function buildProperty (property) {
|
|
61
|
-
var value = this[property] || 0
|
|
62
|
-
|
|
63
|
-
// Account for fractional part of seconds,
|
|
64
|
-
// remove trailing zeroes.
|
|
65
|
-
if (property === 'seconds' && this.milliseconds) {
|
|
66
|
-
value = (value + this.milliseconds / 1000).toFixed(6).replace(/0+$/, '')
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return value + propertiesISOEquivalent[property]
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
var NUMBER = '([+-]?\\d+)'
|
|
74
|
-
var YEAR = NUMBER + '\\s+years?'
|
|
75
|
-
var MONTH = NUMBER + '\\s+mons?'
|
|
76
|
-
var DAY = NUMBER + '\\s+days?'
|
|
77
|
-
var TIME = '([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?'
|
|
78
|
-
var INTERVAL = new RegExp([YEAR, MONTH, DAY, TIME].map(function (regexString) {
|
|
79
|
-
return '(' + regexString + ')?'
|
|
80
|
-
})
|
|
81
|
-
.join('\\s*'))
|
|
82
|
-
|
|
83
|
-
// Positions of values in regex match
|
|
84
|
-
var positions = {
|
|
85
|
-
years: 2,
|
|
86
|
-
months: 4,
|
|
87
|
-
days: 6,
|
|
88
|
-
hours: 9,
|
|
89
|
-
minutes: 10,
|
|
90
|
-
seconds: 11,
|
|
91
|
-
milliseconds: 12
|
|
92
|
-
}
|
|
93
|
-
// We can use negative time
|
|
94
|
-
var negatives = ['hours', 'minutes', 'seconds', 'milliseconds']
|
|
95
|
-
|
|
96
|
-
function parseMilliseconds (fraction) {
|
|
97
|
-
// add omitted zeroes
|
|
98
|
-
var microseconds = fraction + '000000'.slice(fraction.length)
|
|
99
|
-
return parseInt(microseconds, 10) / 1000
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function parse (interval) {
|
|
103
|
-
if (!interval) return {}
|
|
104
|
-
var matches = INTERVAL.exec(interval)
|
|
105
|
-
var isNegative = matches[8] === '-'
|
|
106
|
-
return Object.keys(positions)
|
|
107
|
-
.reduce(function (parsed, property) {
|
|
108
|
-
var position = positions[property]
|
|
109
|
-
var value = matches[position]
|
|
110
|
-
// no empty string
|
|
111
|
-
if (!value) return parsed
|
|
112
|
-
// milliseconds are actually microseconds (up to 6 digits)
|
|
113
|
-
// with omitted trailing zeroes.
|
|
114
|
-
value = property === 'milliseconds'
|
|
115
|
-
? parseMilliseconds(value)
|
|
116
|
-
: parseInt(value, 10)
|
|
117
|
-
// no zeros
|
|
118
|
-
if (!value) return parsed
|
|
119
|
-
if (isNegative && ~negatives.indexOf(property)) {
|
|
120
|
-
value *= -1
|
|
121
|
-
}
|
|
122
|
-
parsed[property] = value
|
|
123
|
-
return parsed
|
|
124
|
-
}, {})
|
|
125
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) Ben Drucker <bvdrucker@gmail.com> (bendrucker.me)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
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
|
-
THE SOFTWARE.
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "postgres-interval",
|
|
3
|
-
"main": "index.js",
|
|
4
|
-
"version": "1.2.0",
|
|
5
|
-
"description": "Parse Postgres interval columns",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"repository": "bendrucker/postgres-interval",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Ben Drucker",
|
|
10
|
-
"email": "bvdrucker@gmail.com",
|
|
11
|
-
"url": "bendrucker.me"
|
|
12
|
-
},
|
|
13
|
-
"engines": {
|
|
14
|
-
"node": ">=0.10.0"
|
|
15
|
-
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"test": "standard && tape test.js"
|
|
18
|
-
},
|
|
19
|
-
"keywords": [
|
|
20
|
-
"postgres",
|
|
21
|
-
"interval",
|
|
22
|
-
"parser"
|
|
23
|
-
],
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"xtend": "^4.0.0"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"tape": "^4.0.0",
|
|
29
|
-
"standard": "^12.0.1"
|
|
30
|
-
},
|
|
31
|
-
"files": [
|
|
32
|
-
"index.js",
|
|
33
|
-
"index.d.ts",
|
|
34
|
-
"readme.md"
|
|
35
|
-
]
|
|
36
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# postgres-interval [](https://travis-ci.org/bendrucker/postgres-interval) [](https://greenkeeper.io/)
|
|
2
|
-
|
|
3
|
-
> Parse Postgres interval columns
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## Install
|
|
7
|
-
|
|
8
|
-
```
|
|
9
|
-
$ npm install --save postgres-interval
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
var parse = require('postgres-interval')
|
|
17
|
-
var interval = parse('01:02:03')
|
|
18
|
-
//=> {hours: 1, minutes: 2, seconds: 3}
|
|
19
|
-
interval.toPostgres()
|
|
20
|
-
// 3 seconds 2 minutes 1 hours
|
|
21
|
-
interval.toISO()
|
|
22
|
-
// P0Y0M0DT1H2M3S
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## API
|
|
26
|
-
|
|
27
|
-
#### `parse(pgInterval)` -> `interval`
|
|
28
|
-
|
|
29
|
-
##### pgInterval
|
|
30
|
-
|
|
31
|
-
*Required*
|
|
32
|
-
Type: `string`
|
|
33
|
-
|
|
34
|
-
A Postgres interval string.
|
|
35
|
-
|
|
36
|
-
#### `interval.toPostgres()` -> `string`
|
|
37
|
-
|
|
38
|
-
Returns an interval string. This allows the interval object to be passed into prepared statements.
|
|
39
|
-
|
|
40
|
-
#### `interval.toISOString()` -> `string`
|
|
41
|
-
|
|
42
|
-
Returns an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) compliant string.
|
|
43
|
-
|
|
44
|
-
Also available as `interval.toISO()` for backwards compatibility.
|
|
45
|
-
|
|
46
|
-
## License
|
|
47
|
-
|
|
48
|
-
MIT © [Ben Drucker](http://bendrucker.me)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Slice a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles)
|
|
3
|
-
|
|
4
|
-
@param string - A string with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk).
|
|
5
|
-
@param startSlice - Zero-based visible-column index at which to start the slice. Grapheme clusters are kept intact.
|
|
6
|
-
@param endSlice - Zero-based visible-column index at which to end the slice.
|
|
7
|
-
|
|
8
|
-
@example
|
|
9
|
-
```
|
|
10
|
-
import chalk from 'chalk';
|
|
11
|
-
import sliceAnsi from 'slice-ansi';
|
|
12
|
-
|
|
13
|
-
const string = 'The quick brown ' + chalk.red('fox jumped over ') +
|
|
14
|
-
'the lazy ' + chalk.green('dog and then ran away with the unicorn.');
|
|
15
|
-
|
|
16
|
-
console.log(sliceAnsi(string, 20, 30));
|
|
17
|
-
```
|
|
18
|
-
*/
|
|
19
|
-
export default function sliceAnsi(string: string, startSlice: number, endSlice?: number): string;
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import tokenizeAnsi from './tokenize-ansi.js';
|
|
2
|
-
|
|
3
|
-
function applySgrFragments(activeStyles, fragments) {
|
|
4
|
-
for (const fragment of fragments) {
|
|
5
|
-
switch (fragment.type) {
|
|
6
|
-
case 'reset': {
|
|
7
|
-
activeStyles.clear();
|
|
8
|
-
break;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
case 'end': {
|
|
12
|
-
activeStyles.delete(fragment.endCode);
|
|
13
|
-
break;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
case 'start': {
|
|
17
|
-
activeStyles.delete(fragment.endCode);
|
|
18
|
-
activeStyles.set(fragment.endCode, fragment.code);
|
|
19
|
-
break;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
default: {
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return activeStyles;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function undoAnsiCodes(activeStyles) {
|
|
32
|
-
return [...activeStyles.keys()].reverse().join('');
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function closeHyperlink(hyperlinkToken) {
|
|
36
|
-
return `${hyperlinkToken.closePrefix}${hyperlinkToken.terminator}`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function shouldIncludeSgrAfterEnd(token, activeStyles) {
|
|
40
|
-
let hasStartFragment = false;
|
|
41
|
-
let hasClosingEffect = false;
|
|
42
|
-
|
|
43
|
-
for (const fragment of token.fragments) {
|
|
44
|
-
if (fragment.type === 'start') {
|
|
45
|
-
hasStartFragment = true;
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (fragment.type === 'reset' && activeStyles.size > 0) {
|
|
50
|
-
hasClosingEffect = true;
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (fragment.type === 'end' && activeStyles.has(fragment.endCode)) {
|
|
55
|
-
hasClosingEffect = true;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return hasClosingEffect && !hasStartFragment;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function applySgrToken({token, isPastEnd, activeStyles, returnValue, include, activeHyperlink, position}) {
|
|
63
|
-
if (isPastEnd && !shouldIncludeSgrAfterEnd(token, activeStyles)) {
|
|
64
|
-
return {
|
|
65
|
-
activeStyles,
|
|
66
|
-
activeHyperlink,
|
|
67
|
-
position,
|
|
68
|
-
returnValue,
|
|
69
|
-
include,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
activeStyles = applySgrFragments(activeStyles, token.fragments);
|
|
74
|
-
if (include) {
|
|
75
|
-
returnValue += token.code;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return {
|
|
79
|
-
activeStyles,
|
|
80
|
-
activeHyperlink,
|
|
81
|
-
position,
|
|
82
|
-
returnValue,
|
|
83
|
-
include,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function applyHyperlinkToken({token, isPastEnd, activeStyles, activeHyperlink, position, returnValue, include}) {
|
|
88
|
-
if (
|
|
89
|
-
isPastEnd
|
|
90
|
-
&& (
|
|
91
|
-
token.action !== 'close'
|
|
92
|
-
|| !activeHyperlink
|
|
93
|
-
)
|
|
94
|
-
) {
|
|
95
|
-
return {
|
|
96
|
-
activeStyles,
|
|
97
|
-
activeHyperlink,
|
|
98
|
-
position,
|
|
99
|
-
returnValue,
|
|
100
|
-
include,
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (token.action === 'open') {
|
|
105
|
-
activeHyperlink = token;
|
|
106
|
-
} else if (token.action === 'close') {
|
|
107
|
-
activeHyperlink = undefined;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (include) {
|
|
111
|
-
returnValue += token.code;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return {
|
|
115
|
-
activeStyles,
|
|
116
|
-
activeHyperlink,
|
|
117
|
-
position,
|
|
118
|
-
returnValue,
|
|
119
|
-
include,
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function applyControlToken({token, isPastEnd, activeStyles, activeHyperlink, position, returnValue, include}) {
|
|
124
|
-
if (!isPastEnd && include) {
|
|
125
|
-
returnValue += token.code;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return {
|
|
129
|
-
activeStyles,
|
|
130
|
-
activeHyperlink,
|
|
131
|
-
position,
|
|
132
|
-
returnValue,
|
|
133
|
-
include,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function applyCharacterToken({token, start, activeStyles, activeHyperlink, position, returnValue, include}) {
|
|
138
|
-
if (
|
|
139
|
-
!include
|
|
140
|
-
&& position >= start
|
|
141
|
-
&& !token.isGraphemeContinuation
|
|
142
|
-
) {
|
|
143
|
-
include = true;
|
|
144
|
-
returnValue = [...activeStyles.values()].join('');
|
|
145
|
-
if (activeHyperlink) {
|
|
146
|
-
returnValue += activeHyperlink.code;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (include) {
|
|
151
|
-
returnValue += token.value;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
position += token.visibleWidth;
|
|
155
|
-
return {
|
|
156
|
-
activeStyles,
|
|
157
|
-
activeHyperlink,
|
|
158
|
-
position,
|
|
159
|
-
returnValue,
|
|
160
|
-
include,
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
const tokenHandlers = {
|
|
165
|
-
sgr: applySgrToken,
|
|
166
|
-
hyperlink: applyHyperlinkToken,
|
|
167
|
-
control: applyControlToken,
|
|
168
|
-
character: applyCharacterToken,
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
function applyToken(parameters) {
|
|
172
|
-
const tokenHandler = tokenHandlers[parameters.token.type];
|
|
173
|
-
if (!tokenHandler) {
|
|
174
|
-
const {
|
|
175
|
-
activeStyles,
|
|
176
|
-
activeHyperlink,
|
|
177
|
-
position,
|
|
178
|
-
returnValue,
|
|
179
|
-
include,
|
|
180
|
-
} = parameters;
|
|
181
|
-
|
|
182
|
-
return {
|
|
183
|
-
activeStyles,
|
|
184
|
-
activeHyperlink,
|
|
185
|
-
position,
|
|
186
|
-
returnValue,
|
|
187
|
-
include,
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
return tokenHandler(parameters);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function createHasContinuationAheadMap(tokens) {
|
|
195
|
-
const hasContinuationAhead = Array.from({length: tokens.length}, () => false);
|
|
196
|
-
let nextCharacterIsContinuation = false;
|
|
197
|
-
|
|
198
|
-
for (let tokenIndex = tokens.length - 1; tokenIndex >= 0; tokenIndex--) {
|
|
199
|
-
const token = tokens[tokenIndex];
|
|
200
|
-
hasContinuationAhead[tokenIndex] = nextCharacterIsContinuation;
|
|
201
|
-
if (token.type === 'character') {
|
|
202
|
-
nextCharacterIsContinuation = Boolean(token.isGraphemeContinuation);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
return hasContinuationAhead;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
export default function sliceAnsi(string, start, end) {
|
|
210
|
-
const tokens = tokenizeAnsi(string, {endCharacter: end});
|
|
211
|
-
const hasContinuationAhead = createHasContinuationAheadMap(tokens);
|
|
212
|
-
let activeStyles = new Map();
|
|
213
|
-
let activeHyperlink;
|
|
214
|
-
let position = 0;
|
|
215
|
-
let returnValue = '';
|
|
216
|
-
let include = false;
|
|
217
|
-
|
|
218
|
-
for (const [tokenIndex, token] of tokens.entries()) {
|
|
219
|
-
let isPastEnd = end !== undefined && position >= end;
|
|
220
|
-
if (
|
|
221
|
-
isPastEnd
|
|
222
|
-
&& token.type !== 'character'
|
|
223
|
-
&& hasContinuationAhead[tokenIndex]
|
|
224
|
-
) {
|
|
225
|
-
isPastEnd = false;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
if (
|
|
229
|
-
isPastEnd
|
|
230
|
-
&& token.type === 'character'
|
|
231
|
-
&& !token.isGraphemeContinuation
|
|
232
|
-
) {
|
|
233
|
-
break;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
({activeStyles, activeHyperlink, position, returnValue, include} = applyToken({
|
|
237
|
-
token,
|
|
238
|
-
isPastEnd,
|
|
239
|
-
start,
|
|
240
|
-
activeStyles,
|
|
241
|
-
activeHyperlink,
|
|
242
|
-
position,
|
|
243
|
-
returnValue,
|
|
244
|
-
include,
|
|
245
|
-
}));
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
if (!include) {
|
|
249
|
-
return '';
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
if (activeHyperlink) {
|
|
253
|
-
returnValue += closeHyperlink(activeHyperlink);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// Disable active codes at the end
|
|
257
|
-
returnValue += undoAnsiCodes(activeStyles);
|
|
258
|
-
|
|
259
|
-
return returnValue;
|
|
260
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "slice-ansi",
|
|
3
|
-
"version": "8.0.0",
|
|
4
|
-
"description": "Slice a string with ANSI escape codes",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "chalk/slice-ansi",
|
|
7
|
-
"funding": "https://github.com/chalk/slice-ansi?sponsor=1",
|
|
8
|
-
"type": "module",
|
|
9
|
-
"exports": {
|
|
10
|
-
"types": "./index.d.ts",
|
|
11
|
-
"default": "./index.js"
|
|
12
|
-
},
|
|
13
|
-
"sideEffects": false,
|
|
14
|
-
"engines": {
|
|
15
|
-
"node": ">=20"
|
|
16
|
-
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"test": "xo && ava && tsc --lib esnext index.d.ts"
|
|
19
|
-
},
|
|
20
|
-
"files": [
|
|
21
|
-
"index.js",
|
|
22
|
-
"tokenize-ansi.js",
|
|
23
|
-
"index.d.ts"
|
|
24
|
-
],
|
|
25
|
-
"keywords": [
|
|
26
|
-
"slice",
|
|
27
|
-
"string",
|
|
28
|
-
"ansi",
|
|
29
|
-
"styles",
|
|
30
|
-
"color",
|
|
31
|
-
"colour",
|
|
32
|
-
"colors",
|
|
33
|
-
"terminal",
|
|
34
|
-
"console",
|
|
35
|
-
"cli",
|
|
36
|
-
"tty",
|
|
37
|
-
"escape",
|
|
38
|
-
"formatting",
|
|
39
|
-
"rgb",
|
|
40
|
-
"256",
|
|
41
|
-
"shell",
|
|
42
|
-
"xterm",
|
|
43
|
-
"log",
|
|
44
|
-
"logging",
|
|
45
|
-
"command-line",
|
|
46
|
-
"text"
|
|
47
|
-
],
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"ansi-styles": "^6.2.3",
|
|
50
|
-
"is-fullwidth-code-point": "^5.1.0"
|
|
51
|
-
},
|
|
52
|
-
"devDependencies": {
|
|
53
|
-
"ava": "^6.4.1",
|
|
54
|
-
"chalk": "^5.6.2",
|
|
55
|
-
"random-item": "^4.0.1",
|
|
56
|
-
"strip-ansi": "^7.1.2",
|
|
57
|
-
"xo": "^1.2.3"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# slice-ansi [](https://github.com/xojs/xo)
|
|
2
|
-
|
|
3
|
-
> Slice a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles)
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
npm install slice-ansi
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
import chalk from 'chalk';
|
|
15
|
-
import sliceAnsi from 'slice-ansi';
|
|
16
|
-
|
|
17
|
-
const string = 'The quick brown ' + chalk.red('fox jumped over ') +
|
|
18
|
-
'the lazy ' + chalk.green('dog and then ran away with the unicorn.');
|
|
19
|
-
|
|
20
|
-
console.log(sliceAnsi(string, 20, 30));
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## API
|
|
24
|
-
|
|
25
|
-
### sliceAnsi(string, startSlice, endSlice?)
|
|
26
|
-
|
|
27
|
-
#### string
|
|
28
|
-
|
|
29
|
-
Type: `string`
|
|
30
|
-
|
|
31
|
-
String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk).
|
|
32
|
-
|
|
33
|
-
#### startSlice
|
|
34
|
-
|
|
35
|
-
Type: `number`
|
|
36
|
-
|
|
37
|
-
Zero-based visible-column index at which to start the slice. Grapheme clusters (for example, emoji sequences and combining marks) are kept intact.
|
|
38
|
-
|
|
39
|
-
#### endSlice
|
|
40
|
-
|
|
41
|
-
Type: `number`
|
|
42
|
-
|
|
43
|
-
Zero-based visible-column index at which to end the slice.
|
|
44
|
-
|
|
45
|
-
## Related
|
|
46
|
-
|
|
47
|
-
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
|
|
48
|
-
- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal
|
|
49
|
-
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
|
|
50
|
-
|
|
51
|
-
## Maintainers
|
|
52
|
-
|
|
53
|
-
- [Sindre Sorhus](https://github.com/sindresorhus)
|
|
54
|
-
- [Josh Junon](https://github.com/qix-)
|