This commit replaces the use of Logger with getLogger in various parts of the code to handle logging. The Logger has been replaced with getLogger, which assists in getting logs in an asynchronous manner. In addition to this, it updates the next version in pnpm-lock.yaml from next@14.2.0-canary.61 to next@14.2.0-canary.62 and various other dependencies. Also made minor annotations and comments to the function 'isBrowser' and 'formatCurrency' in the 'utils.ts' file.
18 lines
435 B
TypeScript
18 lines
435 B
TypeScript
/**
|
|
* Check if the code is running in a browser environment.
|
|
*/
|
|
export function isBrowser() {
|
|
return typeof window !== 'undefined';
|
|
}
|
|
|
|
/**
|
|
*@name formatCurrency
|
|
* @description Format the currency based on the currency code
|
|
*/
|
|
export function formatCurrency(currencyCode: string, value: string | number) {
|
|
return new Intl.NumberFormat('en-US', {
|
|
style: 'currency',
|
|
currency: currencyCode,
|
|
}).format(Number(value));
|
|
}
|