New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@react-native/codegen

Package Overview
Dependencies
Maintainers
11
Versions
561
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native/codegen - npm Package Compare versions

Comparing version 0.74.0-nightly-20231212-1c77919fc to 0.74.0-nightly-20231213-746ad378c

22

lib/generators/components/__test_fixtures__/fixtures.js

@@ -1700,2 +1700,24 @@ /**

},
{
name: 'addItems',
optional: false,
typeAnnotation: {
type: 'FunctionTypeAnnotation',
params: [
{
name: 'items',
optional: false,
typeAnnotation: {
type: 'ArrayTypeAnnotation',
elementType: {
type: 'StringTypeAnnotation',
},
},
},
],
returnTypeAnnotation: {
type: 'VoidTypeAnnotation',
},
},
},
],

@@ -1702,0 +1724,0 @@ },

@@ -128,2 +128,4 @@ /**

return 'NSString *';
case 'ArrayTypeAnnotation':
return 'const NSArray *';
default:

@@ -155,2 +157,4 @@ typeAnnotation.type;

return '[NSString class]';
case 'ArrayTypeAnnotation':
return '[NSArray class]';
default:

@@ -182,2 +186,4 @@ typeAnnotation.type;

return 'string';
case 'ArrayTypeAnnotation':
return 'array';
default:

@@ -209,2 +215,4 @@ typeAnnotation.type;

return `(NSString *)arg${index}`;
case 'ArrayTypeAnnotation':
return `(NSArray *)arg${index}`;
default:

@@ -211,0 +219,0 @@ typeAnnotation.type;

2

lib/generators/components/GeneratePropsJavaDelegate.js

@@ -170,2 +170,4 @@ /**

return `args.getString(${index})`;
case 'ArrayTypeAnnotation':
return `args.getArray(${index})`;
default:

@@ -172,0 +174,0 @@ typeAnnotation.type;

@@ -148,2 +148,4 @@ /**

return 'String';
case 'ArrayTypeAnnotation':
return 'ReadableArray';
default:

@@ -150,0 +152,0 @@ typeAnnotation.type;

@@ -96,2 +96,10 @@ /**

});
component.commands.forEach(command => {
command.typeAnnotation.params.forEach(param => {
const cmdParamType = param.typeAnnotation.type;
if (cmdParamType === 'ArrayTypeAnnotation') {
imports.add('import com.facebook.react.bridge.ReadableArray;');
}
});
});
return imports;

@@ -98,0 +106,0 @@ }

@@ -75,2 +75,26 @@ /**

break;
case 'Array':
case '$ReadOnlyArray':
if (!paramValue.type === 'GenericTypeAnnotation') {
throw new Error(
'Array and $ReadOnlyArray are GenericTypeAnnotation for array',
);
}
returnType = {
type: 'ArrayTypeAnnotation',
elementType: {
// TODO: T172453752 support complex type annotation for array element
type: paramValue.typeParameters.params[0].type,
},
};
break;
case 'ArrayTypeAnnotation':
returnType = {
type: 'ArrayTypeAnnotation',
elementType: {
// TODO: T172453752 support complex type annotation for array element
type: paramValue.elementType.type,
},
};
break;
default:

@@ -77,0 +101,0 @@ type;

2

package.json
{
"name": "@react-native/codegen",
"version": "0.74.0-nightly-20231212-1c77919fc",
"version": "0.74.0-nightly-20231213-746ad378c",
"description": "Code generation tools for React Native",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc