UNPKG

auth0-sso-login

Version:

A Library to simplify the auth0 sso login process

42 lines (32 loc) 1.45 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var Logger = /*#__PURE__*/function () { /** * @constructor create a logger with configuration * @param {Object} config configuration to wrap */ function Logger(config) { _classCallCheck(this, Logger); this.config = config; } /** * @description logs the message to the console, or to a provided hook * @param message to log * @return {*|void} */ _createClass(Logger, [{ key: "log", value: function log(message) { var logFunc = this.config && this.config.hooks && this.config.hooks.log || console.log; return logFunc(message); } }]); return Logger; }(); exports["default"] = Logger;