Skip to content

Commit

Permalink
fix: update isSalesforceId to work for new id-format
Browse files Browse the repository at this point in the history
  • Loading branch information
Codeneos committed May 27, 2024
1 parent e8964c6 commit 990eb5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/util/src/salesforce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ export function isSalesforceId(id : string) : boolean {
* @param id ID to decode into parts
*/
export function decodeSalesforceId(id : string) {
const match = /^([a-z0-9]{3})([a-z0-9]{2})([a-z0-9]{2})([a-z0-9]{8})([a-z0-9]{3})?$/i.exec(id);
if (!match || match[3] !== '00') {
const match = /^([a-z0-9]{3})([a-z0-9]{3})0([a-z0-9]{8})([a-z0-9]{3})?$/i.exec(id);
if (!match) {
return;
}
return {
Expand Down

0 comments on commit 990eb5d

Please sign in to comment.