UNPKG

silk-gui

Version:

GUI for developers and Node OS

53 lines (43 loc) 976 B
var config = require('../config') /** * Enable debug utilities. The enableDebug() function and * all _.log() & _.warn() calls will be dropped in the * minified production build. */ enableDebug() function enableDebug () { var hasConsole = typeof console !== 'undefined' /** * Log a message. * * @param {String} msg */ exports.log = function (msg) { if (hasConsole && config.debug) { console.log('[Vue info]: ' + msg) } } /** * We've got a problem here. * * @param {String} msg */ exports.warn = function (msg) { if (hasConsole && (!config.silent || config.debug)) { console.warn('[Vue warn]: ' + msg) /* istanbul ignore if */ if (config.debug) { /* jshint debug: true */ debugger } } } /** * Assert asset exists */ exports.assertAsset = function (val, type, id) { if (!val) { exports.warn('Failed to resolve ' + type + ': ' + id) } } }