Ignore:
Timestamp:
11/25/21 22:08:24 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
8d391a1
Parents:
59329aa
Message:

primeNG components

Location:
trip-planner-front/node_modules/loglevel
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/node_modules/loglevel/README.md

    r59329aa re29cc2e  
    164164  The `level` argument takes is the same values that you might pass to `setLevel()`. Levels set using `setDefaultLevel()` never persist to subsequent page loads.
    165165
     166* A `log.resetLevel()` method.
     167
     168  This resets the current log level to the default level (or `warn` if no explicit default was set) and clears the persisted level if one was previously persisted.
     169
    166170* `log.enableAll()` and `log.disableAll()` methods.
    167171
     
    251255Including that would increase the size and complexity of the library, but more importantly would remove stacktrace information. Currently log methods are either disabled, or enabled with directly bound versions of the console.log methods (where possible). This means your browser shows the log message as coming from your code at the call to `log.info("message!")` not from within loglevel, since it really calls the bound console method directly, without indirection. The indirection required to dynamically format, further filter, or redirect log messages would stop this.
    252256
    253 There's clearly enough enthusiasm for this even at that cost though that loglevel now includes a plugin API. To use it, redefine log.methodFactory(methodName, logLevel, loggerName) with a function of your own. This will be called for each enabled method each time the level is set (including initially), and should return a function to be used for the given log method, at the given level, for a logger with the given name. If you'd like to retain all the reliability and features of loglevel, it's recommended that this wraps the initially provided value of `log.methodFactory`
     257There's clearly enough enthusiasm for this even at that cost though that loglevel now includes a plugin API. To use it, redefine `log.methodFactory(methodName, logLevel, loggerName)` with a function of your own. This will be called for each enabled method each time the level is set (including initially), and should return a function to be used for the given log method `methodName`, at the given *configured* (not actual) level `logLevel`, for a logger with the given name `loggerName`. If you'd like to retain all the reliability and features of loglevel, it's recommended that this wraps the initially provided value of `log.methodFactory`.
    254258
    255259For example, a plugin to prefix all log messages with "Newsflash: " would look like:
     
    267271```
    268272
    269 *(The above supports only a single log.warn("") argument for clarity, but it's easy to extend to a [fuller variadic version](http://jsbin.com/xehoye/edit?html,console))*
     273*(The above supports only a single string `log.warn("...")` argument for clarity, but it's easy to extend to a [fuller variadic version](http://jsbin.com/xehoye/edit?html,console).)*
    270274
    271275If you develop and release a plugin, please get in contact! I'd be happy to reference it here for future users. Some consistency is helpful; naming your plugin 'loglevel-PLUGINNAME' (e.g. loglevel-newsflash) is preferred, as is giving it the 'loglevel-plugin' keyword in your package.json
     
    344348v1.7.1 - Update TypeScript types to support Symbol-named loggers.
    345349
     350v1.8.0 - Add resetLevel() method to clear persisted levels & reset to defaults
     351
    346352## `loglevel` for enterprise
    347353
  • trip-planner-front/node_modules/loglevel/bower.json

    r59329aa re29cc2e  
    11{
    22  "name": "loglevel",
    3   "version": "1.7.1",
     3  "version": "1.8.0",
    44  "main": "dist/loglevel.min.js",
    55  "dependencies": {},
  • trip-planner-front/node_modules/loglevel/dist/loglevel.js

    r59329aa re29cc2e  
    1 /*! loglevel - v1.7.1 - https://github.com/pimterry/loglevel - (c) 2020 Tim Perry - licensed MIT */
     1/*! loglevel - v1.8.0 - https://github.com/pimterry/loglevel - (c) 2021 Tim Perry - licensed MIT */
    22(function (root, definition) {
    33    "use strict";
     
    114114      var self = this;
    115115      var currentLevel;
     116      defaultLevel = defaultLevel == null ? "WARN" : defaultLevel;
    116117
    117118      var storageKey = "loglevel";
     
    167168
    168169          return storedLevel;
     170      }
     171
     172      function clearPersistedLevel() {
     173          if (typeof window === undefinedType || !storageKey) return;
     174
     175          // Use localStorage if available
     176          try {
     177              window.localStorage.removeItem(storageKey);
     178              return;
     179          } catch (ignore) {}
     180
     181          // Use session cookie as fallback
     182          try {
     183              window.document.cookie =
     184                encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
     185          } catch (ignore) {}
    169186      }
    170187
     
    205222
    206223      self.setDefaultLevel = function (level) {
     224          defaultLevel = level;
    207225          if (!getPersistedLevel()) {
    208226              self.setLevel(level, false);
    209227          }
     228      };
     229
     230      self.resetLevel = function () {
     231          self.setLevel(defaultLevel, false);
     232          clearPersistedLevel();
    210233      };
    211234
     
    221244      var initialLevel = getPersistedLevel();
    222245      if (initialLevel == null) {
    223           initialLevel = defaultLevel == null ? "WARN" : defaultLevel;
     246          initialLevel = defaultLevel;
    224247      }
    225248      self.setLevel(initialLevel, false);
  • trip-planner-front/node_modules/loglevel/dist/loglevel.min.js

    r59329aa re29cc2e  
    1 /*! loglevel - v1.7.1 - https://github.com/pimterry/loglevel - (c) 2020 Tim Perry - licensed MIT */
    2 !function(a,b){"use strict";"function"==typeof define&&define.amd?define(b):"object"==typeof module&&module.exports?module.exports=b():a.log=b()}(this,function(){"use strict";function a(a,b){var c=a[b];if("function"==typeof c.bind)return c.bind(a);try{return Function.prototype.bind.call(c,a)}catch(b){return function(){return Function.prototype.apply.apply(c,[a,arguments])}}}function b(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(c){return"debug"===c&&(c="log"),typeof console!==i&&("trace"===c&&j?b:void 0!==console[c]?a(console,c):void 0!==console.log?a(console,"log"):h)}function d(a,b){for(var c=0;c<k.length;c++){var d=k[c];this[d]=c<a?h:this.methodFactory(d,a,b)}this.log=this.debug}function e(a,b,c){return function(){typeof console!==i&&(d.call(this,b,c),this[a].apply(this,arguments))}}function f(a,b,d){return c(a)||e.apply(this,arguments)}function g(a,b,c){function e(a){var b=(k[a]||"silent").toUpperCase();if(typeof window!==i&&l){try{return void(window.localStorage[l]=b)}catch(a){}try{window.document.cookie=encodeURIComponent(l)+"="+b+";"}catch(a){}}}function g(){var a;if(typeof window!==i&&l){try{a=window.localStorage[l]}catch(a){}if(typeof a===i)try{var b=window.document.cookie,c=b.indexOf(encodeURIComponent(l)+"=");-1!==c&&(a=/^([^;]+)/.exec(b.slice(c))[1])}catch(a){}return void 0===j.levels[a]&&(a=void 0),a}}var h,j=this,l="loglevel";"string"==typeof a?l+=":"+a:"symbol"==typeof a&&(l=void 0),j.name=a,j.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},j.methodFactory=c||f,j.getLevel=function(){return h},j.setLevel=function(b,c){if("string"==typeof b&&void 0!==j.levels[b.toUpperCase()]&&(b=j.levels[b.toUpperCase()]),!("number"==typeof b&&b>=0&&b<=j.levels.SILENT))throw"log.setLevel() called with invalid level: "+b;if(h=b,!1!==c&&e(b),d.call(j,b,a),typeof console===i&&b<j.levels.SILENT)return"No console available for logging"},j.setDefaultLevel=function(a){g()||j.setLevel(a,!1)},j.enableAll=function(a){j.setLevel(j.levels.TRACE,a)},j.disableAll=function(a){j.setLevel(j.levels.SILENT,a)};var m=g();null==m&&(m=null==b?"WARN":b),j.setLevel(m,!1)}var h=function(){},i="undefined",j=typeof window!==i&&typeof window.navigator!==i&&/Trident\/|MSIE /.test(window.navigator.userAgent),k=["trace","debug","info","warn","error"],l=new g,m={};l.getLogger=function(a){if("symbol"!=typeof a&&"string"!=typeof a||""===a)throw new TypeError("You must supply a name when creating a logger.");var b=m[a];return b||(b=m[a]=new g(a,l.getLevel(),l.methodFactory)),b};var n=typeof window!==i?window.log:void 0;return l.noConflict=function(){return typeof window!==i&&window.log===l&&(window.log=n),l},l.getLoggers=function(){return m},l.default=l,l});
     1/*! loglevel - v1.8.0 - https://github.com/pimterry/loglevel - (c) 2021 Tim Perry - licensed MIT */
     2!function(a,b){"use strict";"function"==typeof define&&define.amd?define(b):"object"==typeof module&&module.exports?module.exports=b():a.log=b()}(this,function(){"use strict";function a(a,b){var c=a[b];if("function"==typeof c.bind)return c.bind(a);try{return Function.prototype.bind.call(c,a)}catch(b){return function(){return Function.prototype.apply.apply(c,[a,arguments])}}}function b(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(c){return"debug"===c&&(c="log"),typeof console!==i&&("trace"===c&&j?b:void 0!==console[c]?a(console,c):void 0!==console.log?a(console,"log"):h)}function d(a,b){for(var c=0;c<k.length;c++){var d=k[c];this[d]=c<a?h:this.methodFactory(d,a,b)}this.log=this.debug}function e(a,b,c){return function(){typeof console!==i&&(d.call(this,b,c),this[a].apply(this,arguments))}}function f(a,b,d){return c(a)||e.apply(this,arguments)}function g(a,b,c){function e(a){var b=(k[a]||"silent").toUpperCase();if(typeof window!==i&&m){try{return void(window.localStorage[m]=b)}catch(a){}try{window.document.cookie=encodeURIComponent(m)+"="+b+";"}catch(a){}}}function g(){var a;if(typeof window!==i&&m){try{a=window.localStorage[m]}catch(a){}if(typeof a===i)try{var b=window.document.cookie,c=b.indexOf(encodeURIComponent(m)+"=");-1!==c&&(a=/^([^;]+)/.exec(b.slice(c))[1])}catch(a){}return void 0===l.levels[a]&&(a=void 0),a}}function h(){if(typeof window!==i&&m){try{return void window.localStorage.removeItem(m)}catch(a){}try{window.document.cookie=encodeURIComponent(m)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(a){}}}var j,l=this;b=null==b?"WARN":b;var m="loglevel";"string"==typeof a?m+=":"+a:"symbol"==typeof a&&(m=void 0),l.name=a,l.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},l.methodFactory=c||f,l.getLevel=function(){return j},l.setLevel=function(b,c){if("string"==typeof b&&void 0!==l.levels[b.toUpperCase()]&&(b=l.levels[b.toUpperCase()]),!("number"==typeof b&&b>=0&&b<=l.levels.SILENT))throw"log.setLevel() called with invalid level: "+b;if(j=b,!1!==c&&e(b),d.call(l,b,a),typeof console===i&&b<l.levels.SILENT)return"No console available for logging"},l.setDefaultLevel=function(a){b=a,g()||l.setLevel(a,!1)},l.resetLevel=function(){l.setLevel(b,!1),h()},l.enableAll=function(a){l.setLevel(l.levels.TRACE,a)},l.disableAll=function(a){l.setLevel(l.levels.SILENT,a)};var n=g();null==n&&(n=b),l.setLevel(n,!1)}var h=function(){},i="undefined",j=typeof window!==i&&typeof window.navigator!==i&&/Trident\/|MSIE /.test(window.navigator.userAgent),k=["trace","debug","info","warn","error"],l=new g,m={};l.getLogger=function(a){if("symbol"!=typeof a&&"string"!=typeof a||""===a)throw new TypeError("You must supply a name when creating a logger.");var b=m[a];return b||(b=m[a]=new g(a,l.getLevel(),l.methodFactory)),b};var n=typeof window!==i?window.log:void 0;return l.noConflict=function(){return typeof window!==i&&window.log===l&&(window.log=n),l},l.getLoggers=function(){return m},l.default=l,l});
  • trip-planner-front/node_modules/loglevel/index.d.ts

    r59329aa re29cc2e  
    169169
    170170        /**
     171         * This resets the current log level to the default level (or `warn` if no explicit default was set) and clears
     172         * the persisted level if one was previously persisted.
     173         */
     174        resetLevel(): void;
     175
     176        /**
    171177         * This enables all log messages, and is equivalent to log.setLevel("trace").
    172178         *
  • trip-planner-front/node_modules/loglevel/lib/loglevel.js

    r59329aa re29cc2e  
    119119      var self = this;
    120120      var currentLevel;
     121      defaultLevel = defaultLevel == null ? "WARN" : defaultLevel;
    121122
    122123      var storageKey = "loglevel";
     
    172173
    173174          return storedLevel;
     175      }
     176
     177      function clearPersistedLevel() {
     178          if (typeof window === undefinedType || !storageKey) return;
     179
     180          // Use localStorage if available
     181          try {
     182              window.localStorage.removeItem(storageKey);
     183              return;
     184          } catch (ignore) {}
     185
     186          // Use session cookie as fallback
     187          try {
     188              window.document.cookie =
     189                encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
     190          } catch (ignore) {}
    174191      }
    175192
     
    210227
    211228      self.setDefaultLevel = function (level) {
     229          defaultLevel = level;
    212230          if (!getPersistedLevel()) {
    213231              self.setLevel(level, false);
    214232          }
     233      };
     234
     235      self.resetLevel = function () {
     236          self.setLevel(defaultLevel, false);
     237          clearPersistedLevel();
    215238      };
    216239
     
    226249      var initialLevel = getPersistedLevel();
    227250      if (initialLevel == null) {
    228           initialLevel = defaultLevel == null ? "WARN" : defaultLevel;
     251          initialLevel = defaultLevel;
    229252      }
    230253      self.setLevel(initialLevel, false);
  • trip-planner-front/node_modules/loglevel/package.json

    r59329aa re29cc2e  
    11{
    2   "_args": [
    3     [
    4       "loglevel@1.7.1",
    5       "C:\\Users\\DELL\\Desktop\\bachelor-thesis\\trip-planner-front"
    6     ]
    7   ],
    8   "_development": true,
    9   "_from": "loglevel@1.7.1",
    10   "_id": "loglevel@1.7.1",
     2  "_from": "loglevel@^1.6.8",
     3  "_id": "loglevel@1.8.0",
    114  "_inBundle": false,
    12   "_integrity": "sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw==",
     5  "_integrity": "sha512-G6A/nJLRgWOuuwdNuA6koovfEV1YpqqAG4pRUlFaz3jj2QNZ8M4vBqnVA+HBTmU/AMNUtlOsMmSpF6NyOjztbA==",
    136  "_location": "/loglevel",
    147  "_phantomChildren": {},
    158  "_requested": {
    16     "type": "version",
     9    "type": "range",
    1710    "registry": true,
    18     "raw": "loglevel@1.7.1",
     11    "raw": "loglevel@^1.6.8",
    1912    "name": "loglevel",
    2013    "escapedName": "loglevel",
    21     "rawSpec": "1.7.1",
     14    "rawSpec": "^1.6.8",
    2215    "saveSpec": null,
    23     "fetchSpec": "1.7.1"
     16    "fetchSpec": "^1.6.8"
    2417  },
    2518  "_requiredBy": [
    2619    "/webpack-dev-server"
    2720  ],
    28   "_resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.7.1.tgz",
    29   "_spec": "1.7.1",
    30   "_where": "C:\\Users\\DELL\\Desktop\\bachelor-thesis\\trip-planner-front",
     21  "_resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.8.0.tgz",
     22  "_shasum": "e7ec73a57e1e7b419cb6c6ac06bf050b67356114",
     23  "_spec": "loglevel@^1.6.8",
     24  "_where": "C:\\Users\\DELL\\Desktop\\bachelor-thesis\\trip-planner-front\\node_modules\\webpack-dev-server",
    3125  "author": {
    3226    "name": "Tim Perry",
     
    3731    "url": "https://github.com/pimterry/loglevel/issues"
    3832  },
     33  "bundleDependencies": false,
    3934  "dependencies": {},
     35  "deprecated": false,
    4036  "description": "Minimal lightweight logging for JavaScript, adding reliable log level methods to any available console.log methods",
    4137  "devDependencies": {
     
    9086  },
    9187  "types": "./index.d.ts",
    92   "version": "1.7.1"
     88  "version": "1.8.0"
    9389}
  • trip-planner-front/node_modules/loglevel/test/default-level-test.js

    r59329aa re29cc2e  
    5757            });
    5858        });
     59
     60        describe("log.resetLevel() resets the log", function() {
     61            it("to warn if no explicit default is set", function(log) {
     62                log.setLevel("debug");
     63                log.resetLevel();
     64
     65                expect(log).toBeAtLevel("warn");
     66            });
     67
     68            it("to info if default is set to info", function(log) {
     69                log.setDefaultLevel("info");
     70                log.setLevel("debug");
     71                log.resetLevel();
     72
     73                expect(log).toBeAtLevel("info");
     74            });
     75        });
    5976    });
    6077});
  • trip-planner-front/node_modules/loglevel/test/local-storage-test.js

    r59329aa re29cc2e  
    9797                expect("error").not.toBeTheStoredLevel();
    9898            });
     99
     100            it("log.resetLevel() clears the saved level", function(log) {
     101                log.resetLevel();
     102
     103                expect(undefined).toBeTheStoredLevel();
     104                expect("info").not.toBeTheStoredLevel();
     105            });
    99106        });
    100107
  • trip-planner-front/node_modules/loglevel/test/test-helpers.js

    r59329aa re29cc2e  
    6868
    6969    self.toBeTheLevelStoredByCookie = function toBeTheLevelStoredByCookie(name) {
    70         var level = this.actual.toUpperCase();
     70        var level = this.actual === undefined ? undefined : this.actual.toUpperCase();
    7171        var storageKey = encodeURIComponent(getStorageKey(name));
    7272
    73         if (window.document.cookie.indexOf(storageKey + "=" + level) !== -1) {
     73        if(level === undefined) {
     74            return window.document.cookie.indexOf(storageKey + "=") === -1;
     75        } else if (window.document.cookie.indexOf(storageKey + "=" + level) !== -1) {
    7476            return true;
    7577        } else {
     
    7981
    8082    self.toBeTheLevelStoredByLocalStorage = function toBeTheLevelStoredByLocalStorage(name) {
    81         var level = this.actual.toUpperCase();
     83        var level = this.actual === undefined ? undefined : this.actual.toUpperCase();
    8284
    8385        if (window.localStorage[getStorageKey(name)] === level) {
Note: See TracChangeset for help on using the changeset viewer.