hexo-theme-amane/include/util/console.js

16 lines
311 B
JavaScript
Raw Normal View History

2020-01-04 02:28:38 +00:00
let chalk;
try {
chalk = require('chalk');
} catch (e) { }
module.exports = new Proxy({}, {
get(obj, prop) {
if (chalk) {
return chalk[prop];
}
return function () {
return arguments.length === 1 ? arguments[0] : arguments;
}.bind(obj);
}
});