Indent C++ method declarations

Summary:
This moves the `indent` function into a `Utils` module so it can be also used to properly indent the abstract methods declarations in a C++ TurboModule spec.

Changelog:
Internal

Reviewed By: nlutsenko

Differential Revision: D34704456

fbshipit-source-id: 88a3a672e4860927b5dd1f5107f40da7b5a83e51
This commit is contained in:
Scott Kyle
2022-03-07 19:21:51 -08:00
committed by Facebook GitHub Bot
parent 3b61f2108d
commit 269fa37bb8
4 changed files with 58 additions and 47 deletions
@@ -19,6 +19,7 @@ import type {
import type {AliasResolver} from './Utils';
const {createAliasResolver, getModules} = require('./Utils');
const {indent} = require('../Utils');
const {unwrapNullable} = require('../../parsers/flow/modules/utils');
type FilesOutput = Map<string, string>;
@@ -32,7 +33,7 @@ protected:
${hasteModuleName}CxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
public:
${moduleProperties}
${indent(moduleProperties, 2)}
};`;
};
@@ -57,6 +58,7 @@ const FileTemplate = ({
namespace facebook {
namespace react {
${modules}
} // namespace react