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

xmlbuilder2

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xmlbuilder2 - npm Package Compare versions

Comparing version 1.4.2 to 1.4.3

11

CHANGELOG.md

@@ -5,2 +5,11 @@ # Change Log

## [1.4.3] - 2020-03-03
- `keepNullNodes` and `keepNullAttributes` flags now properly keep `null`
**and** `undefined` values (See [#5](https://github.com/oozcitak/xmlbuilder2/issues/5)).
## [1.4.2] - 2020-03-02
- Added `types` to `package.json` to help IDEs infer types (See [#4](https://github.com/oozcitak/xmlbuilder2/issues/4)).
## [1.4.1] - 2020-02-28

@@ -45,2 +54,4 @@

[1.4.3]: https://github.com/oozcitak/xmlbuilder2/compare/v1.4.2...v1.4.3
[1.4.2]: https://github.com/oozcitak/xmlbuilder2/compare/v1.4.1...v1.4.2
[1.4.1]: https://github.com/oozcitak/xmlbuilder2/compare/v1.4.0...v1.4.1

@@ -47,0 +58,0 @@ [1.4.0]: https://github.com/oozcitak/xmlbuilder2/compare/v1.3.0...v1.4.0

10

lib/builder/XMLBuilderImpl.js

@@ -149,3 +149,3 @@ "use strict";

}
else if (!this._options.keepNullNodes && (val === null)) {
else if (!this._options.keepNullNodes && (val == null)) {
// skip null and undefined nodes

@@ -231,3 +231,3 @@ lastChild = this._dummy();

}
else if (util_1.isString(p1) && (p2 === null || util_1.isString(p2))) {
else if (util_1.isString(p1) && (p2 == null || util_1.isString(p2))) {
// ele(name: string, value: string)

@@ -239,8 +239,8 @@ [namespace, name, value] = [undefined, p1, p2];

}
if (this._options.keepNullAttributes && (value === null)) {
if (this._options.keepNullAttributes && (value == null)) {
// keep null attributes
value = "";
}
else if (value === null) {
// skip null attributes
else if (value == null) {
// skip null|undefined attributes
return this;

@@ -247,0 +247,0 @@ }

@@ -25,9 +25,9 @@ import { Node, Document } from "@oozcitak/dom/lib/dom/interfaces";

/**
* Whether nodes with `null` values will be kept or ignored. Defaults to
* `false`.
* Whether nodes with `null` or `undefined` values will be kept or ignored.
* Defaults to `false`.
*/
keepNullNodes?: boolean;
/**
* Whether attributes with `null` values will be kept or ignored. Defaults to
* `false`.
* Whether attributes with `null` or `undefined` values will be kept or
* ignored. Defaults to `false`.
*/

@@ -34,0 +34,0 @@ keepNullAttributes?: boolean;

{
"name": "xmlbuilder2",
"version": "1.4.2",
"version": "1.4.3",
"keywords": [

@@ -5,0 +5,0 @@ "xml",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc