Comparing version 1.4.8 to 1.5.0
@@ -6,2 +6,3 @@ (function() { | ||
} | ||
var chrome = !!window.chrome, | ||
@@ -36,3 +37,4 @@ firefox = /firefox/i.test(navigator.userAgent), | ||
noop = function() {}, | ||
colorsSupported = ls.debugColors || checkColorSupport(), | ||
// if ls.debugColors is set, use that, otherwise check for support | ||
colorsSupported = ls.debugColors ? (ls.debugColors !== "false") : checkColorSupport(), | ||
bows = null, | ||
@@ -39,0 +41,0 @@ debugRegex = null, |
@@ -7,2 +7,3 @@ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.bows=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
} | ||
var chrome = !!window.chrome, | ||
@@ -37,3 +38,4 @@ firefox = /firefox/i.test(navigator.userAgent), | ||
noop = function() {}, | ||
colorsSupported = ls.debugColors || checkColorSupport(), | ||
// if ls.debugColors is set, use that, otherwise check for support | ||
colorsSupported = ls.debugColors ? (ls.debugColors !== "false") : checkColorSupport(), | ||
bows = null, | ||
@@ -40,0 +42,0 @@ debugRegex = null, |
@@ -1,1 +0,1 @@ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.bows=e()}}(function(){return function e(n,o,r){function t(f,u){if(!o[f]){if(!n[f]){var d="function"==typeof require&&require;if(!u&&d)return d(f,!0);if(i)return i(f,!0);var l=new Error("Cannot find module '"+f+"'");throw l.code="MODULE_NOT_FOUND",l}var a=o[f]={exports:{}};n[f][0].call(a.exports,function(e){var o=n[f][1][e];return t(o?o:e)},a,a.exports,e,n,o,r)}return o[f].exports}for(var i="function"==typeof require&&require,f=0;f<r.length;f++)t(r[f]);return t}({1:[function(e,n,o){(function(){function o(){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;var e,n=!!window.chrome,o=/firefox/i.test(navigator.userAgent);if(o){var r=navigator.userAgent.match(/Firefox\/(\d+\.\d+)/);r&&r[1]&&Number(r[1])&&(e=Number(r[1]))}return n||e>=31}var r=function(){var e=.618033988749895;return a+=e,a%=1,360*a},t="undefined"==typeof window,i=!t&&window.localStorage,f=i.andlogKey||"debug",u=i[f],d=e("andlog"),l=Function.prototype.bind,a=0,c=15,p=function(){},s=i.debugColors||o(),g=null,w=null,v=!1,y={};u&&"!"===u[0]&&"/"===u[1]&&(v=!0,u=u.slice(1)),w=u&&"/"===u[0]&&new RegExp(u.substring(1,u.length-1));for(var h=["log","debug","warn","error","info"],m=0,b=h.length;b>m;m++)p[h[m]]=p;g=function(e){var n,o,t;if(n=e.slice(0,c),n+=Array(c+3-n.length).join(" ")+"|",w){var i=e.match(w);if(!v&&!i||v&&i)return p}if(!l)return p;var f=[d];if(s){y[e]||(y[e]=r());var u=y[e];n="%c"+n,o="color: hsl("+u+",99%,40%); font-weight: bold",f.push(n,o)}else f.push(n);if(arguments.length>1){var a=Array.prototype.slice.call(arguments,1);f=f.concat(a)}return t=l.apply(d.log,f),h.forEach(function(e){t[e]=l.apply(d[e]||t,f)}),t},g.config=function(e){e.padLength&&(c=e.padLength)},"undefined"!=typeof n?n.exports=g:window.bows=g}).call()},{andlog:2}],2:[function(e,n,o){!function(){var e="undefined"==typeof window,r=!e&&window.localStorage,t={};if(e)return void(n.exports=console);var i=r.andlogKey||"debug";if(r&&r[i]&&window.console)t=window.console;else for(var f="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),u=f.length,d=function(){};u--;)t[f[u]]=d;"undefined"!=typeof o?n.exports=t:window.console=t}()},{}]},{},[1])(1)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.bows=e()}}(function(){return function e(n,o,r){function t(f,u){if(!o[f]){if(!n[f]){var d="function"==typeof require&&require;if(!u&&d)return d(f,!0);if(i)return i(f,!0);var l=new Error("Cannot find module '"+f+"'");throw l.code="MODULE_NOT_FOUND",l}var a=o[f]={exports:{}};n[f][0].call(a.exports,function(e){var o=n[f][1][e];return t(o?o:e)},a,a.exports,e,n,o,r)}return o[f].exports}for(var i="function"==typeof require&&require,f=0;f<r.length;f++)t(r[f]);return t}({1:[function(e,n,o){(function(){function o(){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;var e,n=!!window.chrome,o=/firefox/i.test(navigator.userAgent);if(o){var r=navigator.userAgent.match(/Firefox\/(\d+\.\d+)/);r&&r[1]&&Number(r[1])&&(e=Number(r[1]))}return n||e>=31}var r=function(){var e=.618033988749895;return a+=e,a%=1,360*a},t="undefined"==typeof window,i=!t&&window.localStorage,f=i.andlogKey||"debug",u=i[f],d=e("andlog"),l=Function.prototype.bind,a=0,c=15,p=function(){},s=i.debugColors?"false"!==i.debugColors:o(),g=null,w=null,v=!1,y={};u&&"!"===u[0]&&"/"===u[1]&&(v=!0,u=u.slice(1)),w=u&&"/"===u[0]&&new RegExp(u.substring(1,u.length-1));for(var h=["log","debug","warn","error","info"],b=0,m=h.length;m>b;b++)p[h[b]]=p;g=function(e){var n,o,t;if(n=e.slice(0,c),n+=Array(c+3-n.length).join(" ")+"|",w){var i=e.match(w);if(!v&&!i||v&&i)return p}if(!l)return p;var f=[d];if(s){y[e]||(y[e]=r());var u=y[e];n="%c"+n,o="color: hsl("+u+",99%,40%); font-weight: bold",f.push(n,o)}else f.push(n);if(arguments.length>1){var a=Array.prototype.slice.call(arguments,1);f=f.concat(a)}return t=l.apply(d.log,f),h.forEach(function(e){t[e]=l.apply(d[e]||t,f)}),t},g.config=function(e){e.padLength&&(c=e.padLength)},"undefined"!=typeof n?n.exports=g:window.bows=g}).call()},{andlog:2}],2:[function(e,n,o){!function(){var e="undefined"==typeof window,r=!e&&window.localStorage,t={};if(e)return void(n.exports=console);var i=r.andlogKey||"debug";if(r&&r[i]&&window.console)t=window.console;else for(var f="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),u=f.length,d=function(){};u--;)t[f[u]]=d;"undefined"!=typeof o?n.exports=t:window.console=t}()},{}]},{},[1])(1)}); |
{ | ||
"name": "bows", | ||
"version": "1.4.8", | ||
"version": "1.5.0", | ||
"description": "Rainbowed console logs for chrome, opera and firefox in development.", | ||
@@ -5,0 +5,0 @@ "main": "bows.js", |
@@ -60,5 +60,8 @@ # Bows | ||
``` | ||
- Logging is disabled by default. To enable logging, set `localStorage.debug = true` in your console and refresh the page. | ||
- To **disable** logging again, you must do `delete localStorage.debug` (`localStorage.debug = false` will not work). | ||
- You can leave the code in in production, and log() will just safely no-op unless localStorage.debug is set. | ||
- Where colors are not supported, bows will just log plain text, but still with the module prefix. | ||
- If you wish to manually disable colors in an environment because detection is incorrect, set `localStorage.debugColors = false`, to reenable `delete localStorage.debugColors`. | ||
@@ -65,0 +68,0 @@ ## Example |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88302
370
131