json-colorizer
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "json-colorizer", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A library to format JSON with colors for display in the console", | ||
@@ -5,0 +5,0 @@ "main": "src/lib/index.js", |
@@ -22,3 +22,3 @@ # json-colorizer | ||
var colorize = require('json-colorizer'); | ||
var json = JSON.stringify({"foo": "bar"}, null, 2) | ||
var json = JSON.stringify({"foo": "bar"}, null, 2); | ||
console.log(colorize(json); | ||
@@ -34,3 +34,3 @@ ``` | ||
var colorize = require('json-colorizer'); | ||
var chalk = require('chalk') | ||
var chalk = require('chalk'); | ||
console.log(colorize({ "foo": "bar" }, { | ||
@@ -40,3 +40,3 @@ colors: { | ||
} | ||
}); | ||
})); | ||
``` | ||
@@ -43,0 +43,0 @@ |
@@ -8,4 +8,4 @@ const tokenTypes = [ | ||
{ regex: /^-?\d+(?:\.\d+)?(?:e[+\-]?\d+)?/i, tokenType: 'NUMBER_LITERAL' }, | ||
{ regex: /^"(?:\\.|[^"])*"(?=\s*:)/, tokenType: 'STRING_KEY'}, | ||
{ regex: /^"(?:\\.|[^"])*"/, tokenType: 'STRING_LITERAL'}, | ||
{ regex: /^"(?:\\.|[^"\\])*"(?=\s*:)/, tokenType: 'STRING_KEY'}, | ||
{ regex: /^"(?:\\.|[^"\\])*"/, tokenType: 'STRING_LITERAL'}, | ||
{ regex: /^true|false/, tokenType: 'BOOLEAN_LITERAL' }, | ||
@@ -19,3 +19,3 @@ { regex: /^null/, tokenType: 'NULL_LITERAL' } | ||
var tokens = []; | ||
var foundToken = false; | ||
var foundToken; | ||
@@ -27,2 +27,3 @@ var match; | ||
do { | ||
foundToken = false; | ||
for (i = 0; i < numTokenTypes; i++) { | ||
@@ -29,0 +30,0 @@ match = tokenTypes[i].regex.exec(input); |
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
29601
208
11