mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
5744b219c7
Summary: This PR is a task of https://github.com/facebook/react-native/issues/34872 > Extract the content of the tryParse (Flow, TypeScript)lambda into a proper `parseObjectProperty` function into the parsers-commons.js file. also, - added new helper fn `isObjectProperty` in `parsers-commons.js` file. - added tests for `isObjectProperty` and `parseObjectProperty` fn 's ## Changelog [Internal] [Changed] - Extracted the content of the `tryParse` ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/modules/index.js#L292-L337), [TypeScript](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L306-L351)) lambda into a proper `parseObjectProperty` fn into the `parsers-commons.js` file. Pull Request resolved: https://github.com/facebook/react-native/pull/35076 Test Plan: - run ```bash yarn lint && yarn flow && yarn test-ci ``` - and ensure everything is � <img width="720" alt="image" src="https://user-images.githubusercontent.com/55224033/200105151-360b9b5e-52c7-4586-89b0-6860e9725f6e.png"> Reviewed By: cortinico Differential Revision: D40797241 Pulled By: cipolleschi fbshipit-source-id: 48b8900ead70d5eda2496f9ce044c11a9599a177
react-native-codegen
Installation
yarn add --dev react-native-codegen
Note: We're using yarn to install deps. Feel free to change commands to use npm 3+ and npx if you like
Testing
To run the tests in this package, run the following commands from the react Native root folder:
yarnto install the dependencies. You just need to run this onceyarn jest react-native-codegen.