Skip to content

Commit

Permalink
Add as const cast to prepare for natural inference in relay
Browse files Browse the repository at this point in the history
Reviewed By: panagosg7

Differential Revision: D64923729

fbshipit-source-id: 3b3dd8fe267bb8031ed505b3750df40f49e32e1f
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Oct 25, 2024
1 parent 3fa4fab commit 49d6893
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.*/node_modules/resolve/test/resolver/malformed_package_json/package.json

[options]
as_const=true
module.system=haste
module.system.haste.use_name_reducers=true
# get basename
Expand Down
2 changes: 1 addition & 1 deletion packages/relay-runtime/store/RelayRecordState.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const RelayRecordState = {
* server.
*/
UNKNOWN: 'UNKNOWN',
};
} as const;

export type RecordState = $Keys<typeof RelayRecordState>;

Expand Down
2 changes: 1 addition & 1 deletion packages/relay-runtime/store/RelayStoreUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,6 @@ const RelayStoreUtils = {
getStableStorageKey,
getModuleComponentKey,
getModuleOperationKey,
};
} as const;

module.exports = RelayStoreUtils;
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const OPPOSITES = {
Aquarius: 'Leo',
Virgo: 'Pisces',
Pisces: 'Virgo',
};
} as const;

const HOUSE_ORDER = [
'Aries',
Expand All @@ -64,7 +64,7 @@ const HOUSE_ORDER = [
'Capricorn',
'Aquarius',
'Pisces',
];
] as const;

function findSign(month: number, day: number): AstrologicalSignID {
const days = [21, 20, 21, 21, 22, 22, 23, 24, 24, 24, 23, 22];
Expand Down
2 changes: 1 addition & 1 deletion packages/relay-runtime/util/RelayConcreteNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@ const RelayConcreteNode = {
TYPE_DISCRIMINATOR: 'TypeDiscriminator',
UPDATABLE_QUERY: 'UpdatableQuery',
VARIABLE: 'Variable',
};
} as const;

module.exports = RelayConcreteNode;

0 comments on commit 49d6893

Please sign in to comment.