Skip to content

Commit 112c89e

Browse files
vzaidmanfacebook-github-bot
authored andcommitted
refactor: Renamed emitPartial to emitObject (#35982)
Summary: Pull Request resolved: #35982 This reflects better what the former `emitPartial` was doing - emitting an object with set props. Changelog: [Internal] - Renamed emitPartial to emitObject Reviewed By: christophpurrer Differential Revision: D42740958 fbshipit-source-id: 4f974c6911bc129e698323a8039bbd7aa7602461
1 parent 84c1547 commit 112c89e

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const {
2121
emitNumber,
2222
emitInt32,
2323
emitGenericObject,
24-
emitPartial,
24+
emitObject,
2525
emitPromise,
2626
emitRootTag,
2727
emitVoid,
@@ -457,7 +457,7 @@ describe('emitGenericObject', () => {
457457
});
458458
});
459459

460-
describe('emitPartial', () => {
460+
describe('emitObject', () => {
461461
describe('when nullable is true', () => {
462462
it('returns nullable type annotation', () => {
463463
const props = [
@@ -477,7 +477,7 @@ describe('emitPartial', () => {
477477
},
478478
];
479479

480-
const result = emitPartial(true, props);
480+
const result = emitObject(true, props);
481481

482482
const expected = {
483483
type: 'NullableTypeAnnotation',
@@ -509,7 +509,7 @@ describe('emitPartial', () => {
509509
},
510510
];
511511

512-
const result = emitPartial(false, props);
512+
const result = emitObject(false, props);
513513

514514
const expected = {
515515
type: 'ObjectTypeAnnotation',

packages/react-native-codegen/src/parsers/flow/modules/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const {
4242
emitNumber,
4343
emitInt32,
4444
emitGenericObject,
45-
emitPartial,
45+
emitObject,
4646
emitPromise,
4747
emitRootTag,
4848
emitVoid,
@@ -188,7 +188,7 @@ function translateTypeAnnotation(
188188
};
189189
});
190190

191-
return emitPartial(nullable, properties);
191+
return emitObject(nullable, properties);
192192
}
193193
default: {
194194
return translateDefault(

packages/react-native-codegen/src/parsers/parsers-primitives.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ function emitGenericObject(
244244
});
245245
}
246246

247-
function emitPartial(
247+
function emitObject(
248248
nullable: boolean,
249249
properties: Array<$FlowFixMe>,
250250
): Nullable<NativeModuleObjectTypeAnnotation> {
@@ -381,7 +381,7 @@ module.exports = {
381381
emitInt32,
382382
emitNumber,
383383
emitGenericObject,
384-
emitPartial,
384+
emitObject,
385385
emitPromise,
386386
emitRootTag,
387387
emitVoid,

packages/react-native-codegen/src/parsers/typescript/modules/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const {
4242
emitNumber,
4343
emitInt32,
4444
emitGenericObject,
45-
emitPartial,
45+
emitObject,
4646
emitPromise,
4747
emitRootTag,
4848
emitVoid,
@@ -207,7 +207,7 @@ function translateTypeAnnotation(
207207
},
208208
);
209209

210-
return emitPartial(nullable, properties);
210+
return emitObject(nullable, properties);
211211
}
212212
default: {
213213
return translateDefault(

0 commit comments

Comments
 (0)