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

ba-js-logger

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ba-js-logger - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

2

dist/ba-js-logger.umd.js

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

(function(n,r){typeof exports=="object"&&typeof module!="undefined"?module.exports=r():typeof define=="function"&&define.amd?define(r):(n=typeof globalThis!="undefined"?globalThis:n||self,n.baJsLogger=r())})(this,function(){"use strict";class n{static get LEVEL_DEBUG(){return"d"}static get LEVEL_INFO(){return"i"}static get LEVEL_WARN(){return"w"}static get LEVEL_ERROR(){return"e"}static get LEVEL_FATAL(){return"f"}static LEVEL(t){return["d","i","w","e","f"].indexOf(t)}constructor(t,e,s=n.LEVEL_INFO){this.url=t,this.context=e,this.lvl=n.LEVEL(s)}level(t){return t&&(this.lvl=n.LEVEL(t)),this}postRequest(t,e){const s=`${this.url}/${e}?_=${new Date().getTime()}`,o=` [ua: ${navigator.userAgent}] [platform: ${navigator.platform}] [cookie: ${document.cookie}]`,i=new URLSearchParams;return i.append("context",this.context),i.append("message",`${t}${o}`),fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:i.toString()}).catch(u=>{console.error(u)})}send(t,e,s){return n.LEVEL(e)>=this.lvl?this.postRequest(t,e,s):Promise.resolve()}debug(t,e){return this.send(t,n.LEVEL_DEBUG,e)}info(t,e){return this.send(t,n.LEVEL_INFO,e)}warn(t,e){return this.send(t,n.LEVEL_WARN,e)}error(t,e){return this.send(t,n.LEVEL_ERROR,e)}fatal(t,e){return this.send(t,n.LEVEL_FATAL,e)}}return n});
(function(e,s){typeof exports=="object"&&typeof module!="undefined"?module.exports=s():typeof define=="function"&&define.amd?define(s):(e=typeof globalThis!="undefined"?globalThis:e||self,e.baJsLogger=s())})(this,function(){"use strict";class e{static get LEVEL_DEBUG(){return"d"}static get LEVEL_INFO(){return"i"}static get LEVEL_WARN(){return"w"}static get LEVEL_ERROR(){return"e"}static get LEVEL_FATAL(){return"f"}static LEVEL(t){return["d","i","w","e","f"].indexOf(t)}constructor(t,n,r=e.LEVEL_INFO){this.url=t,this.context=n,this.lvl=e.LEVEL(r)}level(t){return t&&(this.lvl=e.LEVEL(t)),this}postRequest(t,n){const r=`${this.url}/${n}?_=${new Date().getTime()}`,o=` [ua: ${navigator.userAgent}] [platform: ${navigator.platform}] [cookie: ${document.cookie}]`,i=new URLSearchParams;return i.append("context",this.context),i.append("message",`${t}${o}`),fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:i.toString()}).catch(u=>{console.error(u)})}send(t,n){return e.LEVEL(n)>=this.lvl?this.postRequest(t,n):Promise.resolve()}debug(t){return this.send(t,e.LEVEL_DEBUG)}info(t){return this.send(t,e.LEVEL_INFO)}warn(t){return this.send(t,e.LEVEL_WARN)}error(t){return this.send(t,e.LEVEL_ERROR)}fatal(t){return this.send(t,e.LEVEL_FATAL)}}return e});
{
"name": "ba-js-logger",
"version": "2.0.1",
"version": "2.0.2",
"scripts": {

@@ -5,0 +5,0 @@ "dev": "vite",

Sorry, the diff of this file is not supported yet

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