MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / partition

Function partition

packages/core/src/common/stream.ts:510–517  ·  view source on GitHub ↗
(str: string, delimiter: string)

Source from the content-addressed store, hash-verified

508}
509
510function partition(str: string, delimiter: string): [string, string, string] {
511 const index = str.indexOf(delimiter);
512 if (index !== -1) {
513 return [str.substring(0, index), delimiter, str.substring(index + delimiter.length)];
514 }
515
516 return [str, '', ''];
517}
518
519/**
520 * Most browsers don't yet have async iterable support for ReadableStream,

Callers 1

decodeMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected