2022-02-04 10:05:16 +08:00
|
|
|
const DEBUG = true;
|
|
|
|
|
2022-02-03 12:05:24 +08:00
|
|
|
function toString(obj) {
|
2022-02-04 10:05:16 +08:00
|
|
|
if (!obj) {
|
|
|
|
return obj
|
|
|
|
}
|
2022-02-03 12:05:24 +08:00
|
|
|
if (typeof obj === 'string') {
|
|
|
|
return obj
|
|
|
|
}
|
2022-02-04 10:05:16 +08:00
|
|
|
return obj + '';
|
|
|
|
}
|
|
|
|
|
|
|
|
function debug(...data) {
|
|
|
|
if (DEBUG) {
|
|
|
|
console.debug(...data)
|
|
|
|
}
|
2022-02-03 12:05:24 +08:00
|
|
|
}
|
|
|
|
|
2022-02-04 10:05:16 +08:00
|
|
|
export {toString, debug};
|