affiliate
Version:
A platform agnostic tool to quickly add affiliate links onto your website
18 lines (16 loc) • 382 B
text/typescript
/**
* log handles formatting and doesn't throw errors is console is undefined
*/
export default function log(
isError: boolean,
...args: (string | number | object)[]
) {
const textId = '[Affiliate] ';
if (typeof console === 'object') {
if (isError) {
console.error(textId, ...args);
} else {
console.log(textId, ...args);
}
}
}