UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

102 lines (97 loc) 2.52 kB
import { isDevMode } from '@angular/core'; import { environment } from 'ng-zorro-antd/core/environments'; /** * @fileoverview added by tsickle * Generated from: logger.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @type {?} */ const record = {}; /** @type {?} */ const PREFIX = '[NG-ZORRO]:'; /** * @param {...?} args * @return {?} */ function notRecorded(...args) { /** @type {?} */ const asRecord = args.reduce((/** * @param {?} acc * @param {?} c * @return {?} */ (acc, c) => acc + c.toString()), ''); if (record[asRecord]) { return false; } else { record[asRecord] = true; return true; } } /** * @param {?} consoleFunc * @param {...?} args * @return {?} */ function consoleCommonBehavior(consoleFunc, ...args) { if (environment.isTestMode || (isDevMode() && notRecorded(...args))) { consoleFunc(...args); } } // Warning should only be printed in dev mode and only once. /** @type {?} */ const warn = (/** * @param {...?} args * @return {?} */ (...args) => consoleCommonBehavior((/** * @param {...?} arg * @return {?} */ (...arg) => console.warn(PREFIX, ...arg)), ...args)); /** @type {?} */ const warnDeprecation = (/** * @param {...?} args * @return {?} */ (...args) => { if (!environment.isTestMode) { /** @type {?} */ const stack = new Error().stack; return consoleCommonBehavior((/** * @param {...?} arg * @return {?} */ (...arg) => console.warn(PREFIX, 'deprecated:', ...arg, stack)), ...args); } else { return (/** * @return {?} */ () => { }); } }); // Log should only be printed in dev mode. /** @type {?} */ const log = (/** * @param {...?} args * @return {?} */ (...args) => { if (isDevMode()) { console.log(PREFIX, ...args); } }); /** * @fileoverview added by tsickle * Generated from: public-api.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * Generated from: ng-zorro-antd-core-logger.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ export { PREFIX, log, warn, warnDeprecation }; //# sourceMappingURL=ng-zorro-antd-core-logger.js.map