MCPcopy Create free account
hub / github.com/donghaxkim/react-rewrite / reorderComponent

Function reorderComponent

packages/cli/src/transform.ts:123–133  ·  view source on GitHub ↗
(
  filePath: string,
  fromLine: number,
  toLine: number
)

Source from the content-addressed store, hash-verified

121}
122
123export function reorderComponent(
124 filePath: string,
125 fromLine: number,
126 toLine: number
127): string {
128 const source = fs.readFileSync(filePath, "utf-8");
129 const { j, root, quoteStyle } = parseSource(source, filePath);
130
131 mutateReorder(j, root, fromLine, toLine);
132 return root.toSource({ quote: quoteStyle });
133}
134
135export function getSiblings(
136 filePath: string,

Callers 2

processQueueFunction · 0.85
transform.test.tsFile · 0.85

Calls 2

parseSourceFunction · 0.85
mutateReorderFunction · 0.85

Tested by

no test coverage detected