pretty-data
Advanced tools
Comparing version 0.30.1 to 0.30.3
{ | ||
"name": "pretty-data", | ||
"version": "0.30.1", | ||
"version": "0.30.3", | ||
"author": "Vadim Kiryukhin <vkiryukhin@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "plugin to pretty print or minify XML, JSON, CSS and SQL files", |
/** | ||
* pretty-data - nodejs plugin to pretty-print or minify data in XML, JSON and CSS formats. | ||
* | ||
* Version - 0.30.1 | ||
* Version - 0.30.3 | ||
* Copyright (c) 2012 Vadim Kiryukhin | ||
@@ -47,3 +47,3 @@ * vkiryukhin @ gmail.com | ||
this.shift = ['\n']; // array of shifts | ||
this.step = ' ', // 2 spaces | ||
this.step = ' ', // 2 spaces | ||
maxdeep = 100, // nesting level | ||
@@ -63,3 +63,3 @@ ix = 0; | ||
var ar = text.replace(/>\s{0,}</g,"><").replace(/</g,"~#~<").split('~#~'), | ||
var ar = text.replace(/>\s{0,}</g,"><").replace(/</g,"~::~<").split('~::~'), | ||
len = ar.length, | ||
@@ -88,3 +88,3 @@ inComment = false, | ||
if( /^<\w/.exec(ar[ix-1]) && /^<\/\w/.exec(ar[ix]) && | ||
/^<\w+/.exec(ar[ix-1]) == /^<\/\w+/.exec(ar[ix])[0].replace('/','')) { | ||
/^<[\w:\-\.\,]+/.exec(ar[ix-1]) == /^<\/[\w:\-\.\,]+/.exec(ar[ix])[0].replace('/','')) { | ||
str += ar[ix]; | ||
@@ -124,11 +124,11 @@ if(!inComment) deep--; | ||
var ar = this.jsonmin(text).replace(/\{/g,"~#~{~#~") | ||
.replace(/\[/g,"[~#~") | ||
.replace(/\}/g,"~#~}") | ||
.replace(/\]/g,"~#~]") | ||
.replace(/\"\,/g,'",~#~') | ||
.replace(/\,\"/g,',~#~"') | ||
.replace(/\]\,/g,'],~#~') | ||
.replace(/~#~\s{0,}~#~/g,"~#~") | ||
.split('~#~'), | ||
var ar = this.jsonmin(text).replace(/\{/g,"~::~{~::~") | ||
.replace(/\[/g,"[~::~") | ||
.replace(/\}/g,"~::~}") | ||
.replace(/\]/g,"~::~]") | ||
.replace(/\"\,/g,'",~::~') | ||
.replace(/\,\"/g,',~::~"') | ||
.replace(/\]\,/g,'],~::~') | ||
.replace(/~::~\s{0,}~::~/g,"~::~") | ||
.split('~::~'), | ||
@@ -164,9 +164,9 @@ len = ar.length, | ||
var ar = text.replace(/\s{1,}/g,' ') | ||
.replace(/\{/g,"{~#~") | ||
.replace(/\}/g,"~#~}~#~") | ||
.replace(/\;/g,";~#~") | ||
.replace(/\/\*/g,"~#~/*") | ||
.replace(/\*\//g,"*/~#~") | ||
.replace(/~#~\s{0,}~#~/g,"~#~") | ||
.split('~#~'), | ||
.replace(/\{/g,"{~::~") | ||
.replace(/\}/g,"~::~}~::~") | ||
.replace(/\;/g,";~::~") | ||
.replace(/\/\*/g,"~::~/*") | ||
.replace(/\*\//g,"*/~::~") | ||
.replace(/~::~\s{0,}~::~/g,"~::~") | ||
.split('~::~'), | ||
len = ar.length, | ||
@@ -173,0 +173,0 @@ deep = 0, |
@@ -1,2 +0,2 @@ | ||
# pretty-data | ||
# pretty-data - Nodejs plugin | ||
@@ -6,3 +6,3 @@ nodejs plugin to **pretty-print** or **minify** | ||
**Version** - 0.30.1 | ||
**Version** - 0.30.3 | ||
@@ -9,0 +9,0 @@ **Copyright** (c) 2012 Vadim Kiryukhin ( vkiryukhin @ gmail.com ) |
var xml = '<a> <b> <c>zz xxx zz</c>\n <!-- comment --> <d/> \n</b>\n</a>', | ||
var xml = '<a> <b> <c>zz xxx zz</c>\n <!-- comment --> <d/> \n</b>\n <xs:tt> <xs:ttb/> </xs:tt> </a>', | ||
pp_xml = require('../pretty-data').pd.xml(xml), | ||
@@ -4,0 +4,0 @@ pp_xmlmin_com = require('../pretty-data').pd.xmlmin(xml,true), |
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
16347
7