INNER CODE UNIT · TypeScript
buildCoreProviderBlock
margelo/react-native-runtimes · packages/core/plugin/src/index.ts:162
function buildCoreProviderBlock(lineIndent: string, packageFQNs: string[]): string {
const innerIndent = lineIndent + ' ';
const deepIndent = lineIndent + ' ';
const packageLines = packageFQNs.map((fqn) => `${deepIndent}${getSimpleClassName(fqn)}(),`);
return [
`ThreadedRuntime.setExtraReactPackagesProvider {`,
`${innerIndent}listOf(`,
...packageLines,
`${innerIndent})`,
`${lineIndent}}`,
].join('\n');
}
/**
* Inserts `missingFQNs` into the `listOf(` of an existing
* `setExtraReactPackagesProvider` block. Packages are prepended so the block
* remains syntactically valid regardless of what is already inside. Already-
* registered packages (detected by simple class name) are skipped.