guardia-messenger/node_modules/@react-native/codegen/lib/cli/combine/combine-utils.js.flow
DESKTOP-TKLFCPRython f29f525c77 refactor: 101.79.17.164 → zioinfo.co.kr 전체 도메인 변환 + Manager UI 배포
- 37개 파일 IP → zioinfo.co.kr 치환 (소스/매뉴얼/설정/하네스)
- Manager DrConsole/NetworkConsole/CsapConsole 빌드 + /var/www/manager/ 배포
- 테스트: Manager HTTP 200, ITSM 신규 API 7개 전체 200

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 10:09:17 +09:00

65 lines
1.9 KiB
Plaintext

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
'use strict';
const path = require('path');
/**
* This function is used by the CLI to decide whether a JS/TS file has to be processed or not by the Codegen.
* Parameters:
* - file: the path to the file
* - currentPlatform: the current platform for which we are creating the specs
* Returns: `true` if the file can be used to generate some code; `false` otherwise
*
*/
function filterJSFile(
file: string,
currentPlatform: ?string,
excludeRegExp: ?RegExp,
): boolean {
const isSpecFile = /^(Native.+|.+NativeComponent)/.test(path.basename(file));
const isNotNativeUIManager = !file.endsWith('NativeUIManager.js');
const isNotTest = !file.includes('__tests');
const isNotExcluded = excludeRegExp == null || !excludeRegExp.test(file);
const isNotTSTypeDefinition = !file.endsWith('.d.ts');
const isValidCandidate =
isSpecFile &&
isNotNativeUIManager &&
isNotExcluded &&
isNotTest &&
isNotTSTypeDefinition;
const filenameComponents = path.basename(file).split('.');
const isPlatformAgnostic = filenameComponents.length === 2;
if (currentPlatform == null) {
// need to accept only files that are platform agnostic
return isValidCandidate && isPlatformAgnostic;
}
// If a platform is passed, accept both platform agnostic specs...
if (isPlatformAgnostic) {
return isValidCandidate;
}
// ...and specs that share the same platform as the one passed.
// specfiles must follow the pattern: <filename>[.<platform>].(js|ts|tsx)
const filePlatform =
filenameComponents.length > 2 ? filenameComponents[1] : 'unknown';
return isValidCandidate && currentPlatform === filePlatform;
}
module.exports = {
filterJSFile,
};