Socket
Socket
Sign inDemoInstall

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 2.1.1 to 2.1.2

26

CHANGELOG.md

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

## [2.1.2] - 2020-04-09
### Bug Fixes
- Fixed a bug where the `noDoubleEncoding` flag kept named entities other than [those specified in the spec](https://www.w3.org/TR/xml/#sec-predefined-ent) (see [#16](https://github.com/oozcitak/xmlbuilder2/issues/16)).
## [2.1.1] - 2020-04-01

@@ -14,3 +19,3 @@

### Features
- Added the `noDoubleEncoding` option to prevent html entities from being re-encoded when serialized (See [#15](https://github.com/oozcitak/xmlbuilder2/issues/15)).
- Added the `noDoubleEncoding` option to prevent html entities from being re-encoded when serialized (see [#15](https://github.com/oozcitak/xmlbuilder2/issues/15)).

@@ -20,9 +25,9 @@ ## [2.0.0] - 2020-03-30

### Bug Fixes
- Fixed namespace inheritance logic, so that a preferred prefix is not retrieved from a parent element if the element has no prefix and its namespace matches the default namespace declaration (See: https://github.com/web-platform-tests/wpt/pull/16703).
- Namespace declaration attributes from JS objects are now applied correctly to their parent elements (See [#13](https://github.com/oozcitak/xmlbuilder2/issues/13)).
- Fixed namespace inheritance logic, so that a preferred prefix is not retrieved from a parent element if the element has no prefix and its namespace matches the default namespace declaration (see: https://github.com/web-platform-tests/wpt/pull/16703).
- Namespace declaration attributes from JS objects are now applied correctly to their parent elements (see [#13](https://github.com/oozcitak/xmlbuilder2/issues/13)).
### Features
- Narrowed return value types of functions for better intellisense support with TypeScript (See [#14](https://github.com/oozcitak/xmlbuilder2/issues/14)).
- Added `invalidCharReplacement` option to sanitize input strings by replacing invalid characters (See [#12](https://github.com/oozcitak/xmlbuilder2/issues/12)). The option has no defaults and must be configured by the user.
- Narrowed return value types of functions for better intellisense support with TypeScript (see [#14](https://github.com/oozcitak/xmlbuilder2/issues/14)).
- Added `invalidCharReplacement` option to sanitize input strings by replacing invalid characters (see [#12](https://github.com/oozcitak/xmlbuilder2/issues/12)). The option has no defaults and must be configured by the user.
### BREAKING CHANGES
- Removed `inheritNS` options (See [#1](https://github.com/oozcitak/xmlbuilder2/issues/1), [#6](https://github.com/oozcitak/xmlbuilder2/issues/6) and [#13](https://github.com/oozcitak/xmlbuilder2/issues/13)). Element nodes now inherit namespaces from their parent element nodes by default. To reset the default namespace declaration create an `"xmlns"` attribute with an empty value (`""`) as in the DOM.
- Removed `inheritNS` options (see [#1](https://github.com/oozcitak/xmlbuilder2/issues/1), [#6](https://github.com/oozcitak/xmlbuilder2/issues/6) and [#13](https://github.com/oozcitak/xmlbuilder2/issues/13)). Element nodes now inherit namespaces from their parent element nodes by default. To reset the default namespace declaration create an `"xmlns"` attribute with an empty value (`""`) as in the DOM.

@@ -60,3 +65,3 @@ ## [1.8.1] - 2020-03-27

### Bug Fixes
- `keepNullNodes` and `keepNullAttributes` flags now properly keep `null` **and** `undefined` values (See [#5](https://github.com/oozcitak/xmlbuilder2/issues/5)). Without these flags, `null` **and** `undefined` will be silently skipped.
- `keepNullNodes` and `keepNullAttributes` flags now properly keep `null` **and** `undefined` values (see [#5](https://github.com/oozcitak/xmlbuilder2/issues/5)). Without these flags, `null` **and** `undefined` will be silently skipped.

@@ -66,3 +71,3 @@ ## [1.4.2] - 2020-03-02

### Bug Fixes
- Added `types` to `package.json` to help IDEs infer types (See [#4](https://github.com/oozcitak/xmlbuilder2/issues/4)).
- Added `types` to `package.json` to help IDEs infer types (see [#4](https://github.com/oozcitak/xmlbuilder2/issues/4)).

@@ -77,3 +82,3 @@ ## [1.4.1] - 2020-02-28

### Features
- Added callback API (See [#2](https://github.com/oozcitak/xmlbuilder2/issues/2)).
- Added callback API (see [#2](https://github.com/oozcitak/xmlbuilder2/issues/2)).

@@ -100,3 +105,3 @@ ## [1.3.0] - 2020-02-18

### Bug Fixes
- Prevented child element namespaces to be inherited from their parent elements (See [#1](https://github.com/oozcitak/xmlbuilder2/issues/1)).
- Prevented child element namespaces to be inherited from their parent elements (see [#1](https://github.com/oozcitak/xmlbuilder2/issues/1)).
- Fixed JS object parser to allow namespaces for both element nodes and attributes with the `{ "prefix:name@ns": {} }` notation.

@@ -136,1 +141,2 @@

[2.1.1]: https://github.com/oozcitak/xmlbuilder2/compare/v2.1.0...v2.1.1
[2.1.2]: https://github.com/oozcitak/xmlbuilder2/compare/v2.1.1...v2.1.2

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

if (this._options.noDoubleEncoding) {
markup = node.data.replace(/(?!&\S+;)&/g, '&')
markup = node.data.replace(/(?!&(lt|gt|amp|apos|quot);)&/g, '&')
.replace(/</g, '&lt;')

@@ -574,3 +574,3 @@ .replace(/>/g, '&gt;')

if (this._options.noDoubleEncoding) {
return value.replace(/(?!&\S+;)&/g, '&amp;')
return value.replace(/(?!&(lt|gt|amp|apos|quot);)&/g, '&amp;')
.replace(/</g, '&lt;')

@@ -577,0 +577,0 @@ .replace(/"/g, '&quot;')

{
"name": "xmlbuilder2",
"version": "2.1.1",
"version": "2.1.2",
"keywords": [

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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