@instadapp/avocado-base 0.0.33 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utils/metadata.ts +14 -0
package/package.json
CHANGED
package/utils/metadata.ts
CHANGED
|
@@ -428,3 +428,17 @@ export const decodeMetadata = (data: string) => {
|
|
|
428
428
|
return null;
|
|
429
429
|
}
|
|
430
430
|
};
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Replaces hyphens with spaces and capitalizes the first letter of each word in a sentence.
|
|
434
|
+
* @param {string} txType - The input sentence to modify
|
|
435
|
+
*
|
|
436
|
+
* @returns {string} - The modified sentence with hyphens replaced with spaces and the first letter of each word capitalized.
|
|
437
|
+
*/
|
|
438
|
+
export const formatTxType = (txType: string) => {
|
|
439
|
+
const finalSentence = txType
|
|
440
|
+
.replace("-", " ")
|
|
441
|
+
.replace(/(^\w{1})|(\s+\w{1})/g, (letter) => letter.toUpperCase());
|
|
442
|
+
|
|
443
|
+
return finalSentence;
|
|
444
|
+
};
|