MCPcopy Create free account
hub / github.com/d1ll0n/stack-packer / modifyString

Function modifyString

src/lib/text.ts:58–67  ·  view source on GitHub ↗
(original: string, modification: StringModification)

Source from the content-addressed store, hash-verified

56};
57
58const modifyString = (original: string, modification: StringModification) => {
59 if (modification.type === 'callback') {
60 return modification.cb(original)
61 }
62 const { type, text } = modification;
63 if (type === "set") return text;
64 if (type === "prefix") return text.concat(original);
65 // suffix
66 return original.concat(text);
67};
68
69const modifyItem = (
70 arrOrStr: ArrayJoinInput<string>,

Callers 1

modifyItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected