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 Oct 13, 2023
1 parent b0b5b45 commit 5d2c7b3
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 @@ -383,12 +383,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 5d2c7b3

Please sign in to comment.