@react-native/codegen
Advanced tools
@@ -85,2 +85,3 @@ 'use strict'; | ||
| Object.entries(types).forEach(([key, value]) => { | ||
| var _parent$id, _parent$id2, _parent$typeParameter, _parent$typeName, _parent$typeParameter2, _parent$properties; | ||
| const isTypeAlias = value.type === 'TypeAlias' || value.type === 'TSTypeAliasDeclaration'; | ||
@@ -90,7 +91,12 @@ if (!isTypeAlias) { | ||
| } | ||
| const parent = parser.nextNodeForTypeAlias(value); | ||
| let parent = parser.nextNodeForTypeAlias(value); | ||
| if (parent.type === 'GenericTypeAnnotation' && (((_parent$id = parent.id) === null || _parent$id === void 0 ? void 0 : _parent$id.name) === '$ReadOnly' || ((_parent$id2 = parent.id) === null || _parent$id2 === void 0 ? void 0 : _parent$id2.name) === 'Readonly') && ((_parent$typeParameter = parent.typeParameters) === null || _parent$typeParameter === void 0 || (_parent$typeParameter = _parent$typeParameter.params) === null || _parent$typeParameter === void 0 ? void 0 : _parent$typeParameter.length) === 1) { | ||
| parent = parent.typeParameters.params[0]; | ||
| } else if (parent.type === 'TSTypeReference' && ((_parent$typeName = parent.typeName) === null || _parent$typeName === void 0 ? void 0 : _parent$typeName.name) === 'Readonly' && ((_parent$typeParameter2 = parent.typeParameters) === null || _parent$typeParameter2 === void 0 || (_parent$typeParameter2 = _parent$typeParameter2.params) === null || _parent$typeParameter2 === void 0 ? void 0 : _parent$typeParameter2.length) === 1) { | ||
| parent = parent.typeParameters.params[0]; | ||
| } | ||
| if (parent.type !== 'ObjectTypeAnnotation' && parent.type !== 'TSTypeLiteral') { | ||
| return; | ||
| } | ||
| const typeProperties = parser.getAnnotatedElementProperties(value).map(prop => parseObjectProperty(parent, prop, hasteModuleName, types, aliasMap, {}, tryParse, true, (prop === null || prop === void 0 ? void 0 : prop.optional) || false, translateTypeAnnotation, parser)); | ||
| const typeProperties = ((_parent$properties = parent.properties) !== null && _parent$properties !== void 0 ? _parent$properties : parent.members).map(prop => parseObjectProperty(parent, prop, hasteModuleName, types, aliasMap, {}, tryParse, true, (prop === null || prop === void 0 ? void 0 : prop.optional) || false, translateTypeAnnotation, parser)); | ||
| aliasMap[key] = { | ||
@@ -97,0 +103,0 @@ type: 'ObjectTypeAnnotation', |
+1
-1
| { | ||
| "name": "@react-native/codegen", | ||
| "version": "0.86.0-nightly-20260311-63800af94", | ||
| "version": "0.86.0-nightly-20260313-972a30db4", | ||
| "description": "Code generation tools for React Native", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
1045062
0.17%12105
0.07%