UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

45 lines (44 loc) 1.33 kB
/** * DevExtreme (cjs/__internal/core/utils/m_console.js) * Version: 24.2.6 * Build date: Mon Mar 17 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.logger = exports.default = exports.debug = void 0; var _type = require("../../../core/utils/type"); const noop = function() {}; const getConsoleMethod = function(method) { if ("undefined" === typeof console || !(0, _type.isFunction)(console[method])) { return noop } return console[method].bind(console) }; const logger = exports.logger = { log: getConsoleMethod("log"), info: getConsoleMethod("info"), warn: getConsoleMethod("warn"), error: getConsoleMethod("error") }; const debug = exports.debug = function() { function assert(condition, message) { if (!condition) { throw new Error(message) } } return { assert: assert, assertParam: function(parameter, message) { assert(null !== parameter && void 0 !== parameter, message) } } }(); var _default = exports.default = { logger: logger, debug: debug };