Comparing version 1.6.1 to 1.6.2
var helper = require('./options-helper'); | ||
var isArray = require('./array-helper').isArray; | ||
@@ -284,3 +285,3 @@ var currentElement, currentElementName; | ||
if (element.hasOwnProperty(key)) { | ||
nodes = element[key] instanceof Array ? element[key] : [element[key]]; | ||
nodes = isArray(element[key]) ? element[key] : [element[key]]; | ||
for (i = 0; i < nodes.length; ++i) { | ||
@@ -287,0 +288,0 @@ switch (key) { |
var sax = require('sax'); | ||
var expat /*= require('node-expat');*/ = { on: function () { }, parse: function () { } }; | ||
var helper = require('./options-helper'); | ||
var isArray = require('./array-helper').isArray; | ||
@@ -71,3 +72,3 @@ var options; | ||
} | ||
if (currentElement[options[type + 'Key']] && !(currentElement[options[type + 'Key']] instanceof Array)) { | ||
if (currentElement[options[type + 'Key']] && !isArray(currentElement[options[type + 'Key']])) { | ||
currentElement[options[type + 'Key']] = [currentElement[options[type + 'Key']]]; | ||
@@ -91,3 +92,3 @@ } | ||
} | ||
if (currentElement[options[type + 'Key']] instanceof Array) { | ||
if (isArray(currentElement[options[type + 'Key']])) { | ||
currentElement[options[type + 'Key']].push(value); | ||
@@ -218,6 +219,6 @@ } else { | ||
} | ||
if (currentElement[name] && !(currentElement[name] instanceof Array)) { | ||
if (currentElement[name] && !isArray(currentElement[name])) { | ||
currentElement[name] = [currentElement[name]]; | ||
} | ||
if (currentElement[name] instanceof Array) { | ||
if (isArray(currentElement[name])) { | ||
currentElement[name].push(element); | ||
@@ -224,0 +225,0 @@ } else { |
{ | ||
"name": "xml-js", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"description": "A convertor between XML text and Javascript object / JSON text.", | ||
@@ -46,14 +46,20 @@ "repository": { | ||
"scripts": { | ||
"build": "webpack", | ||
"doc": "node doc/compile-doc.js", | ||
"watch:doc": "watch \"npm run doc\" doc/templates/", | ||
"live:doc": "browser-sync start --port 9996 --server doc/ --files doc/templates/ --no-open --no-ui --no-online", | ||
"open:doc": "biased-opener --browser chrome http://localhost:9997", | ||
"debug": "nodemon --inspect --watch lib/ --watch test/ --debug-brk test/index.js", | ||
"debug:cli": "nodemon --inspect --watch lib/ --debug-brk index.js -- --help", | ||
"jest": "jest --config=test/jest.conf.js", | ||
"jasmine": "jasmine JASMINE_CONFIG_PATH=./test/jasmine.json", | ||
"watch:jasmine": "watch \"npm run jasmine\" lib/ test/", | ||
"bundle:jasmine": "globify test/*_test.js --watch --verbose --list --outfile test/browse-jasmine/bundle.js", | ||
"bundle:jasmine": "globify test/*.spec.js --watch --verbose --list --outfile test/browse-jasmine/bundle.js", | ||
"live:jasmine": "browser-sync start --port 9999 --server test/browse-jasmine/ --files test/browse-jasmine/ --no-open --no-ui --no-online", | ||
"open-help": "biased-opener --help", | ||
"open:jasmine": "biased-opener --browser chrome http://localhost:9999", | ||
"istanbul-original": "istanbul cover --dir test/browse-coverage -x test/browse-** test/index.js", | ||
"istanbul": "istanbul cover --dir test/browse-coverage test/index.js", | ||
"istanbul-original": "istanbul cover --dir test/coverage-jasmine -x test/browse-** test/index.js", | ||
"istanbul": "istanbul cover --dir test/coverage-jasmine test/index.js", | ||
"watch:istanbul": "watch \"npm run istanbul\" lib/ test/ --ignoreDirectoryPattern=/browse-.+/", | ||
"live:istanbul": "browser-sync start --port 9998 --server test/browse-coverage/lcov-report/ --files test/browse-coverage/lcov-report/ --no-open --no-ui --no-online", | ||
"live:istanbul": "browser-sync start --port 9998 --server test/coverage-jasmine/lcov-report/ --files test/coverage-jasmine/lcov-report/ --no-open --no-ui --no-online", | ||
"open:istanbul": "biased-opener --browser chrome http://localhost:9998", | ||
@@ -67,6 +73,6 @@ "live": "npm-run-all --parallel live:* open:*", | ||
"coverage:a-step": "npm run istanbul", | ||
"coverage:coveralls": "cat ./test/browse-coverage/lcov.info | coveralls", | ||
"coverage:coveralls": "cat ./test/coverage-jasmine/lcov.info | coveralls", | ||
"coverage:codecov": "codecov --token=0e52af41-702b-4d7f-8aa3-61145ac36624", | ||
"coverage:codacy": "cross-env CODACY_PROJECT_TOKEN=0207815122ea49a68241d1aa435f21f1 && cat ./test/browse-coverage/lcov.info | codacy-coverage", | ||
"coverage:codeclimate": "cross-env CODECLIMATE_REPO_TOKEN=60848a077f9070acf358b0c7145f0a2698a460ddeca7d8250815e75aa4333f7d codeclimate-test-reporter < test\\browse-coverage\\lcov.info", | ||
"coverage:codacy": "cross-env CODACY_PROJECT_TOKEN=0207815122ea49a68241d1aa435f21f1 && cat ./test/coverage-jasmine/lcov.info | codacy-coverage", | ||
"coverage:codeclimate": "cross-env CODECLIMATE_REPO_TOKEN=60848a077f9070acf358b0c7145f0a2698a460ddeca7d8250815e75aa4333f7d codeclimate-test-reporter < test\\coverage-jasmine\\lcov.info", | ||
"prepublish": "npm run test", | ||
@@ -80,2 +86,5 @@ "test": "npm run jasmine && npm run test:types", | ||
"devDependencies": { | ||
"babel-core": "^6.26.0", | ||
"babel-loader": "^7.1.2", | ||
"babel-preset-env": "^1.6.1", | ||
"biased-opener": "^0.2.8", | ||
@@ -93,8 +102,13 @@ "browser-sync": "^2.18.13", | ||
"jasmine": "^2.8.0", | ||
"jest": "^20.0.4", | ||
"jest-cli": "^20.0.4", | ||
"jsonpath": "^1.0.0", | ||
"nodemon": "^1.13.3", | ||
"npm-run-all": "^4.1.2", | ||
"prismjs": "^1.9.0", | ||
"typescript": "^2.6.2", | ||
"watch": "^1.0.1" | ||
"unminified-webpack-plugin": "^1.4.2", | ||
"watch": "^1.0.1", | ||
"webpack": "^3.10.0" | ||
} | ||
} |
@@ -0,0 +0,0 @@ ![XML ⇔ JS/JSON](http://nashwaan.github.io/xml-js/images/logo.svg) |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
196017
3664
25
1