Skip to content

Commit

Permalink
refactor: Renamed emitPartial to emitObject (#35982)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vzaidman authored and facebook-github-bot committed Jan 30, 2023
1 parent 84c1547 commit 112c89e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const {
emitNumber,
emitInt32,
emitGenericObject,
emitPartial,
emitObject,
emitPromise,
emitRootTag,
emitVoid,
Expand Down Expand Up @@ -457,7 +457,7 @@ describe('emitGenericObject', () => {
});
});

describe('emitPartial', () => {
describe('emitObject', () => {
describe('when nullable is true', () => {
it('returns nullable type annotation', () => {
const props = [
Expand All @@ -477,7 +477,7 @@ describe('emitPartial', () => {
},
];

const result = emitPartial(true, props);
const result = emitObject(true, props);

const expected = {
type: 'NullableTypeAnnotation',
Expand Down Expand Up @@ -509,7 +509,7 @@ describe('emitPartial', () => {
},
];

const result = emitPartial(false, props);
const result = emitObject(false, props);

const expected = {
type: 'ObjectTypeAnnotation',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const {
emitNumber,
emitInt32,
emitGenericObject,
emitPartial,
emitObject,
emitPromise,
emitRootTag,
emitVoid,
Expand Down Expand Up @@ -188,7 +188,7 @@ function translateTypeAnnotation(
};
});

return emitPartial(nullable, properties);
return emitObject(nullable, properties);
}
default: {
return translateDefault(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function emitGenericObject(
});
}

function emitPartial(
function emitObject(
nullable: boolean,
properties: Array<$FlowFixMe>,
): Nullable<NativeModuleObjectTypeAnnotation> {
Expand Down Expand Up @@ -381,7 +381,7 @@ module.exports = {
emitInt32,
emitNumber,
emitGenericObject,
emitPartial,
emitObject,
emitPromise,
emitRootTag,
emitVoid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const {
emitNumber,
emitInt32,
emitGenericObject,
emitPartial,
emitObject,
emitPromise,
emitRootTag,
emitVoid,
Expand Down Expand Up @@ -207,7 +207,7 @@ function translateTypeAnnotation(
},
);

return emitPartial(nullable, properties);
return emitObject(nullable, properties);
}
default: {
return translateDefault(
Expand Down

0 comments on commit 112c89e

Please sign in to comment.