-
-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
code reworks, bitHound fixes, attached eslint
- Loading branch information
Showing
31 changed files
with
12,009 additions
and
5,280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env" | ||
], | ||
"plugins": [ | ||
[ | ||
"@babel/plugin-transform-runtime", | ||
{ | ||
"helpers": false, | ||
"polyfill": false, | ||
"regenerator": true, | ||
"moduleName": "@babel/runtime" | ||
} | ||
] | ||
], | ||
"compact": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,5 +21,5 @@ ratings: | |
- "**.py" | ||
- "**.rb" | ||
exclude_paths: | ||
- spec/ | ||
- lib/**/* | ||
- spec/ | ||
- lib/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module" | ||
}, | ||
"extends": "eslint:recommended", | ||
"env": { | ||
"node": true, | ||
"jasmine": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.xml eol=lf | ||
*.xml eol=lf | ||
*.js eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
# Unrelevant files and folders | ||
benchmark | ||
coverage | ||
test | ||
spec | ||
.travis.yml | ||
.codeclimate.yml | ||
todo | ||
index.html | ||
static/* | ||
.github | ||
lib | ||
.vscode | ||
# Unrelevant files and folders | ||
benchmark | ||
coverage | ||
spec | ||
src/* | ||
!src/read.js | ||
static | ||
.* | ||
index.html | ||
webpack* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,46 @@ | ||
var Benchmark = require('benchmark'); | ||
var suite = new Benchmark.Suite("XML Parser benchmark"); | ||
"use strict"; | ||
|
||
var parser = require("../src/parser"); | ||
var xml2js = require("xml2js"); | ||
const Benchmark = require("benchmark"); | ||
const suite = new Benchmark.Suite("XML Parser benchmark"); | ||
|
||
var fs = require("fs"); | ||
var path = require("path"); | ||
var fileNamePath = path.join(__dirname, "../spec/assets/sample.xml"); | ||
var xmlData = fs.readFileSync(fileNamePath).toString(); | ||
const parser = require("../src/parser"); | ||
//const xml2js = require("xml2js"); | ||
|
||
const fs = require("fs"); | ||
const path = require("path"); | ||
const fileNamePath = path.join(__dirname, "../spec/assets/sample.xml"); | ||
const xmlData = fs.readFileSync(fileNamePath).toString(); | ||
|
||
suite | ||
.add('validate', function() { | ||
parser.validate(xmlData); | ||
}) | ||
.add('parse', function() { | ||
parser.parse(xmlData); | ||
}) | ||
/* .add('xml2js ', function() { | ||
xml2js.parseString(xmlData,function(err,result){ | ||
if (err) throw err; | ||
}); | ||
}) */ | ||
.add("validate", function() { | ||
parser.validate(xmlData); | ||
}) | ||
.add("parse", function() { | ||
parser.parse(xmlData); | ||
}) | ||
/* .add('xml2js ', function() { | ||
xml2js.parseString(xmlData,function(err,result){ | ||
if (err) throw err; | ||
}); | ||
}) */ | ||
|
||
.on('start',function(){ | ||
console.log("Running Suite: " + this.name); | ||
}) | ||
.on('error',function(e){ | ||
console.log("Error in Suite: " + this.name); | ||
}) | ||
.on('abort',function(e){ | ||
console.log("Aborting Suite: " + this.name); | ||
}) | ||
/*.on('cycle',function(event){ | ||
console.log("Suite ID:" + event.target.id); | ||
})*/ | ||
// add listeners | ||
.on('complete', function() { | ||
for (var j = 0; j < this.length; j++) { | ||
console.log(this[j].name + " : " + this[j].hz + " requests/second"); | ||
} | ||
}) | ||
// run async | ||
.run({ 'async': true }); | ||
.on("start", function() { | ||
console.log("Running Suite: " + this.name); | ||
}) | ||
.on("error", function(e) { | ||
console.log("Error in Suite: " + this.name); | ||
}) | ||
.on("abort", function(e) { | ||
console.log("Aborting Suite: " + this.name); | ||
}) | ||
/*.on('cycle',function(event){ | ||
console.log("Suite ID:" + event.target.id); | ||
})*/ | ||
// add listeners | ||
.on("complete", function() { | ||
for (let j = 0; j < this.length; j++) { | ||
console.log(this[j].name + " : " + this[j].hz + " requests/second"); | ||
} | ||
}) | ||
// run async | ||
.run({"async": true}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,66 @@ | ||
var Benchmark = require('benchmark'); | ||
var suite = new Benchmark.Suite("XML Parser benchmark"); | ||
"use strict"; | ||
|
||
var parser = require("../src/parser"); | ||
var xml2js = require("xml2js"); | ||
const Benchmark = require("benchmark"); | ||
const suite = new Benchmark.Suite("XML Parser benchmark"); | ||
|
||
var fs = require("fs"); | ||
var path = require("path"); | ||
//var fileNamePath = path.join(__dirname, "../spec/assets/ptest.xml");//with CDATA | ||
//var fileNamePath = path.join(__dirname, "../spec/assets/ptest_with_prolog.xml");//with CDATA | ||
var fileNamePath = path.join(__dirname, "../spec/assets/sample.xml");//1.5k | ||
//var fileNamePath = path.join(__dirname, "../spec/assets/midsize.xml");//13m | ||
var xmlData = fs.readFileSync(fileNamePath).toString(); | ||
const parser = require("../src/parser"); | ||
const xml2js = require("xml2js"); | ||
|
||
const fs = require("fs"); | ||
const path = require("path"); | ||
//const fileNamePath = path.join(__dirname, "../spec/assets/ptest.xml");//with CDATA | ||
//const fileNamePath = path.join(__dirname, "../spec/assets/ptest_with_prolog.xml");//with CDATA | ||
const fileNamePath = path.join(__dirname, "../spec/assets/sample.xml");//1.5k | ||
//const fileNamePath = path.join(__dirname, "../spec/assets/midsize.xml");//13m | ||
const xmlData = fs.readFileSync(fileNamePath).toString(); | ||
//xmlData=`<root>${xmlData.repeat(1000)}</root>`; | ||
|
||
suite | ||
.add('validation', function() { | ||
var result = parser.validate(xmlData); | ||
}) | ||
.add('xml to json V1', function() { | ||
parser.parse(xmlData); | ||
}) | ||
.add('xml2js ', function() { | ||
xml2js.parseString(xmlData,function(err,result){ | ||
if (err) throw err; | ||
// 2 for sample, 18432 for midsize | ||
//if(2 !== result["any_name"]["person"].length) console.log("incorrect length", result["any_name"]["person"].length); | ||
//if(18432 !== result["any_name"]["person"].length) console.log("incorrect length", result["any_name"]["person"].length); | ||
//if(2 !== result["any_name"]["person"].length) console.log("incorrect length", result["any_name"]["person"].length); | ||
}); | ||
}) | ||
/* .add('xml2js', { | ||
'defer': true, | ||
'fn' : function(deferred) { | ||
xml2js.parseString(xmlData,function(err,result){ | ||
console.log("err", err); | ||
if (err) throw err; | ||
deferred.resolve(); | ||
}); | ||
} | ||
}) */ | ||
.add("validation", function() { | ||
parser.validate(xmlData); | ||
}) | ||
.add("xml to json V1", function() { | ||
parser.parse(xmlData); | ||
}) | ||
.add("xml2js ", function() { | ||
xml2js.parseString(xmlData, function(err, result) { | ||
if (err) { | ||
throw err; | ||
} | ||
// 2 for sample, 18432 for midsize | ||
//if(2 !== result["any_name"]["person"].length) console.log("incorrect length", result["any_name"]["person"].length); | ||
//if(18432 !== result["any_name"]["person"].length) console.log("incorrect length", result["any_name"]["person"].length); | ||
//if(2 !== result["any_name"]["person"].length) console.log("incorrect length", result["any_name"]["person"].length); | ||
}); | ||
}) | ||
/* .add('xml2js', { | ||
'defer': true, | ||
'fn' : function(deferred) { | ||
xml2js.parseString(xmlData,function(err,result){ | ||
console.log("err", err); | ||
if (err) throw err; | ||
deferred.resolve(); | ||
}); | ||
} | ||
}) */ | ||
|
||
.on('start',function(){ | ||
console.log("Running Suite: " + this.name); | ||
}) | ||
.on('error',function(e){ | ||
console.log("Error in Suite: ",e); | ||
}) | ||
.on('abort',function(e){ | ||
console.log("Aborting Suite: " + this.name); | ||
}) | ||
/*.on('cycle',function(event){ | ||
console.log("Suite ID:" + event.target.id); | ||
})*/ | ||
// add listeners | ||
.on('complete', function() { | ||
for (var j = 0; j < this.length; j++) { | ||
console.log(this[j].name + " : " + this[j].hz + " requests/second"); | ||
} | ||
}) | ||
// run async | ||
.run({ 'async': true }); | ||
.on("start", function() { | ||
console.log("Running Suite: " + this.name); | ||
}) | ||
.on("error", function(e) { | ||
console.log("Error in Suite: ", e); | ||
}) | ||
.on("abort", function(e) { | ||
console.log("Aborting Suite: " + this.name); | ||
}) | ||
/*.on('cycle',function(event){ | ||
console.log("Suite ID:" + event.target.id); | ||
})*/ | ||
// add listeners | ||
.on("complete", function() { | ||
for (let j = 0; j < this.length; j++) { | ||
console.log(this[j].name + " : " + this[j].hz + " requests/second"); | ||
} | ||
}) | ||
// run async | ||
.run({'async': true}); |
Oops, something went wrong.