MCPcopy Create free account
hub / github.com/Kudo/react-native-v8 / removeGeneratedContents

Function removeGeneratedContents

plugin/src/generateCode.ts:117–126  ·  view source on GitHub ↗
(src: string, tag: string)

Source from the content-addressed store, hash-verified

115 * @param src
116 */
117export function removeGeneratedContents(src: string, tag: string): string | null {
118 const { contents, start, end } = getGeneratedSectionIndexes(src, tag);
119 if (start > -1 && end > -1 && start < end) {
120 contents.splice(start, end - start + 1);
121 // TODO: We could in theory check that the contents we're removing match the hash used in the header,
122 // this would ensure that we don't accidentally remove lines that someone added or removed from the generated section.
123 return contents.join('\n');
124 }
125 return null;
126}
127
128export function createGeneratedHeaderComment(
129 contents: string,

Callers 2

mergeContentsFunction · 0.85
removeContentsFunction · 0.85

Calls 1

Tested by

no test coverage detected