├── .editorconfig
├── .gitignore
├── .npmignore
├── .travis.yml
├── AUTHORS
├── README.md
├── bin
└── xml2json
├── example.js
├── index.js
├── lib
├── index.js
├── json2xml.js
├── sanitize.js
└── xml2json.js
├── package-lock.json
├── package.json
└── test
├── .gitignore
├── coerce-overhead.js
├── fixtures
├── alternate-text-node-A.json
├── alternate-text-node-A.xml
├── alternate-text-node-B.json
├── alternate-text-node-C.json
├── alternate-text-node-D.json
├── alternate-text-node-D.xml
├── array-notation.json
├── array-notation.xml
├── coerce.json
├── coerce.xml
├── domain-reversible.json
├── domain.json
├── domain.xml
├── forceArray.json
├── forceArray.xml
├── large.json
├── large.xml
├── null-properties-ignored.xml
├── null-properties-not-ignored.xml
├── null-properties.json
├── reorder.json
├── reorder.xml
├── spacetext.json
├── spacetext.xml
├── xmlsanitize.json
├── xmlsanitize.xml
├── xmlsanitize2.json
├── xmlsanitize2.xml
├── xmlsanitize3.json
└── xmlsanitize3.xml
├── test-reorder.js
├── test-space.js
├── test-xmlsanitize.js
└── test.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | ; Unix-style newlines with a newline ending every file
4 | [*]
5 | end_of_line = lf
6 | insert_final_newline = true
7 | charset = utf-8
8 |
9 | ; JS
10 | [*.js]
11 | indent_style = space
12 | indent_size = 4
13 | trim_trailing_whitespace = true
14 | insert_final_newline = true
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | *.swp
3 | *.DS_Store
4 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: required
2 | language: node_js
3 | env:
4 | - CXX="g++-4.8"
5 |
6 | node_js:
7 | - "10"
8 | - "9"
9 | - "8"
10 |
11 | addons:
12 | apt:
13 | sources:
14 | - ubuntu-toolchain-r-test
15 | packages:
16 | - g++-4.8
17 | - gcc-4.8
18 |
19 | before_install:
20 | # npm shipped with Node.js 0.8 doesn't support carret so let's update it
21 | - if [ "$TRAVIS_NODE_VERSION" == "0.8" ]; then npm install -g npm; fi
22 |
--------------------------------------------------------------------------------
/AUTHORS:
--------------------------------------------------------------------------------
1 | Arek W arek01@gmail.com
2 | Camilo Aguilar camilo.aguilar@gmail.com
3 | Craig Condon craig@spiceapps.com
4 | Daniel Bretoi daniel@bretoi.com
5 | Daniel Juhl danieljuhl@gmail.com
6 | Dmitry Fink github@finik.net
7 | Garvit Sharma garvits45@gmail.com
8 | Julian Duque julianduquej@gmail.com
9 | Karl Böhlmark karl.bohlmark@edgeware.tv
10 | Kevin McTigue firefoxman1@gmail.com
11 | Kirill Vergun github.com@o-nix.me
12 | Maher Beg maherbeg@gmail.com
13 | Nicholas Kinsey pyrotechnick@feistystudios.com
14 | Rob Brackett rob@robbrackett.com
15 | Subbu Allamaraju subbu@ebaysf.com
16 | The Gitter Badger badger@gitter.im
17 | Trotter Cashion cashion@gmail.com
18 | Yan idy0013@gmail.com
19 | Ziggy Jonsson ziggy.jonsson.nyc@gmail.com
20 | andres suarez zertosh@gmail.com
21 | andris9 andris@node.ee
22 | fengmk2 fengmk2@gmail.com
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Simple XML2JSON Parser
2 | [](https://gitter.im/buglabs/node-xml2json?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
3 | [](https://travis-ci.org/buglabs/node-xml2json)
4 |
5 | It does not parse the following elements:
6 |
7 | * CDATA sections (*)
8 | * Processing instructions
9 | * XML declarations
10 | * Entity declarations
11 | * Comments
12 |
13 | This module uses node-expat which will require extra steps if you want to get it installed on Windows. Please
14 | refer to its [documentation](https://github.com/astro/node-expat/blob/master/README.md#windows).
15 |
16 | ## Installation
17 | ```
18 | $ npm install xml2json
19 | ```
20 |
21 | ## Usage
22 | ```javascript
23 | var parser = require('xml2json');
24 |
25 | var xml = "bar";
26 | console.log("input -> %s", xml)
27 |
28 | // xml to json
29 | var json = parser.toJson(xml);
30 | console.log("to json -> %s", json);
31 |
32 | // json to xml
33 | var xml = parser.toXml(json);
34 | console.log("back to xml -> %s", xml)
35 | ```
36 |
37 | ## API
38 |
39 | ```javascript
40 | parser.toJson(xml, options);
41 | ```
42 | ```javascript
43 | parser.toXml(json);
44 | ```
45 |
46 | ### Options object for `toJson`
47 |
48 | Default values:
49 | ```javascript
50 | var options = {
51 | object: false,
52 | reversible: false,
53 | coerce: false,
54 | sanitize: true,
55 | trim: true,
56 | arrayNotation: false
57 | alternateTextNode: false
58 | };
59 | ```
60 |
61 | * **object:** Returns a Javascript object instead of a JSON string
62 | * **reversible:** Makes the JSON reversible to XML (*)
63 | * **coerce:** Makes type coercion. i.e.: numbers and booleans present in attributes and element values are converted from string to its correspondent data types. Coerce can be optionally defined as an object with specific methods of coercion based on attribute name or tag name, with fallback to default coercion.
64 | * **trim:** Removes leading and trailing whitespaces as well as line terminators in element values.
65 | * **arrayNotation:** XML child nodes are always treated as arrays NB: you can specify a selective array of nodes for this to apply to instead of the whole document.
66 | * **sanitize:** Sanitizes the following characters present in element values:
67 |
68 | ```javascript
69 | var chars = {
70 | '<': '<',
71 | '>': '>',
72 | '(': '(',
73 | ')': ')',
74 | '#': '#',
75 | '&': '&',
76 | '"': '"',
77 | "'": '''
78 | };
79 | ```
80 | * **alternateTextNode:** Changes the default textNode property from $t to _t when option is set to true. Alternatively a string can be specified which will override $t to what ever the string is.
81 |
82 |
83 | ### Options object for `toXml`
84 |
85 | Default values:
86 | ```javascript
87 | var options = {
88 | sanitize: false,
89 | ignoreNull: false
90 | };
91 | ```
92 |
93 | * `sanitize: false` is the default option to behave like previous versions
94 | * **ignoreNull:** Ignores all null values
95 |
96 |
97 | (*) xml2json tranforms CDATA content to JSON, but it doesn't generate a reversible structure.
98 |
99 | ## License
100 | (The MIT License)
101 |
102 | Copyright (c) 2016 xml2json AUTHORS
103 |
104 | Permission is hereby granted, free of charge, to any person obtaining a copy
105 | of this software and associated documentation files (the "Software"), to
106 | deal in the Software without restriction, including without limitation the
107 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
108 | sell copies of the Software, and to permit persons to whom the Software is
109 | furnished to do so, subject to the following conditions:
110 |
111 | The above copyright notice and this permission notice shall be included in
112 | all copies or substantial portions of the Software.
113 |
114 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
115 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
116 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
117 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
118 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
119 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
120 | IN THE SOFTWARE.
121 |
--------------------------------------------------------------------------------
/bin/xml2json:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | var xml2json = require('../');
4 | var pkg = require('../package.json');
5 |
6 | var xml = '';
7 |
8 | var args = process.argv.slice(2)
9 | var arg = args[0]
10 |
11 | if (arg == '--version') {
12 | console.log(pkg.version)
13 | process.exit(0)
14 | }
15 |
16 | process.stdin.on('data', function (data) {
17 | xml += data;
18 | });
19 |
20 | process.stdin.resume();
21 |
22 | process.stdin.on('end', function () {
23 | json = xml2json.toJson(xml)
24 | process.stdout.write(json + '\n')
25 | });
26 |
27 |
--------------------------------------------------------------------------------
/example.js:
--------------------------------------------------------------------------------
1 | var parser = require('./index');
2 |
3 | // xml to json
4 | var xml = "bar";
5 | console.log("input -> %s", xml)
6 | var json = parser.toJson(xml);
7 | console.log("to json -> %s", json);
8 |
9 | var xml = parser.toXml(json);
10 | console.log("back to xml -> %s", xml)
11 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./lib');
2 |
--------------------------------------------------------------------------------
/lib/index.js:
--------------------------------------------------------------------------------
1 | var exports = module.exports;
2 |
3 | exports.toJson = require('./xml2json');
4 | exports.toXml = require('./json2xml');
5 |
--------------------------------------------------------------------------------
/lib/json2xml.js:
--------------------------------------------------------------------------------
1 | var sanitizer = require('./sanitize.js')
2 |
3 | module.exports = function (json, options) {
4 | if (json instanceof Buffer) {
5 | json = json.toString();
6 | }
7 |
8 | var obj = null;
9 | if (typeof(json) == 'string') {
10 | try {
11 | obj = JSON.parse(json);
12 | } catch(e) {
13 | throw new Error("The JSON structure is invalid");
14 | }
15 | } else {
16 | obj = json;
17 | }
18 | var toXml = new ToXml(options);
19 | toXml.parse(obj);
20 | return toXml.xml;
21 | }
22 |
23 | ToXml.prototype.parse = function(obj) {
24 | if (!obj) return;
25 |
26 | var self = this;
27 | var keys = Object.keys(obj);
28 | var len = keys.length;
29 |
30 | // First pass, extract strings only
31 | for (var i = 0; i < len; i++) {
32 | var key = keys[i], value = obj[key], isArray = Array.isArray(value);
33 | var type = typeof(value);
34 | if (type == 'string' || type == 'number' || type == 'boolean' || isArray) {
35 | var it = isArray ? value : [value];
36 |
37 | it.forEach(function(subVal) {
38 | if (typeof(subVal) != 'object') {
39 | if (key == '$t') {
40 | self.addTextContent(subVal);
41 | } else {
42 | self.addAttr(key, subVal);
43 | }
44 | }
45 | });
46 | }
47 | }
48 |
49 | // Second path, now handle sub-objects and arrays
50 | for (var i = 0; i < len; i++) {
51 | var key = keys[i];
52 |
53 | if (Array.isArray(obj[key])) {
54 | var elems = obj[key];
55 | var l = elems.length;
56 | for (var j = 0; j < l; j++) {
57 | var elem = elems[j];
58 |
59 | if (typeof(elem) == 'object') {
60 | self.openTag(key);
61 | self.parse(elem);
62 | self.closeTag(key);
63 | }
64 | }
65 | } else if (typeof(obj[key]) == 'object' && !(self.options.ignoreNull && obj[key] === null)) {
66 | self.openTag(key);
67 | self.parse(obj[key]);
68 | self.closeTag(key);
69 | }
70 | }
71 |
72 | };
73 |
74 | ToXml.prototype.openTag = function(key) {
75 | this.completeTag();
76 | this.xml += '<' + key;
77 | this.tagIncomplete = true;
78 | }
79 | ToXml.prototype.addAttr = function(key, val) {
80 | if (this.options.sanitize) {
81 | val = sanitizer.sanitize(val, false, true);
82 | }
83 | this.xml += ' ' + key + '="' + val + '"';
84 | }
85 | ToXml.prototype.addTextContent = function(text) {
86 | this.completeTag();
87 | var newText = (this.options.sanitize ? sanitizer.sanitize(text) : text);
88 | this.xml += newText;
89 | }
90 | ToXml.prototype.closeTag = function(key) {
91 | this.completeTag();
92 | this.xml += '' + key + '>';
93 | }
94 | ToXml.prototype.completeTag = function() {
95 | if (this.tagIncomplete) {
96 | this.xml += '>';
97 | this.tagIncomplete = false;
98 | }
99 | }
100 | function ToXml(options) {
101 | var defaultOpts = {
102 | sanitize: false,
103 | ignoreNull: false
104 | };
105 |
106 | if (options) {
107 | for (var opt in options) {
108 | defaultOpts[opt] = options[opt];
109 | }
110 | }
111 |
112 | this.options = defaultOpts;
113 | this.xml = '';
114 | this.tagIncomplete = false;
115 | }
116 |
--------------------------------------------------------------------------------
/lib/sanitize.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Simple sanitization. It is not intended to sanitize
3 | * malicious element values.
4 | *
5 | * character | escaped
6 | * < <
7 | * > >
8 | * ( (
9 | * ) )
10 | * # #
11 | * & &
12 | * " "
13 | * ' '
14 | */
15 | // used for body text
16 | var charsEscape = {
17 | '&': '&',
18 | '<': '<',
19 | '>': '>'
20 | };
21 |
22 | var charsUnescape = {
23 | '&': '&',
24 | '#': '#',
25 | '<': '<',
26 | '>': '>',
27 | '(': '(',
28 | ')': ')',
29 | '"': '"',
30 | ''': "'",
31 | "": "\u001F"
32 | };
33 |
34 | // used in attribute values
35 | var charsAttrEscape = {
36 | '&': '&',
37 | '<': '<',
38 | '>': '>',
39 | '"': '"',
40 | "'": '''
41 | };
42 |
43 | function escapeRegExp(string) {
44 | return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
45 | }
46 |
47 | // sanitize body text
48 | exports.sanitize = function sanitize(value, reverse, attribute) {
49 | if (typeof value !== 'string') {
50 | return value;
51 | }
52 |
53 | var chars = reverse ? charsUnescape : (attribute ? charsAttrEscape : charsEscape);
54 | var keys = Object.keys(chars);
55 |
56 | keys.forEach(function(key) {
57 | value = value.replace(new RegExp(escapeRegExp(key), 'g'), chars[key]);
58 | });
59 |
60 | return value;
61 | };
62 |
--------------------------------------------------------------------------------
/lib/xml2json.js:
--------------------------------------------------------------------------------
1 | var expat = require('node-expat');
2 | var sanitizer = require('./sanitize.js')
3 | var joi = require('joi');
4 | var hoek = require('hoek');
5 |
6 | // This object will hold the final result.
7 | var obj = {};
8 | var currentObject = {};
9 | var ancestors = [];
10 | var currentElementName = null;
11 |
12 | var options = {}; //configuration options
13 | function startElement(name, attrs) {
14 | currentElementName = name;
15 | if(options.coerce) {
16 | // Looping here in stead of making coerce generic as object walk is unnecessary
17 | for(var key in attrs) {
18 | attrs[key] = coerce(attrs[key],key);
19 | }
20 | }
21 |
22 | if (! (name in currentObject)) {
23 | if(options.arrayNotation || options.forceArrays[name]) {
24 | currentObject[name] = [attrs];
25 | } else {
26 | currentObject[name] = attrs;
27 | }
28 | } else if (! (currentObject[name] instanceof Array)) {
29 | // Put the existing object in an array.
30 | var newArray = [currentObject[name]];
31 | // Add the new object to the array.
32 | newArray.push(attrs);
33 | // Point to the new array.
34 | currentObject[name] = newArray;
35 | } else {
36 | // An array already exists, push the attributes on to it.
37 | currentObject[name].push(attrs);
38 | }
39 |
40 | // Store the current (old) parent.
41 | ancestors.push(currentObject);
42 |
43 | // We are now working with this object, so it becomes the current parent.
44 | if (currentObject[name] instanceof Array) {
45 | // If it is an array, get the last element of the array.
46 | currentObject = currentObject[name][currentObject[name].length - 1];
47 | } else {
48 | // Otherwise, use the object itself.
49 | currentObject = currentObject[name];
50 | }
51 | }
52 |
53 | function text(data) {
54 | currentObject[textNodeName()] = (currentObject[textNodeName()] || '') + data;
55 | }
56 |
57 | function endElement(name) {
58 | if (currentObject[textNodeName()]) {
59 | if (options.trim) {
60 | currentObject[textNodeName()] = currentObject[textNodeName()].trim()
61 | }
62 |
63 | // node-expat already reverse sanitizes it whether we like it or not
64 | //if (options.sanitize) {
65 | // currentObject[textNodeName()] = sanitizer.sanitize(currentObject[textNodeName()], true);
66 | //}
67 |
68 | currentObject[textNodeName()] = coerce(currentObject[textNodeName()],name);
69 | }
70 |
71 | if (currentElementName !== name) {
72 | delete currentObject[textNodeName()];
73 | }
74 | // This should check to make sure that the name we're ending
75 | // matches the name we started on.
76 | var ancestor = ancestors.pop();
77 | if (!options.reversible) {
78 | if ((textNodeName() in currentObject) && (Object.keys(currentObject).length == 1)) {
79 | if (ancestor[name] instanceof Array) {
80 | ancestor[name].push(ancestor[name].pop()[textNodeName()]);
81 | } else {
82 | ancestor[name] = currentObject[textNodeName()];
83 | }
84 | }
85 | }
86 |
87 | currentObject = ancestor;
88 | }
89 |
90 | function coerce(value,key) {
91 | if (!options.coerce || value.trim() === '') {
92 | return value;
93 | }
94 |
95 | if (typeof options.coerce[key] === 'function')
96 | return options.coerce[key](value);
97 |
98 | var num = Number(value);
99 | if (!isNaN(num)) {
100 | return num;
101 | }
102 |
103 | var _value = value.toLowerCase();
104 |
105 | if (_value == 'true') {
106 | return true;
107 | }
108 |
109 | if (_value == 'false') {
110 | return false;
111 | }
112 |
113 | return value;
114 | }
115 |
116 | function textNodeName() {
117 | return options.alternateTextNode ? typeof options.alternateTextNode === 'string' ? options.alternateTextNode : '_t' : '$t'
118 | }
119 |
120 |
121 | /**
122 | * Parses xml to json using node-expat.
123 | * @param {String|Buffer} xml The xml to be parsed to json.
124 | * @param {Object} _options An object with options provided by the user.
125 | * The available options are:
126 | * - object: If true, the parser returns a Javascript object instead of
127 | * a JSON string.
128 | * - reversible: If true, the parser generates a reversible JSON, mainly
129 | * characterized by the presence of the property $t.
130 | * - sanitize_values: If true, the parser escapes any element value in the xml
131 | * that has any of the following characters: <, >, (, ), #, #, &, ", '.
132 | * - alternateTextNode (boolean OR string):
133 | * If false or not specified: default of $t is used
134 | * If true, whenever $t is returned as an end point, is is substituted with _t
135 | * it String, whenever $t is returned as an end point, is is substituted with the String value (care advised)
136 | *
137 | * @return {String|Object} A String or an Object with the JSON representation
138 | * of the XML.
139 | */
140 | module.exports = function(xml, _options) {
141 |
142 | _options = _options || {};
143 | var parser = new expat.Parser('UTF-8');
144 |
145 | parser.on('startElement', startElement);
146 | parser.on('text', text);
147 | parser.on('endElement', endElement);
148 |
149 | obj = currentObject = {};
150 | ancestors = [];
151 | currentElementName = null;
152 |
153 | var schema = {
154 | object: joi.boolean().default(false),
155 | reversible: joi.boolean().default(false),
156 | coerce: joi.alternatives([joi.boolean(), joi.object()]).default(false),
157 | sanitize: joi.boolean().default(true),
158 | trim: joi.boolean().default(true),
159 | arrayNotation: joi.alternatives([joi.boolean(), joi.array()]).default(false),
160 | alternateTextNode: [joi.boolean().default(false), joi.string().default(false)]
161 | };
162 | var validation = joi.validate(_options, schema);
163 | hoek.assert(validation.error === null, validation.error);
164 | options = validation.value;
165 | options.forceArrays = {};
166 | if (Array.isArray(options.arrayNotation)) {
167 | options.arrayNotation.forEach(function(i) {
168 | options.forceArrays[i] = true;
169 | });
170 | options.arrayNotation = false;
171 | }
172 | if (!parser.parse(xml)) {
173 | throw new Error('There are errors in your xml file: ' + parser.getError());
174 | }
175 |
176 | if (options.object) {
177 | return obj;
178 | }
179 |
180 | var json = JSON.stringify(obj);
181 |
182 | //See: http://timelessrepo.com/json-isnt-a-javascript-subset
183 | json = json.replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029');
184 |
185 | return json;
186 | };
187 |
--------------------------------------------------------------------------------
/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "xml2json",
3 | "version": "0.11.3",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "@babel/code-frame": {
8 | "version": "7.0.0",
9 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz",
10 | "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==",
11 | "dev": true,
12 | "requires": {
13 | "@babel/highlight": "^7.0.0"
14 | }
15 | },
16 | "@babel/highlight": {
17 | "version": "7.0.0",
18 | "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz",
19 | "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==",
20 | "dev": true,
21 | "requires": {
22 | "chalk": "^2.0.0",
23 | "esutils": "^2.0.2",
24 | "js-tokens": "^4.0.0"
25 | }
26 | },
27 | "acorn": {
28 | "version": "6.1.1",
29 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz",
30 | "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==",
31 | "dev": true
32 | },
33 | "acorn-jsx": {
34 | "version": "5.0.1",
35 | "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz",
36 | "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==",
37 | "dev": true
38 | },
39 | "ajv": {
40 | "version": "6.10.0",
41 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz",
42 | "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==",
43 | "dev": true,
44 | "requires": {
45 | "fast-deep-equal": "^2.0.1",
46 | "fast-json-stable-stringify": "^2.0.0",
47 | "json-schema-traverse": "^0.4.1",
48 | "uri-js": "^4.2.2"
49 | }
50 | },
51 | "ansi-escapes": {
52 | "version": "3.2.0",
53 | "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz",
54 | "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==",
55 | "dev": true
56 | },
57 | "ansi-regex": {
58 | "version": "3.0.0",
59 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
60 | "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
61 | "dev": true
62 | },
63 | "ansi-styles": {
64 | "version": "3.2.1",
65 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
66 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
67 | "dev": true,
68 | "requires": {
69 | "color-convert": "^1.9.0"
70 | }
71 | },
72 | "argparse": {
73 | "version": "1.0.10",
74 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
75 | "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
76 | "dev": true,
77 | "requires": {
78 | "sprintf-js": "~1.0.2"
79 | }
80 | },
81 | "astral-regex": {
82 | "version": "1.0.0",
83 | "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz",
84 | "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==",
85 | "dev": true
86 | },
87 | "balanced-match": {
88 | "version": "1.0.0",
89 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
90 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
91 | "dev": true
92 | },
93 | "bindings": {
94 | "version": "1.5.0",
95 | "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
96 | "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
97 | "requires": {
98 | "file-uri-to-path": "1.0.0"
99 | }
100 | },
101 | "boom": {
102 | "version": "7.3.0",
103 | "resolved": "https://registry.npmjs.org/boom/-/boom-7.3.0.tgz",
104 | "integrity": "sha512-Swpoyi2t5+GhOEGw8rEsKvTxFLIDiiKoUc2gsoV6Lyr43LHBIzch3k2MvYUs8RTROrIkVJ3Al0TkaOGjnb+B6A==",
105 | "dev": true,
106 | "requires": {
107 | "hoek": "6.x.x"
108 | },
109 | "dependencies": {
110 | "hoek": {
111 | "version": "6.1.3",
112 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz",
113 | "integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ==",
114 | "dev": true
115 | }
116 | }
117 | },
118 | "bossy": {
119 | "version": "4.0.3",
120 | "resolved": "https://registry.npmjs.org/bossy/-/bossy-4.0.3.tgz",
121 | "integrity": "sha512-2Hr2cgtwNi/BWIxwvrr3UbwczPV8gqoHUS8Wzuawo+StFNHDlj/7HGlETh1LX6SqMauBCU8lb+lLBuIFpBNuTA==",
122 | "dev": true,
123 | "requires": {
124 | "boom": "7.x.x",
125 | "hoek": "6.x.x",
126 | "joi": "14.x.x"
127 | },
128 | "dependencies": {
129 | "hoek": {
130 | "version": "6.1.3",
131 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz",
132 | "integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ==",
133 | "dev": true
134 | },
135 | "joi": {
136 | "version": "14.3.1",
137 | "resolved": "https://registry.npmjs.org/joi/-/joi-14.3.1.tgz",
138 | "integrity": "sha512-LQDdM+pkOrpAn4Lp+neNIFV3axv1Vna3j38bisbQhETPMANYRbFJFUyOZcOClYvM/hppMhGWuKSFEK9vjrB+bQ==",
139 | "dev": true,
140 | "requires": {
141 | "hoek": "6.x.x",
142 | "isemail": "3.x.x",
143 | "topo": "3.x.x"
144 | }
145 | }
146 | }
147 | },
148 | "brace-expansion": {
149 | "version": "1.1.11",
150 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
151 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
152 | "dev": true,
153 | "requires": {
154 | "balanced-match": "^1.0.0",
155 | "concat-map": "0.0.1"
156 | }
157 | },
158 | "buffer-from": {
159 | "version": "1.1.1",
160 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
161 | "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
162 | "dev": true
163 | },
164 | "callsites": {
165 | "version": "3.1.0",
166 | "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
167 | "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
168 | "dev": true
169 | },
170 | "chalk": {
171 | "version": "2.4.2",
172 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
173 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
174 | "dev": true,
175 | "requires": {
176 | "ansi-styles": "^3.2.1",
177 | "escape-string-regexp": "^1.0.5",
178 | "supports-color": "^5.3.0"
179 | },
180 | "dependencies": {
181 | "supports-color": {
182 | "version": "5.5.0",
183 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
184 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
185 | "dev": true,
186 | "requires": {
187 | "has-flag": "^3.0.0"
188 | }
189 | }
190 | }
191 | },
192 | "chardet": {
193 | "version": "0.7.0",
194 | "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz",
195 | "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==",
196 | "dev": true
197 | },
198 | "cli-cursor": {
199 | "version": "2.1.0",
200 | "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
201 | "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=",
202 | "dev": true,
203 | "requires": {
204 | "restore-cursor": "^2.0.0"
205 | }
206 | },
207 | "cli-width": {
208 | "version": "2.2.0",
209 | "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz",
210 | "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=",
211 | "dev": true
212 | },
213 | "code": {
214 | "version": "3.0.2",
215 | "resolved": "https://registry.npmjs.org/code/-/code-3.0.2.tgz",
216 | "integrity": "sha1-cyZccBWdvOKwI8j7aGPnt2cEpPw=",
217 | "dev": true,
218 | "requires": {
219 | "hoek": "4.x.x"
220 | }
221 | },
222 | "color-convert": {
223 | "version": "1.9.3",
224 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
225 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
226 | "dev": true,
227 | "requires": {
228 | "color-name": "1.1.3"
229 | }
230 | },
231 | "color-name": {
232 | "version": "1.1.3",
233 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
234 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
235 | "dev": true
236 | },
237 | "commander": {
238 | "version": "2.20.0",
239 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz",
240 | "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==",
241 | "dev": true,
242 | "optional": true
243 | },
244 | "concat-map": {
245 | "version": "0.0.1",
246 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
247 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
248 | "dev": true
249 | },
250 | "cross-spawn": {
251 | "version": "6.0.5",
252 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
253 | "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
254 | "dev": true,
255 | "requires": {
256 | "nice-try": "^1.0.4",
257 | "path-key": "^2.0.1",
258 | "semver": "^5.5.0",
259 | "shebang-command": "^1.2.0",
260 | "which": "^1.2.9"
261 | }
262 | },
263 | "debug": {
264 | "version": "4.1.1",
265 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
266 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
267 | "dev": true,
268 | "requires": {
269 | "ms": "^2.1.1"
270 | }
271 | },
272 | "deep-is": {
273 | "version": "0.1.3",
274 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
275 | "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
276 | "dev": true
277 | },
278 | "diff": {
279 | "version": "4.0.1",
280 | "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
281 | "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
282 | "dev": true
283 | },
284 | "doctrine": {
285 | "version": "3.0.0",
286 | "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
287 | "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
288 | "dev": true,
289 | "requires": {
290 | "esutils": "^2.0.2"
291 | }
292 | },
293 | "emoji-regex": {
294 | "version": "7.0.3",
295 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
296 | "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
297 | "dev": true
298 | },
299 | "escape-string-regexp": {
300 | "version": "1.0.5",
301 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
302 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
303 | "dev": true
304 | },
305 | "eslint": {
306 | "version": "5.16.0",
307 | "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz",
308 | "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==",
309 | "dev": true,
310 | "requires": {
311 | "@babel/code-frame": "^7.0.0",
312 | "ajv": "^6.9.1",
313 | "chalk": "^2.1.0",
314 | "cross-spawn": "^6.0.5",
315 | "debug": "^4.0.1",
316 | "doctrine": "^3.0.0",
317 | "eslint-scope": "^4.0.3",
318 | "eslint-utils": "^1.3.1",
319 | "eslint-visitor-keys": "^1.0.0",
320 | "espree": "^5.0.1",
321 | "esquery": "^1.0.1",
322 | "esutils": "^2.0.2",
323 | "file-entry-cache": "^5.0.1",
324 | "functional-red-black-tree": "^1.0.1",
325 | "glob": "^7.1.2",
326 | "globals": "^11.7.0",
327 | "ignore": "^4.0.6",
328 | "import-fresh": "^3.0.0",
329 | "imurmurhash": "^0.1.4",
330 | "inquirer": "^6.2.2",
331 | "js-yaml": "^3.13.0",
332 | "json-stable-stringify-without-jsonify": "^1.0.1",
333 | "levn": "^0.3.0",
334 | "lodash": "^4.17.11",
335 | "minimatch": "^3.0.4",
336 | "mkdirp": "^0.5.1",
337 | "natural-compare": "^1.4.0",
338 | "optionator": "^0.8.2",
339 | "path-is-inside": "^1.0.2",
340 | "progress": "^2.0.0",
341 | "regexpp": "^2.0.1",
342 | "semver": "^5.5.1",
343 | "strip-ansi": "^4.0.0",
344 | "strip-json-comments": "^2.0.1",
345 | "table": "^5.2.3",
346 | "text-table": "^0.2.0"
347 | }
348 | },
349 | "eslint-config-hapi": {
350 | "version": "12.0.0",
351 | "resolved": "https://registry.npmjs.org/eslint-config-hapi/-/eslint-config-hapi-12.0.0.tgz",
352 | "integrity": "sha512-vHjuIIgbjsBU9y4SLAvxzrP38em32tlmzEJPMRZn2QR2id4bHettmFZdobx5k6P3j25Q9+hPfm0VT+zWDsIEWw==",
353 | "dev": true
354 | },
355 | "eslint-plugin-hapi": {
356 | "version": "4.1.0",
357 | "resolved": "https://registry.npmjs.org/eslint-plugin-hapi/-/eslint-plugin-hapi-4.1.0.tgz",
358 | "integrity": "sha512-z1yUoSWArx6pXaC0FoWRFpqjbHn8QWonJiTVhJmiC14jOAT7FZKdKWCkhM4jQrgrkEK9YEv3p2HuzSf5dtWmuQ==",
359 | "dev": true,
360 | "requires": {
361 | "hapi-capitalize-modules": "1.x.x",
362 | "hapi-for-you": "1.x.x",
363 | "hapi-no-var": "1.x.x",
364 | "hapi-scope-start": "2.x.x",
365 | "no-arrowception": "1.x.x"
366 | }
367 | },
368 | "eslint-scope": {
369 | "version": "4.0.3",
370 | "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz",
371 | "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==",
372 | "dev": true,
373 | "requires": {
374 | "esrecurse": "^4.1.0",
375 | "estraverse": "^4.1.1"
376 | }
377 | },
378 | "eslint-utils": {
379 | "version": "1.3.1",
380 | "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz",
381 | "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==",
382 | "dev": true
383 | },
384 | "eslint-visitor-keys": {
385 | "version": "1.0.0",
386 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
387 | "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==",
388 | "dev": true
389 | },
390 | "espree": {
391 | "version": "5.0.1",
392 | "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz",
393 | "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==",
394 | "dev": true,
395 | "requires": {
396 | "acorn": "^6.0.7",
397 | "acorn-jsx": "^5.0.0",
398 | "eslint-visitor-keys": "^1.0.0"
399 | }
400 | },
401 | "esprima": {
402 | "version": "4.0.1",
403 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
404 | "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
405 | "dev": true
406 | },
407 | "esquery": {
408 | "version": "1.0.1",
409 | "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz",
410 | "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==",
411 | "dev": true,
412 | "requires": {
413 | "estraverse": "^4.0.0"
414 | }
415 | },
416 | "esrecurse": {
417 | "version": "4.2.1",
418 | "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz",
419 | "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==",
420 | "dev": true,
421 | "requires": {
422 | "estraverse": "^4.1.0"
423 | }
424 | },
425 | "estraverse": {
426 | "version": "4.2.0",
427 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
428 | "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=",
429 | "dev": true
430 | },
431 | "esutils": {
432 | "version": "2.0.2",
433 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
434 | "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
435 | "dev": true
436 | },
437 | "external-editor": {
438 | "version": "3.0.3",
439 | "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz",
440 | "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==",
441 | "dev": true,
442 | "requires": {
443 | "chardet": "^0.7.0",
444 | "iconv-lite": "^0.4.24",
445 | "tmp": "^0.0.33"
446 | }
447 | },
448 | "fast-deep-equal": {
449 | "version": "2.0.1",
450 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
451 | "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
452 | "dev": true
453 | },
454 | "fast-json-stable-stringify": {
455 | "version": "2.0.0",
456 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
457 | "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=",
458 | "dev": true
459 | },
460 | "fast-levenshtein": {
461 | "version": "2.0.6",
462 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
463 | "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
464 | "dev": true
465 | },
466 | "figures": {
467 | "version": "2.0.0",
468 | "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
469 | "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
470 | "dev": true,
471 | "requires": {
472 | "escape-string-regexp": "^1.0.5"
473 | }
474 | },
475 | "file-entry-cache": {
476 | "version": "5.0.1",
477 | "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz",
478 | "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==",
479 | "dev": true,
480 | "requires": {
481 | "flat-cache": "^2.0.1"
482 | }
483 | },
484 | "file-uri-to-path": {
485 | "version": "1.0.0",
486 | "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
487 | "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="
488 | },
489 | "find-rc": {
490 | "version": "4.0.0",
491 | "resolved": "https://registry.npmjs.org/find-rc/-/find-rc-4.0.0.tgz",
492 | "integrity": "sha512-jvkAF340j/ntR8cBRPLg/ElqWodgjfInY4SwLqDVqrmYDJormOIfM4lbtIcLZ0x8W5xWyrUy+mdoMwyo6OYuaQ==",
493 | "dev": true
494 | },
495 | "flat-cache": {
496 | "version": "2.0.1",
497 | "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz",
498 | "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==",
499 | "dev": true,
500 | "requires": {
501 | "flatted": "^2.0.0",
502 | "rimraf": "2.6.3",
503 | "write": "1.0.3"
504 | }
505 | },
506 | "flatted": {
507 | "version": "2.0.0",
508 | "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz",
509 | "integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==",
510 | "dev": true
511 | },
512 | "fs.realpath": {
513 | "version": "1.0.0",
514 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
515 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
516 | "dev": true
517 | },
518 | "functional-red-black-tree": {
519 | "version": "1.0.1",
520 | "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
521 | "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
522 | "dev": true
523 | },
524 | "glob": {
525 | "version": "7.1.4",
526 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
527 | "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
528 | "dev": true,
529 | "requires": {
530 | "fs.realpath": "^1.0.0",
531 | "inflight": "^1.0.4",
532 | "inherits": "2",
533 | "minimatch": "^3.0.4",
534 | "once": "^1.3.0",
535 | "path-is-absolute": "^1.0.0"
536 | }
537 | },
538 | "globals": {
539 | "version": "11.12.0",
540 | "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
541 | "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
542 | "dev": true
543 | },
544 | "handlebars": {
545 | "version": "4.1.2",
546 | "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz",
547 | "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==",
548 | "dev": true,
549 | "requires": {
550 | "neo-async": "^2.6.0",
551 | "optimist": "^0.6.1",
552 | "source-map": "^0.6.1",
553 | "uglify-js": "^3.1.4"
554 | },
555 | "dependencies": {
556 | "source-map": {
557 | "version": "0.6.1",
558 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
559 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
560 | "dev": true
561 | }
562 | }
563 | },
564 | "hapi-capitalize-modules": {
565 | "version": "1.1.6",
566 | "resolved": "https://registry.npmjs.org/hapi-capitalize-modules/-/hapi-capitalize-modules-1.1.6.tgz",
567 | "integrity": "sha1-eZEXFBXhXmqjIx5k3ac8gUZmUxg=",
568 | "dev": true
569 | },
570 | "hapi-for-you": {
571 | "version": "1.0.0",
572 | "resolved": "https://registry.npmjs.org/hapi-for-you/-/hapi-for-you-1.0.0.tgz",
573 | "integrity": "sha1-02L77o172pwseAHiB+WlzRoLans=",
574 | "dev": true
575 | },
576 | "hapi-no-var": {
577 | "version": "1.0.1",
578 | "resolved": "https://registry.npmjs.org/hapi-no-var/-/hapi-no-var-1.0.1.tgz",
579 | "integrity": "sha512-kk2xyyTzI+eQ/oA1rO4eVdCpYsrPHVERHa6+mTHD08XXFLaAkkaEs6reMg1VyqGh2o5xPt//DO4EhCacLx/cRA==",
580 | "dev": true
581 | },
582 | "hapi-scope-start": {
583 | "version": "2.1.1",
584 | "resolved": "https://registry.npmjs.org/hapi-scope-start/-/hapi-scope-start-2.1.1.tgz",
585 | "integrity": "sha1-dJWnJv5yt7yo3izcwdh82M5qtPI=",
586 | "dev": true
587 | },
588 | "has-flag": {
589 | "version": "3.0.0",
590 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
591 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
592 | "dev": true
593 | },
594 | "hoek": {
595 | "version": "4.2.1",
596 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz",
597 | "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA=="
598 | },
599 | "iconv-lite": {
600 | "version": "0.4.24",
601 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
602 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
603 | "dev": true,
604 | "requires": {
605 | "safer-buffer": ">= 2.1.2 < 3"
606 | }
607 | },
608 | "ignore": {
609 | "version": "4.0.6",
610 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
611 | "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
612 | "dev": true
613 | },
614 | "import-fresh": {
615 | "version": "3.0.0",
616 | "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz",
617 | "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==",
618 | "dev": true,
619 | "requires": {
620 | "parent-module": "^1.0.0",
621 | "resolve-from": "^4.0.0"
622 | }
623 | },
624 | "imurmurhash": {
625 | "version": "0.1.4",
626 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
627 | "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
628 | "dev": true
629 | },
630 | "inflight": {
631 | "version": "1.0.6",
632 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
633 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
634 | "dev": true,
635 | "requires": {
636 | "once": "^1.3.0",
637 | "wrappy": "1"
638 | }
639 | },
640 | "inherits": {
641 | "version": "2.0.3",
642 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
643 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
644 | "dev": true
645 | },
646 | "inquirer": {
647 | "version": "6.3.1",
648 | "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz",
649 | "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==",
650 | "dev": true,
651 | "requires": {
652 | "ansi-escapes": "^3.2.0",
653 | "chalk": "^2.4.2",
654 | "cli-cursor": "^2.1.0",
655 | "cli-width": "^2.0.0",
656 | "external-editor": "^3.0.3",
657 | "figures": "^2.0.0",
658 | "lodash": "^4.17.11",
659 | "mute-stream": "0.0.7",
660 | "run-async": "^2.2.0",
661 | "rxjs": "^6.4.0",
662 | "string-width": "^2.1.0",
663 | "strip-ansi": "^5.1.0",
664 | "through": "^2.3.6"
665 | },
666 | "dependencies": {
667 | "ansi-regex": {
668 | "version": "4.1.0",
669 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
670 | "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
671 | "dev": true
672 | },
673 | "strip-ansi": {
674 | "version": "5.2.0",
675 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
676 | "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
677 | "dev": true,
678 | "requires": {
679 | "ansi-regex": "^4.1.0"
680 | }
681 | }
682 | }
683 | },
684 | "is-fullwidth-code-point": {
685 | "version": "2.0.0",
686 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
687 | "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
688 | "dev": true
689 | },
690 | "is-promise": {
691 | "version": "2.1.0",
692 | "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
693 | "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=",
694 | "dev": true
695 | },
696 | "isemail": {
697 | "version": "3.2.0",
698 | "resolved": "https://registry.npmjs.org/isemail/-/isemail-3.2.0.tgz",
699 | "integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==",
700 | "requires": {
701 | "punycode": "2.x.x"
702 | }
703 | },
704 | "isexe": {
705 | "version": "2.0.0",
706 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
707 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
708 | "dev": true
709 | },
710 | "joi": {
711 | "version": "13.7.0",
712 | "resolved": "https://registry.npmjs.org/joi/-/joi-13.7.0.tgz",
713 | "integrity": "sha512-xuY5VkHfeOYK3Hdi91ulocfuFopwgbSORmIwzcwHKESQhC7w1kD5jaVSPnqDxS2I8t3RZ9omCKAxNwXN5zG1/Q==",
714 | "requires": {
715 | "hoek": "5.x.x",
716 | "isemail": "3.x.x",
717 | "topo": "3.x.x"
718 | },
719 | "dependencies": {
720 | "hoek": {
721 | "version": "5.0.4",
722 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-5.0.4.tgz",
723 | "integrity": "sha512-Alr4ZQgoMlnere5FZJsIyfIjORBqZll5POhDsF4q64dPuJR6rNxXdDxtHSQq8OXRurhmx+PWYEE8bXRROY8h0w=="
724 | }
725 | }
726 | },
727 | "js-tokens": {
728 | "version": "4.0.0",
729 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
730 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
731 | "dev": true
732 | },
733 | "js-yaml": {
734 | "version": "3.13.1",
735 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
736 | "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
737 | "dev": true,
738 | "requires": {
739 | "argparse": "^1.0.7",
740 | "esprima": "^4.0.0"
741 | }
742 | },
743 | "json-schema-traverse": {
744 | "version": "0.4.1",
745 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
746 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
747 | "dev": true
748 | },
749 | "json-stable-stringify": {
750 | "version": "1.0.1",
751 | "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz",
752 | "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=",
753 | "dev": true,
754 | "requires": {
755 | "jsonify": "~0.0.0"
756 | }
757 | },
758 | "json-stable-stringify-without-jsonify": {
759 | "version": "1.0.1",
760 | "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
761 | "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
762 | "dev": true
763 | },
764 | "json-stringify-safe": {
765 | "version": "5.0.1",
766 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
767 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=",
768 | "dev": true
769 | },
770 | "jsonify": {
771 | "version": "0.0.0",
772 | "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz",
773 | "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=",
774 | "dev": true
775 | },
776 | "lab": {
777 | "version": "18.0.2",
778 | "resolved": "https://registry.npmjs.org/lab/-/lab-18.0.2.tgz",
779 | "integrity": "sha512-b/BuQr/rqOVyO+kRcEJVqKcIZS9ypcO5CJjR1y4UAz/P2UFd5qjtbCt/BJ9vre/0EJt3Mb2m72V6jNBCwsOxxA==",
780 | "dev": true,
781 | "requires": {
782 | "bossy": "4.x.x",
783 | "diff": "4.x.x",
784 | "eslint": "5.x.x",
785 | "eslint-config-hapi": "12.x.x",
786 | "eslint-plugin-hapi": "4.x.x",
787 | "espree": "5.x.x",
788 | "find-rc": "4.x.x",
789 | "handlebars": "4.x.x",
790 | "hoek": "6.x.x",
791 | "json-stable-stringify": "1.x.x",
792 | "json-stringify-safe": "5.x.x",
793 | "mkdirp": "0.5.x",
794 | "seedrandom": "2.x.x",
795 | "source-map": "0.7.x",
796 | "source-map-support": "0.5.x",
797 | "supports-color": "6.x.x",
798 | "will-call": "1.x.x"
799 | },
800 | "dependencies": {
801 | "hoek": {
802 | "version": "6.1.3",
803 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz",
804 | "integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ==",
805 | "dev": true
806 | }
807 | }
808 | },
809 | "levn": {
810 | "version": "0.3.0",
811 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
812 | "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
813 | "dev": true,
814 | "requires": {
815 | "prelude-ls": "~1.1.2",
816 | "type-check": "~0.3.2"
817 | }
818 | },
819 | "lodash": {
820 | "version": "4.17.11",
821 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
822 | "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==",
823 | "dev": true
824 | },
825 | "mimic-fn": {
826 | "version": "1.2.0",
827 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
828 | "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
829 | "dev": true
830 | },
831 | "minimatch": {
832 | "version": "3.0.4",
833 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
834 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
835 | "dev": true,
836 | "requires": {
837 | "brace-expansion": "^1.1.7"
838 | }
839 | },
840 | "minimist": {
841 | "version": "0.0.8",
842 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
843 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
844 | "dev": true
845 | },
846 | "mkdirp": {
847 | "version": "0.5.1",
848 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
849 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
850 | "dev": true,
851 | "requires": {
852 | "minimist": "0.0.8"
853 | }
854 | },
855 | "ms": {
856 | "version": "2.1.2",
857 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
858 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
859 | "dev": true
860 | },
861 | "mute-stream": {
862 | "version": "0.0.7",
863 | "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
864 | "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=",
865 | "dev": true
866 | },
867 | "nan": {
868 | "version": "2.14.0",
869 | "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
870 | "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg=="
871 | },
872 | "natural-compare": {
873 | "version": "1.4.0",
874 | "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
875 | "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
876 | "dev": true
877 | },
878 | "neo-async": {
879 | "version": "2.6.1",
880 | "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz",
881 | "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==",
882 | "dev": true
883 | },
884 | "nice-try": {
885 | "version": "1.0.5",
886 | "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
887 | "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
888 | "dev": true
889 | },
890 | "no-arrowception": {
891 | "version": "1.0.0",
892 | "resolved": "https://registry.npmjs.org/no-arrowception/-/no-arrowception-1.0.0.tgz",
893 | "integrity": "sha1-W/PpXrnEG1c4SoBTM9qjtzTuMno=",
894 | "dev": true
895 | },
896 | "node-expat": {
897 | "version": "2.3.18",
898 | "resolved": "https://registry.npmjs.org/node-expat/-/node-expat-2.3.18.tgz",
899 | "integrity": "sha512-9dIrDxXePa9HSn+hhlAg1wXkvqOjxefEbMclGxk2cEnq/Y3U7Qo5HNNqeo3fQ4bVmLhcdt3YN1TZy7WMZy4MHw==",
900 | "requires": {
901 | "bindings": "^1.5.0",
902 | "nan": "^2.13.2"
903 | }
904 | },
905 | "once": {
906 | "version": "1.4.0",
907 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
908 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
909 | "dev": true,
910 | "requires": {
911 | "wrappy": "1"
912 | }
913 | },
914 | "onetime": {
915 | "version": "2.0.1",
916 | "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
917 | "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=",
918 | "dev": true,
919 | "requires": {
920 | "mimic-fn": "^1.0.0"
921 | }
922 | },
923 | "optimist": {
924 | "version": "0.6.1",
925 | "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
926 | "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=",
927 | "dev": true,
928 | "requires": {
929 | "minimist": "~0.0.1",
930 | "wordwrap": "~0.0.2"
931 | },
932 | "dependencies": {
933 | "wordwrap": {
934 | "version": "0.0.3",
935 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
936 | "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=",
937 | "dev": true
938 | }
939 | }
940 | },
941 | "optionator": {
942 | "version": "0.8.2",
943 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz",
944 | "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=",
945 | "dev": true,
946 | "requires": {
947 | "deep-is": "~0.1.3",
948 | "fast-levenshtein": "~2.0.4",
949 | "levn": "~0.3.0",
950 | "prelude-ls": "~1.1.2",
951 | "type-check": "~0.3.2",
952 | "wordwrap": "~1.0.0"
953 | }
954 | },
955 | "os-tmpdir": {
956 | "version": "1.0.2",
957 | "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
958 | "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
959 | "dev": true
960 | },
961 | "parent-module": {
962 | "version": "1.0.1",
963 | "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
964 | "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
965 | "dev": true,
966 | "requires": {
967 | "callsites": "^3.0.0"
968 | }
969 | },
970 | "path-is-absolute": {
971 | "version": "1.0.1",
972 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
973 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
974 | "dev": true
975 | },
976 | "path-is-inside": {
977 | "version": "1.0.2",
978 | "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz",
979 | "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=",
980 | "dev": true
981 | },
982 | "path-key": {
983 | "version": "2.0.1",
984 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
985 | "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
986 | "dev": true
987 | },
988 | "prelude-ls": {
989 | "version": "1.1.2",
990 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
991 | "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
992 | "dev": true
993 | },
994 | "progress": {
995 | "version": "2.0.3",
996 | "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
997 | "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
998 | "dev": true
999 | },
1000 | "punycode": {
1001 | "version": "2.1.1",
1002 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
1003 | "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
1004 | },
1005 | "regexpp": {
1006 | "version": "2.0.1",
1007 | "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz",
1008 | "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==",
1009 | "dev": true
1010 | },
1011 | "resolve-from": {
1012 | "version": "4.0.0",
1013 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
1014 | "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
1015 | "dev": true
1016 | },
1017 | "restore-cursor": {
1018 | "version": "2.0.0",
1019 | "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
1020 | "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=",
1021 | "dev": true,
1022 | "requires": {
1023 | "onetime": "^2.0.0",
1024 | "signal-exit": "^3.0.2"
1025 | }
1026 | },
1027 | "rimraf": {
1028 | "version": "2.6.3",
1029 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
1030 | "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
1031 | "dev": true,
1032 | "requires": {
1033 | "glob": "^7.1.3"
1034 | }
1035 | },
1036 | "run-async": {
1037 | "version": "2.3.0",
1038 | "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",
1039 | "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=",
1040 | "dev": true,
1041 | "requires": {
1042 | "is-promise": "^2.1.0"
1043 | }
1044 | },
1045 | "rxjs": {
1046 | "version": "6.5.2",
1047 | "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz",
1048 | "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==",
1049 | "dev": true,
1050 | "requires": {
1051 | "tslib": "^1.9.0"
1052 | }
1053 | },
1054 | "safer-buffer": {
1055 | "version": "2.1.2",
1056 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
1057 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
1058 | "dev": true
1059 | },
1060 | "seedrandom": {
1061 | "version": "2.4.4",
1062 | "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-2.4.4.tgz",
1063 | "integrity": "sha512-9A+PDmgm+2du77B5i0Ip2cxOqqHjgNxnBgglxLcX78A2D6c2rTo61z4jnVABpF4cKeDMDG+cmXXvdnqse2VqMA==",
1064 | "dev": true
1065 | },
1066 | "semver": {
1067 | "version": "5.7.0",
1068 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
1069 | "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
1070 | "dev": true
1071 | },
1072 | "shebang-command": {
1073 | "version": "1.2.0",
1074 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
1075 | "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
1076 | "dev": true,
1077 | "requires": {
1078 | "shebang-regex": "^1.0.0"
1079 | }
1080 | },
1081 | "shebang-regex": {
1082 | "version": "1.0.0",
1083 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
1084 | "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
1085 | "dev": true
1086 | },
1087 | "signal-exit": {
1088 | "version": "3.0.2",
1089 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
1090 | "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
1091 | "dev": true
1092 | },
1093 | "slice-ansi": {
1094 | "version": "2.1.0",
1095 | "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz",
1096 | "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==",
1097 | "dev": true,
1098 | "requires": {
1099 | "ansi-styles": "^3.2.0",
1100 | "astral-regex": "^1.0.0",
1101 | "is-fullwidth-code-point": "^2.0.0"
1102 | }
1103 | },
1104 | "source-map": {
1105 | "version": "0.7.3",
1106 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
1107 | "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
1108 | "dev": true
1109 | },
1110 | "source-map-support": {
1111 | "version": "0.5.12",
1112 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz",
1113 | "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
1114 | "dev": true,
1115 | "requires": {
1116 | "buffer-from": "^1.0.0",
1117 | "source-map": "^0.6.0"
1118 | },
1119 | "dependencies": {
1120 | "source-map": {
1121 | "version": "0.6.1",
1122 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
1123 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
1124 | "dev": true
1125 | }
1126 | }
1127 | },
1128 | "sprintf-js": {
1129 | "version": "1.0.3",
1130 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
1131 | "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
1132 | "dev": true
1133 | },
1134 | "string-width": {
1135 | "version": "2.1.1",
1136 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
1137 | "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
1138 | "dev": true,
1139 | "requires": {
1140 | "is-fullwidth-code-point": "^2.0.0",
1141 | "strip-ansi": "^4.0.0"
1142 | }
1143 | },
1144 | "strip-ansi": {
1145 | "version": "4.0.0",
1146 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
1147 | "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
1148 | "dev": true,
1149 | "requires": {
1150 | "ansi-regex": "^3.0.0"
1151 | }
1152 | },
1153 | "strip-json-comments": {
1154 | "version": "2.0.1",
1155 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
1156 | "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
1157 | "dev": true
1158 | },
1159 | "supports-color": {
1160 | "version": "6.1.0",
1161 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
1162 | "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
1163 | "dev": true,
1164 | "requires": {
1165 | "has-flag": "^3.0.0"
1166 | }
1167 | },
1168 | "table": {
1169 | "version": "5.4.0",
1170 | "resolved": "https://registry.npmjs.org/table/-/table-5.4.0.tgz",
1171 | "integrity": "sha512-nHFDrxmbrkU7JAFKqKbDJXfzrX2UBsWmrieXFTGxiI5e4ncg3VqsZeI4EzNmX0ncp4XNGVeoxIWJXfCIXwrsvw==",
1172 | "dev": true,
1173 | "requires": {
1174 | "ajv": "^6.9.1",
1175 | "lodash": "^4.17.11",
1176 | "slice-ansi": "^2.1.0",
1177 | "string-width": "^3.0.0"
1178 | },
1179 | "dependencies": {
1180 | "ansi-regex": {
1181 | "version": "4.1.0",
1182 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
1183 | "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
1184 | "dev": true
1185 | },
1186 | "string-width": {
1187 | "version": "3.1.0",
1188 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
1189 | "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
1190 | "dev": true,
1191 | "requires": {
1192 | "emoji-regex": "^7.0.1",
1193 | "is-fullwidth-code-point": "^2.0.0",
1194 | "strip-ansi": "^5.1.0"
1195 | }
1196 | },
1197 | "strip-ansi": {
1198 | "version": "5.2.0",
1199 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
1200 | "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
1201 | "dev": true,
1202 | "requires": {
1203 | "ansi-regex": "^4.1.0"
1204 | }
1205 | }
1206 | }
1207 | },
1208 | "text-table": {
1209 | "version": "0.2.0",
1210 | "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
1211 | "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
1212 | "dev": true
1213 | },
1214 | "through": {
1215 | "version": "2.3.8",
1216 | "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
1217 | "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
1218 | "dev": true
1219 | },
1220 | "tmp": {
1221 | "version": "0.0.33",
1222 | "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
1223 | "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
1224 | "dev": true,
1225 | "requires": {
1226 | "os-tmpdir": "~1.0.2"
1227 | }
1228 | },
1229 | "topo": {
1230 | "version": "3.0.3",
1231 | "resolved": "https://registry.npmjs.org/topo/-/topo-3.0.3.tgz",
1232 | "integrity": "sha512-IgpPtvD4kjrJ7CRA3ov2FhWQADwv+Tdqbsf1ZnPUSAtCJ9e1Z44MmoSGDXGk4IppoZA7jd/QRkNddlLJWlUZsQ==",
1233 | "requires": {
1234 | "hoek": "6.x.x"
1235 | },
1236 | "dependencies": {
1237 | "hoek": {
1238 | "version": "6.1.3",
1239 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz",
1240 | "integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ=="
1241 | }
1242 | }
1243 | },
1244 | "tslib": {
1245 | "version": "1.9.3",
1246 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
1247 | "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==",
1248 | "dev": true
1249 | },
1250 | "type-check": {
1251 | "version": "0.3.2",
1252 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
1253 | "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
1254 | "dev": true,
1255 | "requires": {
1256 | "prelude-ls": "~1.1.2"
1257 | }
1258 | },
1259 | "uglify-js": {
1260 | "version": "3.6.0",
1261 | "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz",
1262 | "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==",
1263 | "dev": true,
1264 | "optional": true,
1265 | "requires": {
1266 | "commander": "~2.20.0",
1267 | "source-map": "~0.6.1"
1268 | },
1269 | "dependencies": {
1270 | "source-map": {
1271 | "version": "0.6.1",
1272 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
1273 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
1274 | "dev": true,
1275 | "optional": true
1276 | }
1277 | }
1278 | },
1279 | "uri-js": {
1280 | "version": "4.2.2",
1281 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
1282 | "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
1283 | "dev": true,
1284 | "requires": {
1285 | "punycode": "^2.1.0"
1286 | }
1287 | },
1288 | "which": {
1289 | "version": "1.3.1",
1290 | "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
1291 | "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
1292 | "dev": true,
1293 | "requires": {
1294 | "isexe": "^2.0.0"
1295 | }
1296 | },
1297 | "will-call": {
1298 | "version": "1.0.1",
1299 | "resolved": "https://registry.npmjs.org/will-call/-/will-call-1.0.1.tgz",
1300 | "integrity": "sha512-1hEeV8SfBYhNRc/bNXeQfyUBX8Dl9SCYME3qXh99iZP9wJcnhnlBsoBw8Y0lXVZ3YuPsoxImTzBiol1ouNR/hg==",
1301 | "dev": true
1302 | },
1303 | "wordwrap": {
1304 | "version": "1.0.0",
1305 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
1306 | "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=",
1307 | "dev": true
1308 | },
1309 | "wrappy": {
1310 | "version": "1.0.2",
1311 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
1312 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
1313 | "dev": true
1314 | },
1315 | "write": {
1316 | "version": "1.0.3",
1317 | "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz",
1318 | "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==",
1319 | "dev": true,
1320 | "requires": {
1321 | "mkdirp": "^0.5.1"
1322 | }
1323 | }
1324 | }
1325 | }
1326 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "xml2json",
3 | "version": "0.11.3",
4 | "description": "Converts xml to json and vice-versa, using node-expat.",
5 | "repository": "git://github.com/buglabs/node-xml2json.git",
6 | "license": "MIT",
7 | "main": "index",
8 | "scripts": {
9 | "test": "lab -a code -v -t 93 test/test.js"
10 | },
11 | "dependencies": {
12 | "hoek": "^4.2.1",
13 | "joi": "^13.1.2",
14 | "node-expat": "^2.3.18"
15 | },
16 | "bin": {
17 | "xml2json": "bin/xml2json"
18 | },
19 | "devDependencies": {
20 | "code": "^3.0.2",
21 | "lab": "^18.0.0"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/test/.gitignore:
--------------------------------------------------------------------------------
1 | *.DS_Store
2 |
--------------------------------------------------------------------------------
/test/coerce-overhead.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 | var parser = require('../lib');
3 |
4 | var file = __dirname + '/fixtures/large.xml';
5 |
6 | var data = fs.readFileSync(file);
7 |
8 | // With coercion
9 | var t0 = Date.now();
10 | for(var i = 0; i < 10000; i++) {
11 | var result = parser.toJson(data, {reversible: true, coerce: true, object: true});
12 | }
13 | console.log(Date.now() - t0);
14 |
15 | // Without coercion
16 | var t0 = Date.now();
17 | for(var i = 0; i < 10000; i++) {
18 | result = parser.toJson(data, {reversible: true, object: true});
19 | }
20 | console.log(Date.now() - t0);
21 |
--------------------------------------------------------------------------------
/test/fixtures/alternate-text-node-A.json:
--------------------------------------------------------------------------------
1 | {"unit":{"test":{"case":[{"justText":{"$t":"blah blah"}},{"attribText":{"attrib":"das","$t":"capital"}}]}}}
--------------------------------------------------------------------------------
/test/fixtures/alternate-text-node-A.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | blah blah
5 |
6 |
7 | capital
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/test/fixtures/alternate-text-node-B.json:
--------------------------------------------------------------------------------
1 | {"unit":{"test":{"case":[{"justText":{"_t":"blah blah"}},{"attribText":{"attrib":"das","_t":"capital"}}]}}}
--------------------------------------------------------------------------------
/test/fixtures/alternate-text-node-C.json:
--------------------------------------------------------------------------------
1 | {"unit":{"test":{"case":[{"justText":{"xx":"blah blah"}},{"attribText":{"attrib":"das","xx":"capital"}}]}}}
--------------------------------------------------------------------------------
/test/fixtures/alternate-text-node-D.json:
--------------------------------------------------------------------------------
1 | {"unit":{"test":{"case":[{"justText":{"zz":"blah blah"}},{"attribText":{"attrib":"das","zz":"capital"}},{"spaces":{"zz":"abc\nasdf\n a"}},{"type":"SANATISE","san":{"b":"Smith & Son","zz":"Alpha & Omega"}}]}}}
--------------------------------------------------------------------------------
/test/fixtures/alternate-text-node-D.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | blah blah
5 |
6 |
7 | capital
8 |
9 |
10 |
11 | abc
12 | asdf
13 | a
14 |
15 |
16 |
17 | Alpha & Omega
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/test/fixtures/array-notation.json:
--------------------------------------------------------------------------------
1 | {"abcd":[{"efg":[{"hijk":["qrstuv",{"lmnop":["wxyz"]}]}]}]}
--------------------------------------------------------------------------------
/test/fixtures/array-notation.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | qrstuv
4 |
5 | wxyz
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test/fixtures/coerce.json:
--------------------------------------------------------------------------------
1 | {"itemRecord":{"value":[{"longValue":"12345"},{"stringValue":{"number":"false","$t":"this is a string value"}},{"moneyValue":{"number":"true","currencyId":"USD","text":"123.45","$t":"104.95"}},{"moneyValue":{"currencyId":"USD","$t":"104.95"}},{"longValue":"0","bool":{"id":"0","$t":"true"}},{"longValue":"0"},{"dateValue":"2012-02-16T17:03:33.000-07:00"},{"stringValue":"SmDZ8RlMIjDvlEW3KUibzj2Q"},{"text":"42.42"}]}}
2 |
--------------------------------------------------------------------------------
/test/fixtures/coerce.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 12345
4 |
5 |
6 | this is a string value
7 |
8 |
9 |
10 | 104.95
11 |
12 |
13 |
14 | 104.95
15 |
16 |
17 |
18 | 0
19 | true
20 |
21 |
22 | 0
23 |
24 |
25 | 2012-02-16T17:03:33.000-07:00
26 |
27 |
28 | SmDZ8RlMIjDvlEW3KUibzj2Q
29 |
30 |
31 | 42.42
32 |
33 |
--------------------------------------------------------------------------------
/test/fixtures/domain-reversible.json:
--------------------------------------------------------------------------------
1 | {"domain":{"type":"qemu","name":{"$t":"QEmu-fedora-i686"},"uuid":{"$t":"c7a5fdbd-cdaf-9455-926a-d65c16db1809"},"memory":{"$t":"219200"},"currentMemory":{"$t":"219200"},"vcpu":{"$t":"2"},"os":{"type":{"arch":"i686","machine":"pc","$t":"hvm"},"boot":{"dev":"cdrom"}},"devices":{"emulator":{"$t":"/usr/bin/qemu-system-x86_64"},"disk":[{"type":"file","device":"cdrom","source":{"file":"/home/user/boot.iso"},"target":{"dev":"hdc"},"readonly":{}},{"type":"file","device":"disk","source":{"file":"/home/user/fedora.img"},"target":{"dev":"hda"}}],"interface":{"type":"network","source":{"network":"default"}},"graphics":{"type":"vnc","port":"-1"}},"ah":[{"type":"rare","foo":"bar","$t":"cosa1"},{"type":"normal","$t":"cosa2"},{"$t":"cosa3"}]}}
2 |
--------------------------------------------------------------------------------
/test/fixtures/domain.json:
--------------------------------------------------------------------------------
1 | {"domain":{"type":"qemu","name":"QEmu-fedora-i686","uuid":"c7a5fdbd-cdaf-9455-926a-d65c16db1809","memory":"219200","currentMemory":"219200","vcpu":"2","os":{"type":{"arch":"i686","machine":"pc","$t":"hvm"},"boot":{"dev":"cdrom"}},"devices":{"emulator":"/usr/bin/qemu-system-x86_64","disk":[{"type":"file","device":"cdrom","source":{"file":"/home/user/boot.iso"},"target":{"dev":"hdc"},"readonly":{}},{"type":"file","device":"disk","source":{"file":"/home/user/fedora.img"},"target":{"dev":"hda"}}],"interface":{"type":"network","source":{"network":"default"}},"graphics":{"type":"vnc","port":"-1"}},"ah":[{"type":"rare","foo":"bar","$t":"cosa1"},{"type":"normal","$t":"cosa2"},"cosa3"]}}
2 |
--------------------------------------------------------------------------------
/test/fixtures/domain.xml:
--------------------------------------------------------------------------------
1 | QEmu-fedora-i686c7a5fdbd-cdaf-9455-926a-d65c16db18092192002192002hvm/usr/bin/qemu-system-x86_64cosa1cosa2cosa3
2 |
--------------------------------------------------------------------------------
/test/fixtures/forceArray.json:
--------------------------------------------------------------------------------
1 | {"json":{"id":"123b","vehicles":[{"year":"1989","annual_mileage":"18000","average_mileage":"30","alarm":"1","ownership":"Financed","make":"TOYOTA","model":"Camry","commute_days_per_week":"5","collision":"$ 500","comprehensive":"$ 500","primary_purpose":"Pleasure"},{"year":"2006","annual_mileage":"37500","average_mileage":"10","alarm":"1","ownership":"Owned","make":"CHRYSLER","model":"CROSSFIRE","commute_days_per_week":"3","collision":"$ 5000","comprehensive":"$ 500","primary_purpose":"CommuteWork"}],"drivers":[{"driver":"Bray Wyatt","birth_date":"1987-05-23","marital_status":"Single","relationship":"Self","gender":"Male","first_licensed":"18","license_status":"ValidLicense","occupation":"Unemployed","education":"HighSchoolDiploma","credit_rating":"Unsure"}]}}
--------------------------------------------------------------------------------
/test/fixtures/forceArray.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 123b
4 |
5 | 1989
6 | 18000
7 | 30
8 | 1
9 | Financed
10 | TOYOTA
11 | Camry
12 | 5
13 | $ 500
14 | $ 500
15 | Pleasure
16 |
17 |
18 | 2006
19 | 37500
20 | 10
21 | 1
22 | Owned
23 | CHRYSLER
24 | CROSSFIRE
25 | 3
26 | $ 5000
27 | $ 500
28 | CommuteWork
29 |
30 |
31 | Bray Wyatt
32 | 1987-05-23
33 | Single
34 | Self
35 | Male
36 | 18
37 | ValidLicense
38 | Unemployed
39 | HighSchoolDiploma
40 | Unsure
41 |
42 |
--------------------------------------------------------------------------------
/test/fixtures/large.json:
--------------------------------------------------------------------------------
1 | {"soapenv:Envelope":{"xmlns:soapenv":"http://schemas.xmlsoap.org/soap/envelope/","soapenv:Header":{},"soapenv:Body":{"findInterminglingResponse":{"xmlns":"http://www.ebay.com/marketplace/search/v1/services","ack":"Success","version":"1.1.0","timestamp":"2012-01-20T01:36:25.904Z","extension":{"id":"3","version":"1.0.0","contentType":"text/html","value":"qds=0.1723&!_dcat_leaf=617,163826,617,163826,15077&pct=94.84&nai=44&nhalf=0&ncbt=0&nmq=2&!SIBE=avatar+blue+ray+3d,JPIA9PMIDQ8:7M&auctions=44&nbi=22&iat=4&trsi=0&prof=5841&nabi=16&fixedprices=4&!ptrid=Pr1062_10,Pr5841_2&pcc=2&nProdSur=2&tcatid=617"},"resultSummary":{"matchCount":"118","abridgedMatchCount":"113","lastUpdateTime":"2012-01-19T18:36:02.000-07:00"},"intermingleRecord":[{"productRecord":{"value":[{"longValue":"81996414"},{"stringValue":"Avatar (DVD, 2010)"},{"longValue":"78"},{"moneyValue":{"currencyId":"USD","$t":"4.0"}},{"dateValue":"2012-01-19T21:01:14"},{"moneyValue":{"currencyId":"USD","$t":"13.5"}},{"longValue":"34"},{"moneyValue":{"currencyId":"USD","$t":"3.96"}},{"longValue":"44"},{"stringValue":"http://i.ebayimg.com/22/!!d7WiF!EWM~$(KGrHqMOKikEvOnbKY1gBL9fO1lupQ~~_6.JPG?set_id=89040003C1"}]}},{"productRecord":{"value":[{"longValue":"82093597"},{"stringValue":"Avatar (Blu-ray/DVD, 2010, 2-Disc Set)"},{"longValue":"74"},{"moneyValue":{"currencyId":"USD","$t":"15.01"}},{"dateValue":"2012-01-19T19:12:15"},{"moneyValue":{"currencyId":"USD","$t":"20.0"}},{"longValue":"26"},{"moneyValue":{"currencyId":"USD","$t":"11.96"}},{"longValue":"48"},{"stringValue":"http://i.ebayimg.com/01/!!d8dfeQ!mM~$(KGrHqUOKjcEwhzOMI3VBMSIdcD!Yw~~_6.JPG?set_id=89040003C1"}]}},{"itemRecord":{"value":[{"longValue":"220931734658"},{"stringValue":"AVATAR 3D BLU-RAY FACTORY SEALED -new,sealed-"},{"moneyValue":{"currencyId":"USD","$t":"70.99"}},{"moneyValue":{"currencyId":"USD","$t":"79.99"}},{"longValue":"1"},{"longValue":"300"},{"dateValue":"2012-01-19T19:15:14.000-07:00"},{"stringValue":"Sm86FNl5NfYQDIhtWAUiWbqQ"}]}},{"itemRecord":{"value":[{"longValue":"170763800829"},{"stringValue":"Avatar 3D Blu-ray Disc - BRAND NEW - FACTORY SEALED - PANASONIC EXCLUSIVE"},{"moneyValue":{"currencyId":"USD","$t":"61.0"}},{"moneyValue":{"currencyId":"USD","$t":"74.99"}},{"longValue":"4"},{"longValue":["300","0"]},{"dateValue":"2012-01-19T19:51:57.000-07:00"},{"stringValue":"SmJODPpMeeyd8FcfsNsrdYWA"}]}},{"itemRecord":{"value":[{"longValue":"220931945435"},{"stringValue":"New Sealed James Cameron's AVATAR 3D Blu-Ray Panasonic Exclusive PG-13 DVD RARE"},{"moneyValue":{"currencyId":"USD","$t":"61.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"14"},{"longValue":"300"},{"dateValue":"2012-01-19T21:19:51.000-07:00"},{"stringValue":"Sm4H_Y9vXU4EKx-f3wk3EF7A"}]}},{"itemRecord":{"value":[{"longValue":"320829372998"},{"stringValue":"NEW & SEALED 3D Blu-ray Panasonic Exclusive \"AVATAR\" FAST FREE SHIPPING!"},{"moneyValue":{"currencyId":"USD","$t":"89.99"}},{"moneyValue":{"currencyId":"USD","$t":"98.99"}},{"longValue":"0"},{"longValue":["0","399"]},{"dateValue":"2012-01-19T21:53:36.000-07:00"},{"stringValue":"SmcgSHPYl8Y2gPS8cJN-OcrA"}]}},{"itemRecord":{"value":[{"longValue":"190628955236"},{"stringValue":"NEW *Rare* AVATAR Blu-ray 3D Panasonic Exclusive *NOT SOLD IN STORES*"},{"moneyValue":{"currencyId":"USD","$t":"99.99"}},{"moneyValue":{"currencyId":"USD","$t":"109.99"}},{"longValue":"0"},{"longValue":"0"},{"dateValue":"2012-01-20T06:10:25.000-07:00"},{"stringValue":"Sm2CvUgNznvK-l0t-rZ3n4GQ"}]}},{"itemRecord":{"value":[{"longValue":"160718400852"},{"stringValue":"Avatar 3D Blu-Ray Panasonic Exclusive __ Unopened - Original factory shrink wrap"},{"moneyValue":{"currencyId":"USD","$t":"55.01"}},{"moneyValue":{"currencyId":"USD","$t":"75.0"}},{"longValue":"8"},{"longValue":"300"},{"dateValue":"2012-01-20T10:48:32.000-07:00"},{"stringValue":"SmiTg55gmYOWAJ1XbSQ98ECA"}]}},{"itemRecord":{"value":[{"longValue":"130632208352"},{"stringValue":"Avatar 3D Blu-Ray - Panasonic Exclusive (brand new, factory sealed)"},{"moneyValue":{"currencyId":"USD","$t":"62.85"}},{"moneyValue":{"currencyId":"USD","$t":"94.99"}},{"longValue":"12"},{"longValue":"300"},{"dateValue":"2012-01-20T13:52:56.000-07:00"},{"stringValue":"SmtrdC17WyVHvvn_ZgWTXgiA"}]}},{"itemRecord":{"value":[{"longValue":"230733466588"},{"stringValue":"Brand new Avatar 3d blu ray disc. Factory sealed (panasonic exclusive)"},{"moneyValue":{"currencyId":"USD","$t":"50.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"4"},{"longValue":"300"},{"dateValue":"2012-01-20T13:53:56.000-07:00"},{"stringValue":"SmlZdHT_kLO9ggmFSsxS0QCA"}]}},{"itemRecord":{"value":[{"longValue":"320829809050"},{"stringValue":"Avatar 3D Blu-ray Panasonic Exclusive Sealed NEW"},{"moneyValue":{"currencyId":"USD","$t":"60.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"0"},{"longValue":"0"},{"dateValue":"2012-01-20T14:31:02.000-07:00"},{"stringValue":"SmUBlLP2lRLEf0VBWm8ilplg"}]}},{"itemRecord":{"value":[{"longValue":"130630659754"},{"stringValue":"AVATAR 3D Blu-ray Brand New Factory Sealed (Original Panasonic Exclusive)"},{"moneyValue":{"currencyId":"USD","$t":"58.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"15"},{"longValue":"300"},{"dateValue":"2012-01-20T14:34:31.000-07:00"},{"stringValue":"Sm2MdiMGiOAE-0Qh8yDBew4g"}]}},{"itemRecord":{"value":[{"longValue":"150734718107"},{"stringValue":"Avatar 3D Blu-ray Brand New Factory Sealed Panasonic Exclusive"},{"moneyValue":{"currencyId":"USD","$t":"104.99"}},{"moneyValue":{"currencyId":"USD","$t":"104.99"}},{"longValue":"9"},{"longValue":["0","325","1690","-2147481648","16777216"]},{"dateValue":"2012-02-09T17:00:38.000-07:00"},{"stringValue":"SmVD9hFn5o8UG2kBlJRLDI4A"}]}},{"itemRecord":{"value":[{"longValue":"260937482985"},{"stringValue":"BRAND NEW Avatar 3D Blu-Ray DVD - Sealed"},{"moneyValue":{"currencyId":"USD","$t":"70.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"0"},{"longValue":["0","0"]},{"dateValue":"2012-01-20T20:25:55.000-07:00"},{"stringValue":"Smn_b9xfCFZUjdMMzg6b5U_w"}]}},{"itemRecord":{"value":[{"longValue":"120843131441"},{"stringValue":"Avatar 3D blu ray disc factory sealed NIB 3 d version"},{"moneyValue":{"currencyId":"USD","$t":"51.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"3"},{"longValue":"0"},{"dateValue":"2012-01-20T20:30:19.000-07:00"},{"stringValue":"SmRNvQVngyrAAzzicicxqF-g"}]}},{"itemRecord":{"value":[{"longValue":"330673600191"},{"stringValue":"AVATAR 3D Blu Ray-Factory Sealed..FREE Shipping!!!"},{"moneyValue":{"currencyId":"USD","$t":"49.95"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"1"},{"longValue":"0"},{"dateValue":"2012-01-20T21:51:58.000-07:00"},{"stringValue":"SmuX1a85zuIEuO2Jv-BJzp0A"}]}},{"itemRecord":{"value":[{"longValue":"200700624127"},{"stringValue":"AVATAR, 3D, BLU RAY, BRAND NEW AND FACTORY SEALED"},{"moneyValue":{"currencyId":"USD","$t":"50.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"1"},{"longValue":"300"},{"dateValue":"2012-01-20T23:22:51.000-07:00"},{"stringValue":"SmPCqKpN0DBoNqaMNhr3vO9Q"}]}},{"itemRecord":{"value":[{"longValue":"130632758842"},{"stringValue":"3D Avatar Blue Ray Disk"},{"moneyValue":{"currencyId":"USD","$t":"75.0"}},{"moneyValue":{"currencyId":"USD","$t":"90.0"}},{"longValue":"0"},{"longValue":["300","0"]},{"dateValue":"2012-01-21T15:27:37.000-07:00"},{"stringValue":"Smff4598BYjt0QU3hnozg9qQ"}]}},{"itemRecord":{"value":[{"longValue":"180798514647"},{"stringValue":"Avatar Blu-ray 3D Panasonic Exclusive - Sealed NEW"},{"moneyValue":{"currencyId":"USD","$t":"32.93"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"18"},{"longValue":["300","1000"]},{"dateValue":"2012-01-21T15:43:43.000-07:00"},{"stringValue":"Smt8taWyWmsG_Tw-zHfZUmHA"}]}},{"itemRecord":{"value":[{"longValue":"380401406666"},{"stringValue":"AVATAR 3D BLU-RAY MOVIE NEW EDITION --FACTORY SEALED !"},{"moneyValue":{"currencyId":"USD","$t":"95.0"}},{"moneyValue":{"currencyId":"USD","$t":"95.0"}},{"longValue":"11"},{"longValue":"0"},{"dateValue":"2012-02-09T08:43:23.000-07:00"},{"stringValue":"SmipHloK8dVCLobrpiHi9soA"}]}},{"itemRecord":{"value":[{"longValue":"120845197426"},{"stringValue":"Avatar 3D Blu Ray Exlusive Factory Sealed Brand New"},{"moneyValue":{"currencyId":"USD","$t":"70.0"}},{"moneyValue":{"currencyId":"USD","$t":"100.0"}},{"longValue":"1"},{"longValue":"0"},{"dateValue":"2012-01-22T05:35:49.000-07:00"},{"stringValue":"SmSjLcuOvW6zhwC5Lx1h5S-g"}]}},{"itemRecord":{"value":[{"longValue":"320830894431"},{"stringValue":"AVATAR BLU-RAY 3D MOVIE; BRAND NEW, FACTORY SEALED"},{"moneyValue":{"currencyId":"USD","$t":"75.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"0"},{"longValue":"0"},{"dateValue":"2012-01-22T15:55:06.000-07:00"},{"stringValue":"SmE7UPFuIq9m6x9xjY7QFbXg"}]}},{"itemRecord":{"value":[{"longValue":"330672702076"},{"stringValue":"AVATAR 3D BLU-RAY 3D - Brand New Unopened"},{"moneyValue":{"currencyId":"USD","$t":"60.0"}},{"moneyValue":{"currencyId":"USD","$t":"100.0"}},{"longValue":"1"},{"longValue":"300"},{"dateValue":"2012-01-22T16:25:14.000-07:00"},{"stringValue":"SmN_U5mt-bejXAlAg-oekhYg"}]}},{"itemRecord":{"value":[{"longValue":"220933768045"},{"stringValue":"Blue-ray 3D Avatar DVD, Brand New in Original Packaging, Never opened"},{"moneyValue":{"currencyId":"USD","$t":"39.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"8"},{"longValue":"0"},{"dateValue":"2012-01-22T16:58:20.000-07:00"},{"stringValue":"SmZGHJZ-gikK2yYeIDhWxFvQ"}]}},{"itemRecord":{"value":[{"longValue":"170766321061"},{"stringValue":"Avatar 3D blu ray, exclusive Panasonic release. New sealed in hand. Great 3 D"},{"moneyValue":{"currencyId":"USD","$t":"43.99"}},{"moneyValue":{"currencyId":"USD","$t":"85.0"}},{"longValue":"6"},{"longValue":"300"},{"dateValue":"2012-01-22T17:26:33.000-07:00"},{"stringValue":"SmnvAaEh-waB7BW4_CKGWdBQ"}]}},{"itemRecord":{"value":[{"longValue":"300651900316"},{"stringValue":"AVATAR BLU-RAY 3D\"\" PANASONIC EXCLUSIVE NEW SEALED not found in stores"},{"moneyValue":{"currencyId":"USD","$t":"31.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"8"},{"longValue":"300"},{"dateValue":"2012-01-22T18:55:21.000-07:00"},{"stringValue":"SmntGH04Op5W7KLFnYdvAeZA"}]}},{"itemRecord":{"value":[{"longValue":"180798015096"},{"stringValue":"Avatar 3D Blu-ray Panasonic Exclusive, factory sealed, minor box defect."},{"moneyValue":{"currencyId":"USD","$t":"49.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"0"},{"longValue":"0"},{"dateValue":"2012-01-22T19:53:02.000-07:00"},{"stringValue":"SmeZSdGGu_jOcIPVFQpAVQFA"}]}},{"itemRecord":{"value":[{"longValue":"160717564858"},{"stringValue":"Avatar 3D SEALED Blu-ray Panasonic Exclusive"},{"moneyValue":{"currencyId":"USD","$t":"31.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"12"},{"longValue":"0"},{"dateValue":"2012-01-22T20:07:34.000-07:00"},{"stringValue":"SmiWNF8nl9ntob9GViXnyBBA"}]}},{"itemRecord":{"value":[{"longValue":"220932049647"},{"stringValue":"AVATAR 3D BLU-RAY~BRAND NEW~FACTORY SEALED IN SHRINK~PANASONIC PROMO EXCLUSIVE!!"},{"moneyValue":{"currencyId":"USD","$t":"109.99"}},{"moneyValue":{"currencyId":"USD","$t":"120.99"}},{"longValue":"0"},{"longValue":"300"},{"dateValue":"2012-01-22T23:01:04.000-07:00"},{"stringValue":"SmBH2AwKhfOLm0BP7eXlEhNA"}]}},{"itemRecord":{"value":[{"longValue":"180800257998"},{"stringValue":"Avatar Blu-Ray 3D Limited Release Promo Disc - Factory Sealed"},{"moneyValue":{"currencyId":"USD","$t":"89.0"}},{"moneyValue":{"currencyId":"USD","$t":"89.0"}},{"longValue":"0"},{"longValue":"0"},{"dateValue":"2012-01-26T10:27:27.000-07:00"},{"stringValue":"Sm0gVHFWw_MaLbyOMYjwaiog"}]}},{"itemRecord":{"value":[{"longValue":"120844739120"},{"stringValue":"Avatar 3D Blu Ray Factory Sealed Incl. Two 3D Glasses !!"},{"moneyValue":{"currencyId":"USD","$t":"79.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"13"},{"longValue":["0","-2147481148","268435456"]},{"dateValue":"2012-01-23T09:38:20.000-07:00"},{"stringValue":"SmbzRQ-rZ_MKXYvTkoispOVw"}]}},{"itemRecord":{"value":[{"longValue":"140683495269"},{"stringValue":"New AVATAR Blu-ray 3D Panasonic Exclusive *NOT SOLD IN STORES*"},{"moneyValue":{"currencyId":"USD","$t":"32.91"}},{"moneyValue":{"currencyId":"USD","$t":"99.0"}},{"longValue":"2"},{"longValue":"0"},{"dateValue":"2012-01-23T15:02:11.000-07:00"},{"stringValue":"SmZ4iQNLIAiTz0o_0j3bIW9w"}]}},{"itemRecord":{"value":[{"longValue":"170765774879"},{"stringValue":"Avatar 3D Blu-ray Panasonic Exclusive - Not available in stores!"},{"moneyValue":{"currencyId":"USD","$t":"31.93"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"20"},{"longValue":"0"},{"dateValue":"2012-01-23T15:13:47.000-07:00"},{"stringValue":"SmbSQ1lnQYPcCfvpfpvToS8A"}]}},{"itemRecord":{"value":[{"longValue":"180798565141"},{"stringValue":"Avatar 3D Blu-Ray - BRAND NEW and SEALED - Panasonic Exclusive 3 D BluRay"},{"moneyValue":{"currencyId":"USD","$t":"33.93"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"11"},{"longValue":"0"},{"dateValue":"2012-01-23T17:47:14.000-07:00"},{"stringValue":"SmvZYYqQS_evOSt3pDfMno8Q"}]}},{"itemRecord":{"value":[{"longValue":"110810440275"},{"stringValue":"AVATAR 3D Blu-ray Brand New Factory Sealed ñ FREE SHIPPING!"},{"moneyValue":{"currencyId":"USD","$t":"58.99"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"22"},{"longValue":"0"},{"dateValue":"2012-01-23T17:57:52.000-07:00"},{"stringValue":"SmBi99v66zqHKYkKvIAJ9pQA"}]}},{"itemRecord":{"value":[{"longValue":"190628845216"},{"stringValue":"AVATAR 3D Blu-Ray - Panasonic Exclusive - FACTORY SEALED - Free Shipping"},{"moneyValue":{"currencyId":"USD","$t":"31.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"6"},{"longValue":"0"},{"dateValue":"2012-01-23T19:51:19.000-07:00"},{"stringValue":"SmE2rnqwwG4Ox7y9QPAZwmDA"}]}},{"itemRecord":{"value":[{"longValue":"320831486088"},{"stringValue":"Avatar 3D Blu-Ray NEW Factory Sealed - Panasonic Exclusive - FREE SHIPPING"},{"moneyValue":{"currencyId":"USD","$t":"50.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"2"},{"longValue":"0"},{"dateValue":"2012-01-23T21:10:17.000-07:00"},{"stringValue":"Smp2gxOJCJH8Wm7P4n6akm1Q"}]}},{"itemRecord":{"value":[{"longValue":"260937208793"},{"stringValue":"3D Avatar 3D Blu-ray 3D bluray 3D blu ray Brand new sealed NIB new in box"},{"moneyValue":{"currencyId":"USD","$t":"90.0"}},{"moneyValue":{"currencyId":"USD","$t":"120.0"}},{"longValue":"0"},{"longValue":["300","200","500"]},{"dateValue":"2012-01-24T09:58:40.000-07:00"},{"stringValue":"SmKwKZry-47DifBrUXtAjLIA"}]}},{"itemRecord":{"value":[{"longValue":"290659864842"},{"stringValue":"Avatar 3D Blu Ray Panasonic Exclusive Sealed Promo DTS-HD 5.1 Master"},{"moneyValue":{"currencyId":"USD","$t":"26.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"7"},{"longValue":["0","-2147483148","2"]},{"dateValue":"2012-01-24T11:52:45.000-07:00"},{"stringValue":"Smc5ACn355MwQ36-8qVhYJMA"}]}},{"itemRecord":{"value":[{"longValue":"120845375724"},{"stringValue":"Avatar Blu-Ray 3D Panasonic Exclusive Movie Brand New Sealed"},{"moneyValue":{"currencyId":"USD","$t":"80.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"0"},{"longValue":"300"},{"dateValue":"2012-01-24T12:15:28.000-07:00"},{"stringValue":"SmTRKrb5snFcN629amftoz5g"}]}},{"itemRecord":{"value":[{"longValue":"170766323196"},{"stringValue":"Avatar 3D Blu-ray Brand New Factory Sealed"},{"moneyValue":{"currencyId":"USD","$t":"26.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"8"},{"longValue":"0"},{"dateValue":"2012-01-24T17:32:24.000-07:00"},{"stringValue":"Smeip7wxKlFhh3GztuS7jkiA"}]}},{"itemRecord":{"value":[{"longValue":"220936324950"},{"stringValue":"AVATAR 3D BLU-RAY~BRAND NEW~FACTORY SEALED IN SHRINK~PANASONIC PROMO EXCLUSIVE!!"},{"moneyValue":{"currencyId":"USD","$t":"89.99"}},{"moneyValue":{"currencyId":"USD","$t":"99.99"}},{"longValue":"0"},{"longValue":"300"},{"dateValue":"2012-01-24T18:15:10.000-07:00"},{"stringValue":"Sm_JHQtAx3TZEDGP0Lw6ObpA"}]}},{"itemRecord":{"value":[{"longValue":"320831969924"},{"stringValue":"AVATAR 3D Blu Ray (Original Panasonic Exclusive) - Like NEW"},{"moneyValue":{"currencyId":"USD","$t":"40.0"}},{"moneyValue":{"currencyId":"USD","$t":"86.0"}},{"longValue":"1"},{"longValue":"300"},{"dateValue":"2012-01-24T20:26:55.000-07:00"},{"stringValue":"Smnzp3FhNin5GcqoftqekADg"}]}},{"itemRecord":{"value":[{"longValue":"150738091689"},{"stringValue":"New RARE Avatar Blu-ray Blu Ray 3-D 3 D Panasonic Exclusive NOT SOLD IN STORES"},{"moneyValue":{"currencyId":"USD","$t":"199.99"}},{"moneyValue":{"currencyId":"USD","$t":"199.99"}},{"longValue":"0"},{"longValue":["0","-2147482303","268435456","-2147480098","268435456"]},{"dateValue":"2012-01-22T16:26:56.000-07:00"},{"stringValue":"SmuB9oGX7_insOHm5Wm1mtPA"}]}},{"itemRecord":{"value":[{"longValue":"200697624093"},{"stringValue":"New Avatar 3D Blu-Ray Panasonic Exclusive Factory Sealed New"},{"moneyValue":{"currencyId":"USD","$t":"105.0"}},{"moneyValue":{"currencyId":"USD","$t":"105.0"}},{"longValue":"1"},{"longValue":["0","0"]},{"dateValue":"2012-02-06T13:17:53.000-07:00"},{"stringValue":"Sm4Ih4QKzC5nfe3TenzzSiSA"}]}},{"itemRecord":{"value":[{"longValue":"320832354417"},{"stringValue":"Avatar 3-d Blu Ray With Sony Blu Ray Player"},{"moneyValue":{"currencyId":"USD","$t":"150.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"0"},{"longValue":"300"},{"dateValue":"2012-01-25T12:33:27.000-07:00"},{"stringValue":"SmQ-meY-Gw-I--dGgWe4aNdA"}]}},{"itemRecord":{"value":[{"longValue":"320832387656"},{"stringValue":"James Cameron's AVATAR Exclusive Blu-Ray 3D **FACTORY SEALED**"},{"moneyValue":{"currencyId":"USD","$t":"85.0"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"0"},{"longValue":"0"},{"dateValue":"2012-01-25T13:20:30.000-07:00"},{"stringValue":"Sm-_Y6j0vHctWYksalN84VFw"}]}},{"itemRecord":{"value":[{"longValue":"320832469688"},{"stringValue":"Avatar Blu-ray 3D"},{"moneyValue":{"currencyId":"USD","$t":"39.99"}},{"moneyValue":{"currencyId":"USD","$t":"0.0"}},{"longValue":"0"},{"longValue":"241"},{"dateValue":"2012-01-25T16:09:30.000-07:00"},{"stringValue":"Sme85gcM76LwgS-iccLJrT7g"}]}},{"itemRecord":{"value":[{"longValue":"110811394468"},{"stringValue":"NEW- AVATAR 3D Blu-Ray Movie- PANASONIC EXCLUSIVE & FACTORY SEALED!!"},{"moneyValue":{"currencyId":"USD","$t":"31.0"}},{"moneyValue":{"currencyId":"USD","$t":"95.0"}},{"longValue":"3"},{"longValue":"0"},{"dateValue":"2012-01-25T20:47:13.000-07:00"},{"stringValue":"Sml7KjYSTL-Pw446Zcx9UrNw"}]}},{"itemRecord":{"value":[{"longValue":"190629134325"},{"stringValue":"AVATAR 3D BLU-RAY DISC Panasonic Exclusive, Factory Sealed Dolby Digital DTS-HD"},{"moneyValue":{"currencyId":"USD","$t":"104.95"}},{"moneyValue":{"currencyId":"USD","$t":"104.95"}},{"longValue":"0"},{"longValue":"0"},{"dateValue":"2012-02-16T17:03:33.000-07:00"},{"stringValue":"SmDZ8RlMIjDvlEW3KUibzj2Q"}]}}],"dfnResponse":{"productTypeCoverage":{"name":"US_DVD_HD_DVD_Blu_ray","supplyScore":"108.0","demandScore":"100.0","aggregateScore":"90.24579692259518"}},"queryTime":"157","executionTime":"204","backendTestResponse":{}}}}}
2 |
--------------------------------------------------------------------------------
/test/fixtures/large.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 | Success
6 | 1.1.0
7 | 2012-01-20T01:36:25.904Z
8 |
9 | 3
10 | 1.0.0
11 | text/html
12 | <a>qds=0.1723&!_dcat_leaf=617,163826,617,163826,15077&pct=94.84&nai=44&nhalf=0&ncbt=0&nmq=2&!SIBE=avatar+blue+ray+3d,JPIA9PMIDQ8:7M&auctions=44&nbi=22&iat=4&trsi=0&prof=5841&nabi=16&fixedprices=4&!ptrid=Pr1062_10,Pr5841_2&pcc=2&nProdSur=2&tcatid=617</a>
13 |
14 |
15 | 118
16 | 113
17 | 2012-01-19T18:36:02.000-07:00
18 |
19 |
20 |
21 |
22 | 81996414
23 |
24 |
25 | Avatar (DVD, 2010)
26 |
27 |
28 | 78
29 |
30 | 4.0
31 |
32 |
33 |
34 | 2012-01-19T21:01:14
35 |
36 | 13.5
37 |
38 |
39 |
40 | 34
41 |
42 | 3.96
43 |
44 |
45 | 44
46 |
47 |
48 | http://i.ebayimg.com/22/!!d7WiF!EWM~$(KGrHqMOKikEvOnbKY1gBL9fO1lupQ~~_6.JPG?set_id=89040003C1
49 |
50 |
51 |
52 |
53 | 82093597
54 |
55 |
56 | Avatar (Blu-ray/DVD, 2010, 2-Disc Set)
57 |
58 |
59 | 74
60 |
61 | 15.01
62 |
63 |
64 |
65 | 2012-01-19T19:12:15
66 |
67 | 20.0
68 |
69 |
70 | 26
71 | 11.96
72 |
73 | 48
74 |
75 |
76 | http://i.ebayimg.com/01/!!d8dfeQ!mM~$(KGrHqUOKjcEwhzOMI3VBMSIdcD!Yw~~_6.JPG?set_id=89040003C1
77 |
78 |
79 |
80 |
81 | 220931734658
82 |
83 |
84 | AVATAR 3D BLU-RAY FACTORY SEALED -new,sealed-
85 |
86 | 70.99
87 |
88 |
89 | 79.99
90 |
91 |
92 | 1
93 |
94 | 300
95 |
96 | 2012-01-19T19:15:14.000-07:00
97 |
98 | Sm86FNl5NfYQDIhtWAUiWbqQ
99 |
100 |
101 |
102 | 170763800829
103 |
104 |
105 | Avatar 3D Blu-ray Disc - BRAND NEW - FACTORY SEALED - PANASONIC EXCLUSIVE
106 |
107 |
108 | 61.0
109 |
110 |
111 | 74.99
112 |
113 |
114 | 4
115 |
116 | 300
117 | 0
118 |
119 | 2012-01-19T19:51:57.000-07:00
120 |
121 | SmJODPpMeeyd8FcfsNsrdYWA
122 |
123 |
124 |
125 | 220931945435
126 |
127 |
128 | New Sealed James Cameron's AVATAR 3D Blu-Ray Panasonic Exclusive PG-13 DVD RARE
129 |
130 |
131 | 61.0
132 |
133 |
134 | 0.0
135 |
136 |
137 | 14
138 |
139 | 300
140 |
141 | 2012-01-19T21:19:51.000-07:00
142 |
143 | Sm4H_Y9vXU4EKx-f3wk3EF7A
144 |
145 |
146 |
147 | 320829372998
148 |
149 |
150 | NEW & SEALED 3D Blu-ray Panasonic Exclusive "AVATAR" FAST FREE SHIPPING!
151 |
152 |
153 | 89.99
154 |
155 |
156 | 98.99
157 |
158 |
159 | 0
160 |
161 | 0
162 | 399
163 |
164 | 2012-01-19T21:53:36.000-07:00
165 |
166 | SmcgSHPYl8Y2gPS8cJN-OcrA
167 |
168 |
169 |
170 | 190628955236
171 |
172 |
173 | NEW *Rare* AVATAR Blu-ray 3D Panasonic Exclusive *NOT SOLD IN STORES*
174 |
175 | 99.99
176 |
177 |
178 | 109.99
179 |
180 |
181 | 0
182 |
183 | 0
184 |
185 | 2012-01-20T06:10:25.000-07:00
186 |
187 | Sm2CvUgNznvK-l0t-rZ3n4GQ
188 |
189 |
190 |
191 | 160718400852
192 |
193 |
194 | Avatar 3D Blu-Ray Panasonic Exclusive __ Unopened - Original factory shrink wrap
195 |
196 |
197 | 55.01
198 |
199 |
200 | 75.0
201 |
202 |
203 | 8
204 |
205 | 300
206 |
207 | 2012-01-20T10:48:32.000-07:00
208 |
209 | SmiTg55gmYOWAJ1XbSQ98ECA
210 |
211 |
212 |
213 | 130632208352
214 |
215 |
216 | Avatar 3D Blu-Ray - Panasonic Exclusive (brand new, factory sealed)
217 |
218 | 62.85
219 |
220 |
221 | 94.99
222 |
223 |
224 | 12
225 |
226 | 300
227 |
228 | 2012-01-20T13:52:56.000-07:00
229 |
230 | SmtrdC17WyVHvvn_ZgWTXgiA
231 |
232 |
233 |
234 | 230733466588
235 |
236 |
237 | Brand new Avatar 3d blu ray disc. Factory sealed (panasonic exclusive)
238 |
239 |
240 | 50.0
241 |
242 |
243 | 0.0
244 |
245 |
246 | 4
247 |
248 | 300
249 |
250 | 2012-01-20T13:53:56.000-07:00
251 |
252 | SmlZdHT_kLO9ggmFSsxS0QCA
253 |
254 |
255 |
256 | 320829809050
257 |
258 |
259 | Avatar 3D Blu-ray Panasonic Exclusive Sealed NEW
260 |
261 | 60.0
262 |
263 |
264 | 0.0
265 |
266 |
267 | 0
268 |
269 | 0
270 |
271 | 2012-01-20T14:31:02.000-07:00
272 |
273 | SmUBlLP2lRLEf0VBWm8ilplg
274 |
275 |
276 |
277 | 130630659754
278 |
279 |
280 | AVATAR 3D Blu-ray Brand New Factory Sealed (Original Panasonic Exclusive)
281 |
282 |
283 | 58.0
284 |
285 |
286 | 0.0
287 |
288 |
289 | 15
290 |
291 | 300
292 |
293 | 2012-01-20T14:34:31.000-07:00
294 |
295 | Sm2MdiMGiOAE-0Qh8yDBew4g
296 |
297 |
298 |
299 | 150734718107
300 |
301 |
302 | Avatar 3D Blu-ray Brand New Factory Sealed Panasonic Exclusive
303 |
304 | 104.99
305 |
306 |
307 | 104.99
308 |
309 |
310 | 9
311 |
312 | 0
313 | 325
314 | 1690
315 | -2147481648
316 | 16777216
317 |
318 | 2012-02-09T17:00:38.000-07:00
319 |
320 | SmVD9hFn5o8UG2kBlJRLDI4A
321 |
322 |
323 |
324 | 260937482985
325 |
326 |
327 | BRAND NEW Avatar 3D Blu-Ray DVD - Sealed
328 |
329 | 70.0
330 |
331 |
332 | 0.0
333 |
334 |
335 | 0
336 |
337 | 0
338 | 0
339 |
340 | 2012-01-20T20:25:55.000-07:00
341 |
342 | Smn_b9xfCFZUjdMMzg6b5U_w
343 |
344 |
345 |
346 | 120843131441
347 |
348 |
349 | Avatar 3D blu ray disc factory sealed NIB 3 d version
350 |
351 | 51.0
352 |
353 |
354 | 0.0
355 |
356 |
357 | 3
358 |
359 | 0
360 |
361 | 2012-01-20T20:30:19.000-07:00
362 |
363 | SmRNvQVngyrAAzzicicxqF-g
364 |
365 |
366 |
367 | 330673600191
368 |
369 |
370 | AVATAR 3D Blu Ray-Factory Sealed..FREE Shipping!!!
371 |
372 | 49.95
373 |
374 |
375 | 0.0
376 |
377 |
378 | 1
379 |
380 | 0
381 |
382 | 2012-01-20T21:51:58.000-07:00
383 |
384 | SmuX1a85zuIEuO2Jv-BJzp0A
385 |
386 |
387 |
388 | 200700624127
389 |
390 |
391 | AVATAR, 3D, BLU RAY, BRAND NEW AND FACTORY SEALED
392 |
393 | 50.0
394 |
395 |
396 | 0.0
397 |
398 |
399 | 1
400 |
401 | 300
402 |
403 | 2012-01-20T23:22:51.000-07:00
404 |
405 | SmPCqKpN0DBoNqaMNhr3vO9Q
406 |
407 |
408 |
409 | 130632758842
410 |
411 |
412 | 3D Avatar Blue Ray Disk
413 |
414 | 75.0
415 |
416 |
417 | 90.0
418 |
419 |
420 | 0
421 |
422 | 300
423 | 0
424 |
425 | 2012-01-21T15:27:37.000-07:00
426 |
427 | Smff4598BYjt0QU3hnozg9qQ
428 |
429 |
430 |
431 | 180798514647
432 |
433 |
434 | Avatar Blu-ray 3D Panasonic Exclusive - Sealed NEW
435 |
436 | 32.93
437 |
438 |
439 | 0.0
440 |
441 |
442 | 18
443 |
444 | 300
445 | 1000
446 |
447 | 2012-01-21T15:43:43.000-07:00
448 |
449 | Smt8taWyWmsG_Tw-zHfZUmHA
450 |
451 |
452 |
453 | 380401406666
454 |
455 |
456 | AVATAR 3D BLU-RAY MOVIE NEW EDITION --FACTORY SEALED !
457 |
458 | 95.0
459 |
460 |
461 | 95.0
462 |
463 |
464 | 11
465 |
466 | 0
467 |
468 | 2012-02-09T08:43:23.000-07:00
469 |
470 | SmipHloK8dVCLobrpiHi9soA
471 |
472 |
473 |
474 | 120845197426
475 |
476 |
477 | Avatar 3D Blu Ray Exlusive Factory Sealed Brand New
478 |
479 | 70.0
480 |
481 |
482 | 100.0
483 |
484 |
485 | 1
486 |
487 | 0
488 |
489 | 2012-01-22T05:35:49.000-07:00
490 |
491 | SmSjLcuOvW6zhwC5Lx1h5S-g
492 |
493 |
494 |
495 | 320830894431
496 |
497 |
498 | AVATAR BLU-RAY 3D MOVIE; BRAND NEW, FACTORY SEALED
499 |
500 | 75.0
501 |
502 |
503 | 0.0
504 |
505 |
506 | 0
507 |
508 | 0
509 |
510 | 2012-01-22T15:55:06.000-07:00
511 |
512 | SmE7UPFuIq9m6x9xjY7QFbXg
513 |
514 |
515 |
516 | 330672702076
517 |
518 |
519 | AVATAR 3D BLU-RAY 3D - Brand New Unopened
520 |
521 | 60.0
522 |
523 |
524 | 100.0
525 |
526 |
527 | 1
528 |
529 | 300
530 |
531 | 2012-01-22T16:25:14.000-07:00
532 |
533 | SmN_U5mt-bejXAlAg-oekhYg
534 |
535 |
536 |
537 | 220933768045
538 |
539 |
540 | Blue-ray 3D Avatar DVD, Brand New in Original Packaging, Never opened
541 |
542 | 39.0
543 |
544 |
545 | 0.0
546 |
547 |
548 | 8
549 |
550 | 0
551 |
552 | 2012-01-22T16:58:20.000-07:00
553 |
554 | SmZGHJZ-gikK2yYeIDhWxFvQ
555 |
556 |
557 |
558 | 170766321061
559 |
560 |
561 | Avatar 3D blu ray, exclusive Panasonic release. New sealed in hand. Great 3 D
562 |
563 |
564 | 43.99
565 |
566 |
567 | 85.0
568 |
569 |
570 | 6
571 |
572 | 300
573 |
574 | 2012-01-22T17:26:33.000-07:00
575 |
576 | SmnvAaEh-waB7BW4_CKGWdBQ
577 |
578 |
579 |
580 | 300651900316
581 |
582 |
583 | AVATAR BLU-RAY 3D"" PANASONIC EXCLUSIVE NEW SEALED not found in stores
584 |
585 |
586 | 31.0
587 |
588 |
589 | 0.0
590 |
591 |
592 | 8
593 |
594 | 300
595 |
596 | 2012-01-22T18:55:21.000-07:00
597 |
598 | SmntGH04Op5W7KLFnYdvAeZA
599 |
600 |
601 |
602 | 180798015096
603 |
604 |
605 | Avatar 3D Blu-ray Panasonic Exclusive, factory sealed, minor box defect.
606 |
607 |
608 | 49.0
609 |
610 |
611 | 0.0
612 |
613 |
614 | 0
615 |
616 | 0
617 |
618 | 2012-01-22T19:53:02.000-07:00
619 |
620 | SmeZSdGGu_jOcIPVFQpAVQFA
621 |
622 |
623 |
624 | 160717564858
625 |
626 |
627 | Avatar 3D SEALED Blu-ray Panasonic Exclusive
628 |
629 | 31.0
630 |
631 |
632 | 0.0
633 |
634 |
635 | 12
636 |
637 | 0
638 |
639 | 2012-01-22T20:07:34.000-07:00
640 |
641 | SmiWNF8nl9ntob9GViXnyBBA
642 |
643 |
644 |
645 | 220932049647
646 |
647 |
648 | AVATAR 3D BLU-RAY~BRAND NEW~FACTORY SEALED IN SHRINK~PANASONIC PROMO EXCLUSIVE!!
649 |
650 |
651 | 109.99
652 |
653 |
654 | 120.99
655 |
656 |
657 | 0
658 |
659 | 300
660 |
661 | 2012-01-22T23:01:04.000-07:00
662 |
663 | SmBH2AwKhfOLm0BP7eXlEhNA
664 |
665 |
666 |
667 | 180800257998
668 |
669 |
670 | Avatar Blu-Ray 3D Limited Release Promo Disc - Factory Sealed
671 |
672 | 89.0
673 |
674 |
675 | 89.0
676 |
677 |
678 | 0
679 |
680 | 0
681 |
682 | 2012-01-26T10:27:27.000-07:00
683 |
684 | Sm0gVHFWw_MaLbyOMYjwaiog
685 |
686 |
687 |
688 | 120844739120
689 |
690 |
691 | Avatar 3D Blu Ray Factory Sealed Incl. Two 3D Glasses !!
692 |
693 | 79.0
694 |
695 |
696 | 0.0
697 |
698 |
699 | 13
700 |
701 | 0
702 | -2147481148
703 | 268435456
704 |
705 | 2012-01-23T09:38:20.000-07:00
706 |
707 | SmbzRQ-rZ_MKXYvTkoispOVw
708 |
709 |
710 |
711 | 140683495269
712 |
713 |
714 | New AVATAR Blu-ray 3D Panasonic Exclusive *NOT SOLD IN STORES*
715 |
716 | 32.91
717 |
718 |
719 | 99.0
720 |
721 |
722 | 2
723 |
724 | 0
725 |
726 | 2012-01-23T15:02:11.000-07:00
727 |
728 | SmZ4iQNLIAiTz0o_0j3bIW9w
729 |
730 |
731 |
732 | 170765774879
733 |
734 |
735 | Avatar 3D Blu-ray Panasonic Exclusive - Not available in stores!
736 |
737 | 31.93
738 |
739 |
740 | 0.0
741 |
742 |
743 | 20
744 |
745 | 0
746 |
747 | 2012-01-23T15:13:47.000-07:00
748 |
749 | SmbSQ1lnQYPcCfvpfpvToS8A
750 |
751 |
752 |
753 | 180798565141
754 |
755 |
756 | Avatar 3D Blu-Ray - BRAND NEW and SEALED - Panasonic Exclusive 3 D BluRay
757 |
758 |
759 | 33.93
760 |
761 |
762 | 0.0
763 |
764 |
765 | 11
766 |
767 | 0
768 |
769 | 2012-01-23T17:47:14.000-07:00
770 |
771 | SmvZYYqQS_evOSt3pDfMno8Q
772 |
773 |
774 |
775 | 110810440275
776 |
777 |
778 | AVATAR 3D Blu-ray Brand New Factory Sealed ñ FREE SHIPPING!
779 |
780 | 58.99
781 |
782 |
783 | 0.0
784 |
785 |
786 | 22
787 |
788 | 0
789 |
790 | 2012-01-23T17:57:52.000-07:00
791 |
792 | SmBi99v66zqHKYkKvIAJ9pQA
793 |
794 |
795 |
796 | 190628845216
797 |
798 |
799 | AVATAR 3D Blu-Ray - Panasonic Exclusive - FACTORY SEALED - Free Shipping
800 |
801 |
802 | 31.0
803 |
804 |
805 | 0.0
806 |
807 |
808 | 6
809 |
810 | 0
811 |
812 | 2012-01-23T19:51:19.000-07:00
813 |
814 | SmE2rnqwwG4Ox7y9QPAZwmDA
815 |
816 |
817 |
818 | 320831486088
819 |
820 |
821 | Avatar 3D Blu-Ray NEW Factory Sealed - Panasonic Exclusive - FREE SHIPPING
822 |
823 |
824 | 50.0
825 |
826 |
827 | 0.0
828 |
829 |
830 | 2
831 |
832 | 0
833 |
834 | 2012-01-23T21:10:17.000-07:00
835 |
836 | Smp2gxOJCJH8Wm7P4n6akm1Q
837 |
838 |
839 |
840 | 260937208793
841 |
842 |
843 | 3D Avatar 3D Blu-ray 3D bluray 3D blu ray Brand new sealed NIB new in box
844 |
845 |
846 | 90.0
847 |
848 |
849 | 120.0
850 |
851 |
852 | 0
853 |
854 | 300
855 | 200
856 | 500
857 |
858 | 2012-01-24T09:58:40.000-07:00
859 |
860 | SmKwKZry-47DifBrUXtAjLIA
861 |
862 |
863 |
864 | 290659864842
865 |
866 |
867 | Avatar 3D Blu Ray Panasonic Exclusive Sealed Promo DTS-HD 5.1 Master
868 |
869 | 26.0
870 |
871 |
872 | 0.0
873 |
874 |
875 | 7
876 |
877 | 0
878 | -2147483148
879 | 2
880 |
881 | 2012-01-24T11:52:45.000-07:00
882 |
883 | Smc5ACn355MwQ36-8qVhYJMA
884 |
885 |
886 |
887 | 120845375724
888 |
889 |
890 | Avatar Blu-Ray 3D Panasonic Exclusive Movie Brand New Sealed
891 |
892 | 80.0
893 |
894 |
895 | 0.0
896 |
897 |
898 | 0
899 |
900 | 300
901 |
902 | 2012-01-24T12:15:28.000-07:00
903 |
904 | SmTRKrb5snFcN629amftoz5g
905 |
906 |
907 |
908 | 170766323196
909 |
910 |
911 | Avatar 3D Blu-ray Brand New Factory Sealed
912 |
913 | 26.0
914 |
915 |
916 | 0.0
917 |
918 |
919 | 8
920 |
921 | 0
922 |
923 | 2012-01-24T17:32:24.000-07:00
924 |
925 | Smeip7wxKlFhh3GztuS7jkiA
926 |
927 |
928 |
929 | 220936324950
930 |
931 |
932 | AVATAR 3D BLU-RAY~BRAND NEW~FACTORY SEALED IN SHRINK~PANASONIC PROMO EXCLUSIVE!!
933 |
934 |
935 | 89.99
936 |
937 |
938 | 99.99
939 |
940 |
941 | 0
942 |
943 | 300
944 |
945 | 2012-01-24T18:15:10.000-07:00
946 |
947 | Sm_JHQtAx3TZEDGP0Lw6ObpA
948 |
949 |
950 |
951 | 320831969924
952 |
953 |
954 | AVATAR 3D Blu Ray (Original Panasonic Exclusive) - Like NEW
955 |
956 | 40.0
957 |
958 |
959 | 86.0
960 |
961 |
962 | 1
963 |
964 | 300
965 |
966 | 2012-01-24T20:26:55.000-07:00
967 |
968 | Smnzp3FhNin5GcqoftqekADg
969 |
970 |
971 |
972 | 150738091689
973 |
974 |
975 | New RARE Avatar Blu-ray Blu Ray 3-D 3 D Panasonic Exclusive NOT SOLD IN STORES
976 |
977 |
978 | 199.99
979 |
980 |
981 | 199.99
982 |
983 |
984 | 0
985 |
986 | 0
987 | -2147482303
988 | 268435456
989 | -2147480098
990 | 268435456
991 |
992 | 2012-01-22T16:26:56.000-07:00
993 |
994 | SmuB9oGX7_insOHm5Wm1mtPA
995 |
996 |
997 |
998 | 200697624093
999 |
1000 |
1001 | New Avatar 3D Blu-Ray Panasonic Exclusive Factory Sealed New
1002 |
1003 | 105.0
1004 |
1005 |
1006 | 105.0
1007 |
1008 |
1009 | 1
1010 |
1011 | 0
1012 | 0
1013 |
1014 | 2012-02-06T13:17:53.000-07:00
1015 |
1016 | Sm4Ih4QKzC5nfe3TenzzSiSA
1017 |
1018 |
1019 |
1020 | 320832354417
1021 |
1022 |
1023 | Avatar 3-d Blu Ray With Sony Blu Ray Player
1024 |
1025 | 150.0
1026 |
1027 |
1028 | 0.0
1029 |
1030 |
1031 | 0
1032 |
1033 | 300
1034 |
1035 | 2012-01-25T12:33:27.000-07:00
1036 |
1037 | SmQ-meY-Gw-I--dGgWe4aNdA
1038 |
1039 |
1040 |
1041 | 320832387656
1042 |
1043 |
1044 | James Cameron's AVATAR Exclusive Blu-Ray 3D **FACTORY SEALED**
1045 |
1046 | 85.0
1047 |
1048 |
1049 | 0.0
1050 |
1051 |
1052 | 0
1053 |
1054 | 0
1055 |
1056 | 2012-01-25T13:20:30.000-07:00
1057 |
1058 | Sm-_Y6j0vHctWYksalN84VFw
1059 |
1060 |
1061 |
1062 | 320832469688
1063 |
1064 |
1065 | Avatar Blu-ray 3D
1066 |
1067 | 39.99
1068 |
1069 |
1070 | 0.0
1071 |
1072 |
1073 | 0
1074 |
1075 | 241
1076 |
1077 | 2012-01-25T16:09:30.000-07:00
1078 |
1079 | Sme85gcM76LwgS-iccLJrT7g
1080 |
1081 |
1082 |
1083 | 110811394468
1084 |
1085 |
1086 | NEW- AVATAR 3D Blu-Ray Movie- PANASONIC EXCLUSIVE & FACTORY SEALED!!
1087 |
1088 |
1089 | 31.0
1090 |
1091 |
1092 | 95.0
1093 |
1094 |
1095 | 3
1096 |
1097 | 0
1098 |
1099 | 2012-01-25T20:47:13.000-07:00
1100 |
1101 | Sml7KjYSTL-Pw446Zcx9UrNw
1102 |
1103 |
1104 |
1105 | 190629134325
1106 |
1107 |
1108 | AVATAR 3D BLU-RAY DISC Panasonic Exclusive, Factory Sealed Dolby Digital DTS-HD
1109 |
1110 |
1111 | 104.95
1112 |
1113 |
1114 | 104.95
1115 |
1116 |
1117 | 0
1118 |
1119 | 0
1120 |
1121 | 2012-02-16T17:03:33.000-07:00
1122 |
1123 | SmDZ8RlMIjDvlEW3KUibzj2Q
1124 |
1125 |
1126 | US_DVD_HD_DVD_Blu_ray
1127 | 108.0
1128 | 100.0
1129 | 90.24579692259518
1130 |
1131 | 157204
1132 |
--------------------------------------------------------------------------------
/test/fixtures/null-properties-ignored.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/fixtures/null-properties-not-ignored.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/fixtures/null-properties.json:
--------------------------------------------------------------------------------
1 | {"subObject": {"propertyNotNull": "value","propertyNull":null}}
--------------------------------------------------------------------------------
/test/fixtures/reorder.json:
--------------------------------------------------------------------------------
1 | {"parent":{"parent_property":"bar","child":{"child_property":"foo"}}}
--------------------------------------------------------------------------------
/test/fixtures/reorder.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/fixtures/spacetext.json:
--------------------------------------------------------------------------------
1 | {"doc":{"Column":[{"Name":"shit","Value":{"type":"STRING","$t":" abc\nasdf\na "}},{"Name":"foo","Value":{"type":"STRING"}},{"Name":"foo2","Value":{"type":"STRING"}},{"Name":"bar","Value":{"type":"STRING","$t":" "}},{"PK":"true","Name":"uid","Value":{"type":"STRING","$t":"god"}}]}}
--------------------------------------------------------------------------------
/test/fixtures/spacetext.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | shit
4 | abc
5 | asdf
6 | a
7 |
8 |
9 | foo
10 | foo2
11 | bar
12 | uidgod
13 |
14 |
15 |
--------------------------------------------------------------------------------
/test/fixtures/xmlsanitize.json:
--------------------------------------------------------------------------------
1 | {"e":{"a":{"b":"<\"Smith\" & 'Son'>","$t":"Movers & Shakers Extraordinaire #()\"'"}}}
--------------------------------------------------------------------------------
/test/fixtures/xmlsanitize.xml:
--------------------------------------------------------------------------------
1 | Movers & <b>Shakers</b> Extraordinaire #()"'
--------------------------------------------------------------------------------
/test/fixtures/xmlsanitize2.json:
--------------------------------------------------------------------------------
1 | {"e":{"$t":"Smith & Son"}}
--------------------------------------------------------------------------------
/test/fixtures/xmlsanitize2.xml:
--------------------------------------------------------------------------------
1 | <b>Smith</b> & <b>Son</b>
--------------------------------------------------------------------------------
/test/fixtures/xmlsanitize3.json:
--------------------------------------------------------------------------------
1 | {"e":{"$t":"<b>Smith</b> &"}}
--------------------------------------------------------------------------------
/test/fixtures/xmlsanitize3.xml:
--------------------------------------------------------------------------------
1 | <b>Smith</b> &
--------------------------------------------------------------------------------
/test/test-reorder.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 | var path = require('path');
3 | var parser = require('../lib');
4 | var assert = require('assert');
5 |
6 | var data = fs.readFileSync('./fixtures/reorder.json');
7 | var result = parser.toXml(data);
8 | console.log(result);
9 |
10 | var expected = fs.readFileSync('./fixtures/reorder.xml') + '';
11 |
12 | if (expected) {
13 | expected = expected.trim();
14 | }
15 |
16 | //console.log(result + '<---');
17 | assert.deepEqual(result, expected, 'reorder.json and reorder.xml are different');
18 | console.log('[json2xml: reoder.json -> roerder.xml] passed!');
19 |
--------------------------------------------------------------------------------
/test/test-space.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 | var path = require('path');
3 | var parser = require('../lib');
4 | var assert = require('assert');
5 |
6 | var xml = fs.readFileSync(__dirname + '/fixtures/spacetext.xml');
7 | var json = parser.toJson(xml, {object: true, space: true});
8 | console.log('xml => json: \n%j', json);
9 |
10 | console.log('---------------------\njson => xml: \n%j\n',
11 | parser.toXml(fs.readFileSync(__dirname + '/fixtures/spacetext.json')));
12 | function eql(a, b) {
13 | for (var k in a) {
14 | assert.deepEqual(a[k], b[k], JSON.stringify(a) + ' should equal ' + JSON.stringify(b));
15 | }
16 | }
17 |
18 | assert.deepEqual(json.doc.Column.length, 5, 'should have 5 Columns');
19 | eql(json.doc.Column[0], {Name: 'shit', Value: {type: 'STRING', $t: ' abc\nasdf\na '}});
20 | eql(json.doc.Column[1], {Name: 'foo', Value: {type: 'STRING'}});
21 | eql(json.doc.Column[2], {Name: 'foo2', Value: {type: 'STRING'}});
22 | eql(json.doc.Column[3], {Name: 'bar', Value: {type: 'STRING', $t: ' '}});
23 | eql(json.doc.Column[4], {PK: 'true', Name: 'uid', Value: {type: 'STRING', $t: 'god'}});
24 |
25 | console.log('xml2json options.space passed!');
26 |
--------------------------------------------------------------------------------
/test/test-xmlsanitize.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 | var path = require('path');
3 | var parser = require('../lib');
4 | var assert = require('assert');
5 |
6 | var expected = fs.readFileSync(__dirname + '/fixtures/xmlsanitize.xml', {encoding: 'utf8'});
7 | //console.log("expected: " + expected)
8 | var json = parser.toJson(expected, {object: true, space: true});
9 | //console.log('xml => json: \n%j', json);
10 |
11 | var xmlres = parser.toXml(json, { sanitize: true });
12 | //console.log(xmlres)
13 | //assert.deepEqual(json.doc.Column.length, 5, 'should have 5 Columns');
14 | assert.strictEqual(expected, xmlres, 'xml strings not equal!')
15 |
16 | console.log('xml2json toXml sanitize passed!');
17 |
--------------------------------------------------------------------------------
/test/test.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 | var path = require('path');
3 | var parser = require(__dirname + '/../lib');
4 | var assert = require('assert');
5 |
6 | var Code = require('code');
7 | var Lab = require('lab');
8 |
9 |
10 | // Test shortcuts
11 |
12 | var lab = exports.lab = Lab.script();
13 | var expect = Code.expect;
14 | var describe = lab.describe;
15 | var it = lab.test;
16 |
17 | var internals = {};
18 |
19 |
20 | describe('xml2json', function () {
21 |
22 | it('converts with array-notation', function () {
23 |
24 | var xml = internals.readFixture('array-notation.xml');
25 | var result = parser.toJson(xml, { arrayNotation: true });
26 | var json = internals.readFixture('array-notation.json');
27 |
28 | expect(result).to.equal(json);
29 |
30 | return Promise.resolve();
31 | });
32 |
33 | it('coerces', function () {
34 |
35 | var xml = internals.readFixture('coerce.xml');
36 | var result = parser.toJson(xml, { coerce: false });
37 | var json = internals.readFixture('coerce.json');
38 |
39 | expect(result + '\n').to.equal(json);
40 |
41 | return Promise.resolve();
42 | });
43 |
44 | it('handles domain', function () {
45 |
46 | var xml = internals.readFixture('domain.xml');
47 | var result = parser.toJson(xml, { coerce: false });
48 | var json = internals.readFixture('domain.json');
49 |
50 | expect(result + '\n').to.equal(json);
51 |
52 | return Promise.resolve();
53 | });
54 |
55 | it('does large file', function () {
56 |
57 | var xml = internals.readFixture('large.xml');
58 | var result = parser.toJson(xml, { coerce: false, trim: true, sanitize: false });
59 | var json = internals.readFixture('large.json');
60 |
61 | expect(result + '\n').to.equal(json);
62 |
63 | return Promise.resolve();
64 | });
65 |
66 | it('handles reorder', function () {
67 |
68 | var xml = internals.readFixture('reorder.xml');
69 | var result = parser.toJson(xml, {});
70 | var json = internals.readFixture('reorder.json');
71 |
72 | expect(result).to.equal(json);
73 |
74 | return Promise.resolve();
75 | });
76 |
77 | it('handles text with space', function () {
78 |
79 | var xml = internals.readFixture('spacetext.xml');
80 | var result = parser.toJson(xml, { coerce: false, trim: false });
81 | var json = internals.readFixture('spacetext.json');
82 |
83 | expect(result).to.equal(json);
84 |
85 | return Promise.resolve();
86 | });
87 |
88 | it('does xmlsanitize', function () {
89 |
90 | var xml = internals.readFixture('xmlsanitize.xml');
91 | var result = parser.toJson(xml, {sanitize: true});
92 | var json = internals.readFixture('xmlsanitize.json');
93 |
94 | expect(result).to.equal(json);
95 |
96 | return Promise.resolve();
97 | });
98 |
99 | it('does xmlsanitize of text', function () {
100 |
101 | var xml = internals.readFixture('xmlsanitize2.xml');
102 | var result = parser.toJson(xml, {sanitize: true, reversible: true});
103 | var json = internals.readFixture('xmlsanitize2.json');
104 |
105 | expect(result).to.equal(json);
106 |
107 | return Promise.resolve();
108 | });
109 |
110 | it('does json unsanitize', function () {
111 |
112 | var json = internals.readFixture('xmlsanitize.json');
113 | var result = parser.toXml(json, {sanitize: true});
114 | var xml = internals.readFixture('xmlsanitize.xml');
115 |
116 | expect(result).to.equal(xml);
117 |
118 | return Promise.resolve();
119 | });
120 |
121 | it('does json unsanitize of text', function () {
122 |
123 | var json = internals.readFixture('xmlsanitize2.json');
124 | var result = parser.toXml(json, {sanitize: true});
125 | var xml = internals.readFixture('xmlsanitize2.xml');
126 |
127 | expect(result).to.equal(xml);
128 |
129 | return Promise.resolve();
130 | });
131 |
132 | it('does doesnt double sanitize', function () {
133 |
134 | var json = internals.readFixture('xmlsanitize3.json');
135 | var result = parser.toXml(json, {sanitize: true});
136 | var xml = internals.readFixture('xmlsanitize3.xml');
137 |
138 | expect(result).to.equal(xml);
139 |
140 | return Promise.resolve();
141 | });
142 |
143 | it('does doesnt double unsanitize', function () {
144 |
145 | var xml = internals.readFixture('xmlsanitize3.xml');
146 | var result = parser.toJson(xml, {sanitize: true, reversible: true});
147 | var json = internals.readFixture('xmlsanitize3.json');
148 |
149 | expect(result).to.equal(json);
150 | return Promise.resolve();
151 | });
152 |
153 | it('converts with forceArrays', function() {
154 | var xml = internals.readFixture('forceArray.xml');
155 | var result = parser.toJson(xml, {arrayNotation: ['drivers', 'vehicles']});
156 | var json = internals.readFixture('forceArray.json');
157 |
158 | expect(result).to.equal(json);
159 | return Promise.resolve();
160 | });
161 |
162 | it('throws error on bad options', function () {
163 |
164 | var throws = function() {
165 |
166 | var result = parser.toJson(xml, { derp: true});
167 | };
168 |
169 | expect(throws).to.throw();
170 | return Promise.resolve();
171 | });
172 |
173 | describe('coercion', function () {
174 |
175 | var file = __dirname + '/fixtures/coerce.xml';
176 | var data = fs.readFileSync(file);
177 |
178 | it('works with coercion', function() {
179 |
180 | // With coercion
181 | var result = parser.toJson(data, {reversible: true, coerce: true, object: true});
182 | expect(result.itemRecord.value[0].longValue['$t']).to.equal(12345);
183 | expect(result.itemRecord.value[1].stringValue.number).to.equal(false);
184 | expect(result.itemRecord.value[2].moneyValue.number).to.equal(true);
185 | expect(result.itemRecord.value[2].moneyValue['$t']).to.equal(104.95);
186 | expect(result.itemRecord.value[2].moneyValue.text).to.equal(123.45);
187 | expect(result.itemRecord.value[8].text['$t']).to.equal(42.42);
188 | return Promise.resolve();
189 | });
190 |
191 | it('works without coercion', function() {
192 |
193 | var result = parser.toJson(data, {reversible: true, coerce: false, object: true});
194 | expect(result.itemRecord.value[0].longValue['$t']).to.equal('12345');
195 | expect(result.itemRecord.value[1].stringValue.number).to.equal('false');
196 | expect(result.itemRecord.value[2].moneyValue.number).to.equal('true');
197 | expect(result.itemRecord.value[2].moneyValue['$t']).to.equal('104.95');
198 | expect(result.itemRecord.value[2].moneyValue.text).to.equal('123.45');
199 | expect(result.itemRecord.value[8].text['$t']).to.equal('42.42');
200 | return Promise.resolve();
201 | });
202 |
203 | it('works with coercion as an optional object', function() {
204 |
205 | var result = parser.toJson(data, {reversible: true, coerce: {text:String}, object: true});
206 | expect(result.itemRecord.value[0].longValue['$t']).to.equal(12345);
207 | expect(result.itemRecord.value[1].stringValue.number).to.equal(false);
208 | expect(result.itemRecord.value[2].moneyValue.number).to.equal(true);
209 | expect(result.itemRecord.value[2].moneyValue['$t']).to.equal(104.95);
210 | expect(result.itemRecord.value[2].moneyValue.text).to.equal('123.45');
211 | expect(result.itemRecord.value[8].text['$t']).to.equal('42.42');
212 | return Promise.resolve();
213 | });
214 | })
215 |
216 | describe('alternateTextNode', function () {
217 |
218 | it('A1: defaults without the option being defined', function() {
219 |
220 | var xml = internals.readFixture('alternate-text-node-A.xml');
221 | var result = parser.toJson(xml, {reversible: true});
222 | var json = internals.readFixture('alternate-text-node-A.json');
223 |
224 | expect(result).to.equal(json);
225 |
226 | return Promise.resolve();
227 | });
228 |
229 | it('A2: defaults with option as false', function() {
230 |
231 | var xml = internals.readFixture('alternate-text-node-A.xml');
232 | var result = parser.toJson(xml, {alternateTextNode: false, reversible: true});
233 | var json = internals.readFixture('alternate-text-node-A.json');
234 |
235 | expect(result).to.equal(json);
236 |
237 | return Promise.resolve();
238 | });
239 |
240 |
241 | it('B: uses alternate text node with option as true', function() {
242 |
243 | var xml = internals.readFixture('alternate-text-node-A.xml');
244 | var result = parser.toJson(xml, {alternateTextNode: true, reversible: true});
245 | var json = internals.readFixture('alternate-text-node-B.json');
246 |
247 | expect(result).to.equal(json);
248 |
249 | return Promise.resolve();
250 | });
251 |
252 | it('C: overrides text node with option as "xx" string', function() {
253 |
254 | var xml = internals.readFixture('alternate-text-node-A.xml');
255 | var result = parser.toJson(xml, {alternateTextNode: "xx", reversible: true});
256 | var json = internals.readFixture('alternate-text-node-C.json');
257 |
258 | expect(result).to.equal(json);
259 |
260 | return Promise.resolve();
261 | });
262 |
263 | it('D: double check sanatize and trim', function () {
264 |
265 | var xml = internals.readFixture('alternate-text-node-D.xml');
266 | var result = parser.toJson(xml, {alternateTextNode: "zz", sanitize: true, trim: true, reversible: true});
267 | var json = internals.readFixture('alternate-text-node-D.json');
268 |
269 | expect(result).to.equal(json);
270 |
271 | return Promise.resolve();
272 | });
273 |
274 | })
275 | });
276 |
277 |
278 | describe('json2xml', function () {
279 |
280 | it('converts domain to json', function () {
281 |
282 | var json = internals.readFixture('domain-reversible.json');
283 | var result = parser.toXml(json);
284 | var xml = internals.readFixture('domain.xml');
285 |
286 | expect(result+'\n').to.equal(xml);
287 |
288 | return Promise.resolve();
289 | });
290 |
291 | it('works with array notation', function () {
292 |
293 | var xml = internals.readFixture('array-notation.xml');
294 | var expectedJson = JSON.parse( internals.readFixture('array-notation.json') );
295 |
296 | var json = parser.toJson(xml, {object: true, arrayNotation: true});
297 |
298 | expect(json).to.equal(expectedJson);
299 |
300 | return Promise.resolve();
301 | });
302 |
303 | describe('ignore null', function () {
304 |
305 | it('ignore null properties {ignoreNull: true}', function () {
306 |
307 | var json = JSON.parse( internals.readFixture('null-properties.json') );
308 | var expectedXml = internals.readFixture('null-properties-ignored.xml');
309 |
310 | var xml = parser.toXml(json, {ignoreNull: true});
311 | expect(xml).to.equal(expectedXml);
312 |
313 | return Promise.resolve();
314 | });
315 |
316 | it('don\'t ignore null properties (default)', function () {
317 |
318 | var json = JSON.parse( internals.readFixture('null-properties.json') );
319 | var expectedXml = internals.readFixture('null-properties-not-ignored.xml');
320 |
321 | var xml = parser.toXml(json);
322 | expect(xml).to.equal(expectedXml);
323 |
324 | return Promise.resolve();
325 | });
326 |
327 | });
328 | });
329 |
330 |
331 | internals.readFixture = function (file) {
332 |
333 | return fs.readFileSync(__dirname + '/fixtures/' + file, { encoding: 'utf-8' });
334 | };
335 |
--------------------------------------------------------------------------------