Comparing version 1.6.0 to 1.7.0
21
bows.js
@@ -35,2 +35,4 @@ (function() { | ||
hue = 0, | ||
padding = true, | ||
separator = '|', | ||
padLength = 15, | ||
@@ -60,5 +62,10 @@ noop = function() {}, | ||
var msg, colorString, logfn; | ||
msg = (str.slice(0, padLength)); | ||
msg += Array(padLength + 3 - msg.length).join(' ') + '|'; | ||
if (padding) { | ||
msg = (str.slice(0, padLength)); | ||
msg += Array(padLength + 3 - msg.length).join(' ') + separator; | ||
} else { | ||
msg = str + Array(3).join(' ') + separator; | ||
} | ||
if (debugRegex) { | ||
@@ -105,2 +112,12 @@ var matches = str.match(debugRegex); | ||
} | ||
if (typeof config.padding === 'boolean') { | ||
padding = config.padding; | ||
} | ||
if (config.separator) { | ||
separator = config.separator; | ||
} else if (config.separator === false || config.separator === '') { | ||
separator = '' | ||
} | ||
}; | ||
@@ -107,0 +124,0 @@ |
@@ -37,2 +37,4 @@ !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){ | ||
hue = 0, | ||
padding = true, | ||
separator = '|', | ||
padLength = 15, | ||
@@ -62,5 +64,10 @@ noop = function() {}, | ||
var msg, colorString, logfn; | ||
msg = (str.slice(0, padLength)); | ||
msg += Array(padLength + 3 - msg.length).join(' ') + '|'; | ||
if (padding) { | ||
msg = (str.slice(0, padLength)); | ||
msg += Array(padLength + 3 - msg.length).join(' ') + separator; | ||
} else { | ||
msg = str + Array(3).join(' ') + separator; | ||
} | ||
if (debugRegex) { | ||
@@ -107,2 +114,12 @@ var matches = str.match(debugRegex); | ||
} | ||
if (typeof config.padding === 'boolean') { | ||
padding = config.padding; | ||
} | ||
if (config.separator) { | ||
separator = config.separator; | ||
} else if (config.separator === false || config.separator === '') { | ||
separator = '' | ||
} | ||
}; | ||
@@ -109,0 +126,0 @@ |
@@ -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 s=new Error("Cannot find module '"+f+"'");throw s.code="MODULE_NOT_FOUND",s}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(o){(function(){function r(){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;var e,n=!!window.chrome,r=/firefox/i.test(navigator.userAgent),t=o&&o.versions&&o.versions.electron;if(r){var i=navigator.userAgent.match(/Firefox\/(\d+\.\d+)/);i&&i[1]&&Number(i[1])&&(e=Number(i[1]))}return n||e>=31||t}var t=function(){var e=.618033988749895;return c+=e,c%=1,360*c},i="undefined"==typeof window,f=!i&&window.localStorage,u=f.andlogKey||"debug",d=f[u],s=e("andlog"),a=Function.prototype.bind,c=0,l=15,p=function(){},w=f.debugColors?"false"!==f.debugColors:r(),g=null,v=null,h=!1,m={};d&&"!"===d[0]&&"/"===d[1]&&(h=!0,d=d.slice(1)),v=d&&"/"===d[0]&&new RegExp(d.substring(1,d.length-1));for(var y=["log","debug","warn","error","info"],b=0,x=y.length;x>b;b++)p[y[b]]=p;g=function(e){var n,o,r;if(n=e.slice(0,l),n+=Array(l+3-n.length).join(" ")+"|",v){var i=e.match(v);if(!h&&!i||h&&i)return p}if(!a)return p;var f=[s];if(w){m[e]||(m[e]=t());var u=m[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 d=Array.prototype.slice.call(arguments,1);f=f.concat(d)}return r=a.apply(s.log,f),y.forEach(function(e){r[e]=a.apply(s[e]||r,f)}),r},g.config=function(e){e.padLength&&(l=e.padLength)},"undefined"!=typeof n?n.exports=g:window.bows=g}).call()}).call(this,e("_process"))},{_process:3,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}()},{}],3:[function(e,n,o){function r(){}var t=n.exports={};t.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(n){var o=[];return window.addEventListener("message",function(e){var n=e.source;if((n===window||null===n)&&"process-tick"===e.data&&(e.stopPropagation(),o.length>0)){var r=o.shift();r()}},!0),function(e){o.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),t.title="browser",t.browser=!0,t.env={},t.argv=[],t.on=r,t.addListener=r,t.once=r,t.off=r,t.removeListener=r,t.removeAllListeners=r,t.emit=r,t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")}},{}]},{},[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,d){if(!o[f]){if(!n[f]){var u="function"==typeof require&&require;if(!d&&u)return u(f,!0);if(i)return i(f,!0);var s=new Error("Cannot find module '"+f+"'");throw s.code="MODULE_NOT_FOUND",s}var a=o[f]={exports:{}};n[f][0].call(a.exports,function(e){var o=n[f][1][e];return t(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(o){(function(){var r=function(){return a+=.618033988749895,360*(a%=1)},t="undefined"==typeof window,i=!t&&window.localStorage,f=i.andlogKey||"debug",d=i[f],u=e("andlog"),s=Function.prototype.bind,a=0,c=!0,l="|",p=15,w=function(){},g=i.debugColors?"false"!==i.debugColors:function(){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;var e,n=!!window.chrome,r=/firefox/i.test(navigator.userAgent),t=o&&o.versions&&o.versions.electron;if(r){var i=navigator.userAgent.match(/Firefox\/(\d+\.\d+)/);i&&i[1]&&Number(i[1])&&(e=Number(i[1]))}return n||e>=31||t}(),v=null,h=null,y=!1,m={};d&&"!"===d[0]&&"/"===d[1]&&(y=!0,d=d.slice(1)),h=d&&"/"===d[0]&&new RegExp(d.substring(1,d.length-1));for(var b=["log","debug","warn","error","info"],x=0,E=b.length;x<E;x++)w[b[x]]=w;v=function(e){var n,o,t;if(c?(n=e.slice(0,p),n+=Array(p+3-n.length).join(" ")+l):n=e+Array(3).join(" ")+l,h){var i=e.match(h);if(!y&&!i||y&&i)return w}if(!s)return w;var f=[u];if(g){m[e]||(m[e]=r());var d=m[e];n="%c"+n,o="color: hsl("+d+",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=s.apply(u.log,f),b.forEach(function(e){t[e]=s.apply(u[e]||t,f)}),t},v.config=function(e){e.padLength&&(p=e.padLength),"boolean"==typeof e.padding&&(c=e.padding),e.separator?l=e.separator:!1!==e.separator&&""!==e.separator||(l="")},void 0!==n?n.exports=v:window.bows=v}).call()}).call(this,e("_process"))},{_process:3,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(","),d=f.length,u=function(){};d--;)t[f[d]]=u;void 0!==o?n.exports=t:window.console=t}()},{}],3:[function(e,n,o){function r(){}var t=n.exports={};t.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(n){var o=[];return window.addEventListener("message",function(e){var n=e.source;if((n===window||null===n)&&"process-tick"===e.data&&(e.stopPropagation(),o.length>0)){o.shift()()}},!0),function(e){o.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),t.title="browser",t.browser=!0,t.env={},t.argv=[],t.on=r,t.addListener=r,t.once=r,t.off=r,t.removeListener=r,t.removeAllListeners=r,t.emit=r,t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")}},{}]},{},[1])(1)}); |
{ | ||
"name": "bows", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "Rainbowed console logs for chrome, opera and firefox in development.", | ||
@@ -5,0 +5,0 @@ "main": "bows.js", |
@@ -37,2 +37,3 @@ # Bows | ||
* Invert regex to remove logs matching with: `localStorage.debug ='!/Foo/` | ||
* Customize the localStorage key by setting `localStorage.andlogKey` and you can use `localStorage.<anyKeyYouWant>` to set your log grepping. | ||
@@ -39,0 +40,0 @@ # Browser Support |
@@ -10,3 +10,6 @@ var runTestPage = require('./helpers/runTestPage'); | ||
'test/color-map.html', | ||
'test/separator.html', | ||
'test/no-separator.html', | ||
'test/padLength.html', | ||
'test/no-padding.html', | ||
'test/args.html' | ||
@@ -13,0 +16,0 @@ ]; |
window.localStorage = true; | ||
var bows = require('bows'); | ||
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
94461
29
458
132