File tree Expand file tree Collapse file tree 3 files changed +21
-8
lines changed
packages/react-native-codegen/src/parsers Expand file tree Collapse file tree 3 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import type {
2424
2525import type { ParserErrorCapturer , TypeDeclarationMap } from '../../utils' ;
2626import type { NativeModuleTypeAnnotation } from '../../../CodegenSchema.js' ;
27+ const { nullGuard} = require ( '../../parsers-utils' ) ;
2728
2829const { throwIfMoreThanOneModuleRegistryCalls} = require ( '../../error-utils' ) ;
2930const {
@@ -76,10 +77,6 @@ const {
7677
7778const language = 'Flow' ;
7879
79- function nullGuard < T > (fn: () => T) : ?T {
80- return fn ( ) ;
81- }
82-
8380function translateArrayTypeAnnotation (
8481 hasteModuleName : string ,
8582 types : TypeDeclarationMap ,
Original file line number Diff line number Diff line change 1+ /**
2+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3+ *
4+ * This source code is licensed under the MIT license found in the
5+ * LICENSE file in the root directory of this source tree.
6+ *
7+ * @format
8+ * @flow strict
9+ */
10+
11+ 'use strict' ;
12+
13+ function nullGuard < T > (fn: () => T) : ?T {
14+ return fn ( ) ;
15+ }
16+
17+ module . exports = {
18+ nullGuard,
19+ } ;
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import type {
2424
2525import type { ParserErrorCapturer , TypeDeclarationMap } from '../../utils' ;
2626import type { NativeModuleTypeAnnotation } from '../../../CodegenSchema.js' ;
27+ const { nullGuard} = require ( '../../parsers-utils' ) ;
2728
2829const { throwIfMoreThanOneModuleRegistryCalls} = require ( '../../error-utils' ) ;
2930const {
@@ -76,10 +77,6 @@ const {
7677
7778const language = 'TypeScript' ;
7879
79- function nullGuard < T > (fn: () => T) : ?T {
80- return fn ( ) ;
81- }
82-
8380function translateArrayTypeAnnotation (
8481 hasteModuleName : string ,
8582 types : TypeDeclarationMap ,
You can’t perform that action at this time.
0 commit comments