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

angular-pretty-xml

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-pretty-xml - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

.idea/dbnavigator.xml

2

dist/angular-pretty-xml.js

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

!function(e){return"function"==typeof define&&define.amd?define(["angular"],function(n){return e(n)}):"object"==typeof exports?module.exports=e(require("angular")).name:e(angular)}(function(e){function n(e){var n="";if(isNaN(parseInt(e)))n=e;else for(var r=0;e>r;r++)n+=" ";for(var t=["\n"],f=0;100>f;f++)t.push(t[f]+n);return t}function r(e,r){"number"==typeof r?0!==r&&(r=r||2):"string"!=typeof r&&(r=2);for(var t=e.replace(/>\s*</gm,"><").replace(/</g,"~::~<").replace(/\s*xmlns([=:])/g,"~::~xmlns$1").split("~::~"),f=t.length,i=!1,x=0,u="",a=n(r),d=0;f>d;d++)-1!==t[d].indexOf("<!")?(u+=a[x]+t[d],i=!0,(-1!==t[d].indexOf("-->")||-1!==t[d].indexOf("]>")||-1!==t[d].indexOf("!DOCTYPE"))&&(i=!1)):-1!==t[d].indexOf("-->")||-1!==t[d].indexOf("]>")?(u+=t[d],i=!1):/^<\w/.test(t[d-1])&&/^<\/\w/.test(t[d])&&/^<[\w:\-\.,]+/.exec(t[d-1])===/^<\/[\w:\-\.,]+/.exec(t[d])[0].replace("/","")?(u+=t[d],i||x--):-1!==t[d].search(/<\w/)&&-1===t[d].indexOf("</")&&-1===t[d].indexOf("/>")?u=u+=i?t[d]:a[x++]+t[d]:-1!==t[d].search(/<\w/)&&-1!==t[d].indexOf("</")?u=u+=i?t[d]:a[x]+t[d]:-1!==t[d].indexOf("</")?u=u+=i?t[d]:a[--x]+t[d]:-1!==t[d].indexOf("/>")?u=u+=i?t[d]:a[x]+t[d]:u+=-1!==t[d].indexOf("<?")?a[x]+t[d]:t[d].indexOf("xmlns:")>-1||t[d].indexOf("xmlns=")>-1?a[x]+t[d]:t[d];return u.trim()}return e.module("prettyXml",[]).filter("prettyXml",function(){return r})});
!function(e){return"function"==typeof define&&define.amd?define(["angular"],function(n){return e(n)}):"object"==typeof exports?module.exports=e(require("angular")).name:e(angular)}(function(e){function n(e){var n="";if(isNaN(parseInt(e)))n=e;else for(var r=0;e>r;r++)n+=" ";for(var i=["\n"],t=0;100>t;t++)i.push(i[t]+n);return i}function r(r,i){isFinite(i)?0!==i&&(i=i||2):e.isString(i)||(i=2);for(var t=r.replace(/>\s*</gm,"><").replace(/</g,"~::~<").replace(/\s*xmlns([=:])/g,"~::~xmlns$1").split("~::~"),f=t.length,a=!1,x=0,s="",u=n(i),d=0;f>d;d++)-1!==t[d].indexOf("<!")?(s+=u[x]+t[d],a=!0,(-1!==t[d].indexOf("-->")||-1!==t[d].indexOf("]>")||-1!==t[d].indexOf("!DOCTYPE"))&&(a=!1)):-1!==t[d].indexOf("-->")||-1!==t[d].indexOf("]>")?(s+=t[d],a=!1):/^<\w/.test(t[d-1])&&/^<\/\w/.test(t[d])&&/^<[\w:\-\.,]+/.exec(t[d-1])==/^<\/[\w:\-\.,]+/.exec(t[d])[0].replace("/","")?(s+=t[d],a||x--):s+=-1!==t[d].search(/<\w/)&&-1===t[d].indexOf("</")&&-1===t[d].indexOf("/>")?a?t[d]:u[x++]+t[d]:-1!==t[d].search(/<\w/)&&-1!==t[d].indexOf("</")?a?t[d]:u[x]+t[d]:t[d].search(/<\//)>-1?a?t[d]:u[--x]+t[d]:-1!==t[d].indexOf("/>")?a?t[d]:u[x]+t[d]:-1!==t[d].indexOf("<?")?u[x]+t[d]:-1!==t[d].indexOf("xmlns:")||-1!==t[d].indexOf("xmlns=")?u[x]+t[d]:t[d];return s.trim()}return e.module("prettyXml",[]).filter("prettyXml",function(){return r})});
{
"name": "angular-pretty-xml",
"version": "0.1.0",
"version": "0.1.1",
"description": "Angular filter that makes XML pretty",

@@ -32,2 +32,2 @@ "main": "./dist/angular-pretty-xml.js",

}
}
}

@@ -10,3 +10,3 @@ # [angular-pretty-xml]

Via [npm]
Via [npm]:
```

@@ -13,0 +13,0 @@ npm install angular-pretty-xml --save

@@ -30,6 +30,6 @@ // credits to vkbeautify (https://code.google.com/p/vkbeautify/)

function prettify (xml, indent) {
if (typeof indent === 'number') {
if (isFinite(indent)) {
if (indent !== 0)
indent = indent || 2;
} else if (typeof indent !== 'string')
} else if (!angular.isString(indent))
indent = 2;

@@ -42,7 +42,7 @@

var len = arr.length,
var len = arr.length,
inComment = false,
depth = 0,
string = '',
shift = createShiftArr(indent);
depth = 0,
string = '',
shift = createShiftArr(indent);

@@ -64,16 +64,16 @@ for (var i = 0; i < len; i++) {

} else if (/^<\w/.test(arr[i - 1]) && /^<\/\w/.test(arr[i]) && // <elm></elm> //
/^<[\w:\-\.,]+/.exec(arr[i - 1]) === /^<\/[\w:\-\.,]+/.exec(arr[i])[0].replace('/', '')) { // fixme WTF?
/^<[\w:\-\.,]+/.exec(arr[i - 1]) == /^<\/[\w:\-\.,]+/.exec(arr[i])[0].replace('/', '')) { // fixme WTF?
string += arr[i];
if (!inComment) depth--;
} else if (arr[i].search(/<\w/) !== -1 && arr[i].indexOf('</') === -1 && arr[i].indexOf('/>') === -1) // <elm> //
string = !inComment ? string += shift[depth++] + arr[i] : string += arr[i];
string += !inComment ? (shift[depth++] + arr[i]) : arr[i];
else if (arr[i].search(/<\w/) !== -1 && arr[i].indexOf('</') !== -1) // <elm>...</elm> //
string = !inComment ? string += shift[depth] + arr[i] : string += arr[i];
else if (arr[i].indexOf('</') !== -1) // </elm> //
string = !inComment ? string += shift[--depth] + arr[i] : string += arr[i];
string += !inComment ? shift[depth] + arr[i] : arr[i];
else if (arr[i].search(/<\//) > -1) // </elm> //
string += !inComment ? shift[--depth] + arr[i] : arr[i];
else if (arr[i].indexOf('/>') !== -1) // <elm/> //
string = !inComment ? string += shift[depth] + arr[i] : string += arr[i];
string += !inComment ? shift[depth] + arr[i] : arr[i];
else if (arr[i].indexOf('<?') !== -1) // <? xml ... ?> //
string += shift[depth] + arr[i];
else if (arr[i].indexOf('xmlns:') > -1 || arr[i].indexOf('xmlns=') > -1) // xmlns //
else if (arr[i].indexOf('xmlns:') !== -1 || arr[i].indexOf('xmlns=') !== -1) // xmlns //
string += shift[depth] + arr[i];

@@ -80,0 +80,0 @@ else

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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