UNPKG

@carbon/ibm-products

Version:

Carbon for IBM Products

46 lines (40 loc) 1.12 kB
/** * Copyright IBM Corp. 2020, 2025 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); // Copyright IBM Corp. 2020, 2021 // // This source code is licensed under the Apache-2.0 license found in the // LICENSE file in the root directory of this source tree. // const isProduction = process.env.NODE_ENV === 'production'; const noop = () => undefined; const shimIfProduction = fn => isProduction ? noop : fn; const log = shimIfProduction(function () { return console.log(...arguments); }); const warn = shimIfProduction(function () { return console.warn(...arguments); }); const error = shimIfProduction(function () { return console.error(...arguments); }); var pconsole = { isProduction, noop, shimIfProduction, log, warn, error }; exports.default = pconsole; exports.error = error; exports.isProduction = isProduction; exports.log = log; exports.noop = noop; exports.shimIfProduction = shimIfProduction; exports.warn = warn;