From 196db970cd99308721e7a1559d341788e5000624 Mon Sep 17 00:00:00 2001 From: Antoine Doubovetzky Date: Fri, 7 Oct 2022 21:26:55 +0200 Subject: [PATCH] :fire: (react-native-codegen) remove unused modules/utils files --- .../src/parsers/flow/modules/utils.js | 45 ------------------- .../src/parsers/typescript/modules/utils.js | 45 ------------------- 2 files changed, 90 deletions(-) delete mode 100644 packages/react-native-codegen/src/parsers/flow/modules/utils.js delete mode 100644 packages/react-native-codegen/src/parsers/typescript/modules/utils.js diff --git a/packages/react-native-codegen/src/parsers/flow/modules/utils.js b/packages/react-native-codegen/src/parsers/flow/modules/utils.js deleted file mode 100644 index b013f76c8ce59e..00000000000000 --- a/packages/react-native-codegen/src/parsers/flow/modules/utils.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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 - * @format - */ - -'use strict'; - -import type { - NativeModuleTypeAnnotation, - Nullable, -} from '../../../CodegenSchema.js'; - -function unwrapNullable<+T: NativeModuleTypeAnnotation>( - x: Nullable, -): [T, boolean] { - if (x.type === 'NullableTypeAnnotation') { - return [x.typeAnnotation, true]; - } - - return [x, false]; -} - -function wrapNullable<+T: NativeModuleTypeAnnotation>( - nullable: boolean, - typeAnnotation: T, -): Nullable { - if (!nullable) { - return typeAnnotation; - } - - return { - type: 'NullableTypeAnnotation', - typeAnnotation, - }; -} - -module.exports = { - unwrapNullable, - wrapNullable, -}; diff --git a/packages/react-native-codegen/src/parsers/typescript/modules/utils.js b/packages/react-native-codegen/src/parsers/typescript/modules/utils.js deleted file mode 100644 index b013f76c8ce59e..00000000000000 --- a/packages/react-native-codegen/src/parsers/typescript/modules/utils.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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 - * @format - */ - -'use strict'; - -import type { - NativeModuleTypeAnnotation, - Nullable, -} from '../../../CodegenSchema.js'; - -function unwrapNullable<+T: NativeModuleTypeAnnotation>( - x: Nullable, -): [T, boolean] { - if (x.type === 'NullableTypeAnnotation') { - return [x.typeAnnotation, true]; - } - - return [x, false]; -} - -function wrapNullable<+T: NativeModuleTypeAnnotation>( - nullable: boolean, - typeAnnotation: T, -): Nullable { - if (!nullable) { - return typeAnnotation; - } - - return { - type: 'NullableTypeAnnotation', - typeAnnotation, - }; -} - -module.exports = { - unwrapNullable, - wrapNullable, -};