Skip to content

Commit

Permalink
Copy to new args
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Jul 12, 2023
1 parent f27946b commit fb67d28
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/core-data/src/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,13 @@ export const getEntityRecord = createSelector(
getEntityRecord.__unstableNormalizeArgs = (
args: EntityRecordArgs
): EntityRecordArgs => {
const recordKey = args?.[ 2 ];
const newArgs = [ ...args ] as EntityRecordArgs;
const recordKey = newArgs?.[ 2 ];

// If recordKey looks to be a numeric ID then coerce to number.
args[ 2 ] = isNumericID( recordKey ) ? Number( recordKey ) : recordKey;
newArgs[ 2 ] = isNumericID( recordKey ) ? Number( recordKey ) : recordKey;

return args;
return newArgs;
};

/**
Expand Down

0 comments on commit fb67d28

Please sign in to comment.