-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: replace id templates and add w3 did context
- Loading branch information
1 parent
341ba91
commit d64c692
Showing
4 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
RPC_ENDPOINT=https://devnet.ixo.earth/rpc/ | ||
RPC_ENDPOINT=https://devnet.ixo.earth/rpc/ #https://rpc-ixo-ia.cosmosia.notional.ventures/ | ||
PORT=8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Recursively updates string values in a JavaScript object, replacing only part of the string | ||
* if it contains the `oldValue`. | ||
* @param obj The object to update. | ||
* @param oldValue The string value to search for and replace. | ||
* @param newValue The new string value to use in the update. | ||
*/ | ||
export const updateObjectStrings = ( | ||
obj: any, | ||
oldValue: string, | ||
newValue: string, | ||
) => { | ||
for (let key in obj) { | ||
if (typeof obj[key] === 'object') { | ||
// if the value is an object or array, recursively call the function | ||
updateObjectStrings(obj[key], oldValue, newValue); | ||
} else if (typeof obj[key] === 'string' && obj[key].includes(oldValue)) { | ||
// if the value is a string and contains the old value, update it | ||
obj[key] = obj[key].replace(oldValue, newValue); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters