Socket
Socket
Sign inDemoInstall

xml-but-prettier

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

8

dist/index.js

@@ -65,4 +65,8 @@ 'use strict';

return rawResult.filter(function (val, i) {
return indicesToRemove.indexOf(i) === -1;
indicesToRemove.forEach(function (idx) {
return rawResult[idx] = null;
});
return rawResult.filter(function (val) {
return !!val;
}).join('\n');

@@ -69,0 +73,0 @@ };

{
"name": "xml-but-prettier",
"version": "1.0.0",
"version": "1.0.1",
"title": "XML Beautifier",

@@ -5,0 +5,0 @@ "description": "Beautifies XML documents by putting each tag and text node on their own line and correctly indents everything",

@@ -32,3 +32,3 @@ # XML, But Prettier

#### Options
- `indentor`: a custom string to divide lines by
- `indentor`: a custom string to use for indenting things
- `textNodesOnSameLine`: compresses text nodes onto the same line as their containing tags

@@ -35,0 +35,0 @@

@@ -45,4 +45,6 @@ 'use strict';

indicesToRemove.forEach(idx => rawResult[idx] = null)
return rawResult
.filter((val, i) => indicesToRemove.indexOf(i) === -1)
.filter(val => !!val)
.join('\n')

@@ -49,0 +51,0 @@ };

@@ -83,2 +83,12 @@ const beautify = require('../src/index');

const endTime = Date.now()
expect(endTime - startTime).toBeLessThan(2500)
})
it("should process 2MB of XML quickly with `textNodesOnSameLine`", () => {
const xml = fs.readFileSync(__dirname + '/huge.xml', 'utf8')
const startTime = Date.now()
beautify(xml, {
textNodesOnSameLine: true
})
const endTime = Date.now()
expect(endTime - startTime).toBeLessThan(5000)

@@ -85,0 +95,0 @@ })

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc