Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

loglevel-plugin-prefix

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loglevel-plugin-prefix - npm Package Compare versions

Comparing version 0.8.3 to 0.8.4

index.d.ts

2

dist/loglevel-plugin-prefix.min.js

@@ -1,1 +0,1 @@

!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof module&&module.exports?module.exports=t():e.prefix=t(e)}(this,function(e){"use strict";var t,r,o={template:"[%t] %l:",levelFormatter:function(e){return e.toUpperCase()},nameFormatter:function(e){return e||"root"},timestampFormatter:function(e){return e.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/,"$1")},format:void 0},n={},a={reg:function(e){if(!e||!e.getLogger)throw new TypeError("Argument is not a root logger");t=e},apply:function(e,r){if(!e||!e.setLevel)throw new TypeError("Argument is not a logger");var a=e.methodFactory,l=e.name||"",i=n[l]||n[""]||o;return n[l]||(e.methodFactory=function(e,t,r){var o=a(e,t,r),i=n[r]||n[""],f=-1!==i.template.indexOf("%t"),p=-1!==i.template.indexOf("%l"),m=-1!==i.template.indexOf("%n");return function(){for(var t="",a=arguments.length,u=Array(a),c=0;c<a;c++)u[c]=arguments[c];if(l||!n[r]){var g=i.timestampFormatter(new Date),s=i.levelFormatter(e),d=i.nameFormatter(r);i.format?t+=i.format(s,d,g):(t+=i.template,f&&(t=t.replace(/%t/,g)),p&&(t=t.replace(/%l/,s)),m&&(t=t.replace(/%n/,d))),u.length&&"string"==typeof u[0]?u[0]=t+" "+u[0]:u.unshift(t)}o.apply(void 0,u)}}),(r=r||{}).template&&(r.format=void 0),n[l]=function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(t in arguments[r])Object.prototype.hasOwnProperty.call(arguments[r],t)&&(e[t]=arguments[r][t]);return e}({},i,r),e.setLevel(e.getLevel()),t||e.warn("It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md"),e}};return e&&(r=e.prefix,a.noConflict=function(){return e.prefix===a&&(e.prefix=r),a}),a});
!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof module&&module.exports?module.exports=t():e.prefix=t(e)}(this,function(e){"use strict";var n,t,a={template:"[%t] %l:",levelFormatter:function(e){return e.toUpperCase()},nameFormatter:function(e){return e||"root"},timestampFormatter:function(e){return e.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/,"$1")},format:void 0},d={},r={reg:function(e){if(!e||!e.getLogger)throw new TypeError("Argument is not a root logger");n=e},apply:function(e,t){if(!e||!e.setLevel)throw new TypeError("Argument is not a logger");var r=e.methodFactory,s=e.name||"",o=d[s]||d[""]||a;return d[s]||(e.methodFactory=function(i,e,f){var p=r(i,e,f),m=d[f]||d[""],u=-1!==m.template.indexOf("%t"),c=-1!==m.template.indexOf("%l"),g=-1!==m.template.indexOf("%n");return function(){for(var e="",t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];if(s||!d[f]){var n=m.timestampFormatter(new Date),a=m.levelFormatter(i),l=m.nameFormatter(f);m.format?e+=m.format(a,l,n):(e+=m.template,u&&(e=e.replace(/%t/,n)),c&&(e=e.replace(/%l/,a)),g&&(e=e.replace(/%n/,l))),r.length&&"string"==typeof r[0]?r[0]=e+" "+r[0]:r.unshift(e)}p.apply(void 0,r)}}),(t=t||{}).template&&(t.format=void 0),d[s]=function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(t in arguments[r])Object.prototype.hasOwnProperty.call(arguments[r],t)&&(e[t]=arguments[r][t]);return e}({},o,t),e.setLevel(e.getLevel()),n||e.warn("It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md"),e}};return e&&(t=e.prefix,r.noConflict=function(){return e.prefix===r&&(e.prefix=t),r}),r});

@@ -27,4 +27,5 @@ {

"license": "MIT",
"version": "0.8.3",
"version": "0.8.4",
"main": "./lib/loglevel-plugin-prefix",
"types": "index.d.ts",
"scripts": {

@@ -39,7 +40,7 @@ "eslint": "eslint ./lib/loglevel-plugin-prefix.js",

"chai": "^4.1.2",
"chalk": "^2.3.0",
"chalk": "^2.4.1",
"eslint": "^3.19.0",
"eslint-config-airbnb-base": "^11.3.2",
"eslint-plugin-chai-friendly": "^0.3.6",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-import": "^2.12.0",
"loglevel": "^1.6.1",

@@ -49,4 +50,4 @@ "loglevel-plugin-mock": "^0.1.0",

"sinon": "^2.4.1",
"uglify-js": "^3.3.5"
"uglify-js": "^3.4.0"
}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc