MCPcopy Create free account
hub / github.com/glideapps/quicktype / intercalate

Function intercalate

src/Support.ts:5–12  ·  view source on GitHub ↗
(separator: T, items: Collection<any, T>)

Source from the content-addressed store, hash-verified

3import { Collection, List } from "immutable";
4
5export function intercalate<T>(separator: T, items: Collection<any, T>): List<T> {
6 const acc: T[] = [];
7 items.forEach((x: T) => {
8 if (acc.length > 0) acc.push(separator);
9 acc.push(x);
10 });
11 return List(acc);
12}
13
14export type StringMap = { [name: string]: any };
15

Callers 5

sourcelikeToSourceFunction · 0.90
SimpleTypesRendererClass · 0.90
emitSourceStructureMethod · 0.90
TypeScriptRendererClass · 0.90
CSharpRendererClass · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…