MCPcopy Create free account
hub / github.com/Effect-TS/effect / concatTokens

Function concatTokens

packages/effect/src/unstable/process/ChildProcess.ts:1054–1063  ·  view source on GitHub ↗
(
  prevTokens: ReadonlyArray<string>,
  nextTokens: ReadonlyArray<string>,
  isSeparated: boolean
)

Source from the content-addressed store, hash-verified

1052 * and the first element of `nextTokens` will be joined into a single token.
1053 */
1054const concatTokens = (
1055 prevTokens: ReadonlyArray<string>,
1056 nextTokens: ReadonlyArray<string>,
1057 isSeparated: boolean
1058): ReadonlyArray<string> =>
1059 isSeparated || prevTokens.length === 0 || nextTokens.length === 0
1060 // Keep the previous and next tokens separate from one another
1061 ? [...prevTokens, ...nextTokens]
1062 // Join the last token from the previous set and the first token from the next set
1063 : [...prevTokens.slice(0, -1), `${prevTokens.at(-1)}${nextTokens.at(0)}`, ...nextTokens.slice(1)]

Callers 1

parseTemplateFunction · 0.85

Calls 1

atMethod · 0.65

Tested by

no test coverage detected