xml-toolkit 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/lib/XMLMarshaller.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -57,6 +57,8 @@ let xmlResult = ''; for await (const node of new XMLReader ().process (xmlSource
|
|
|
57
57
|
* [Serializing an Object According to an XML Schema](https://github.com/do-/node-xml-toolkit/wiki/Use-Case:-Serializing-an-Object-According-to-an-XML-Schema)
|
|
58
58
|
|
|
59
59
|
```js
|
|
60
|
+
const {XMLSchemata} = require ('xml-toolkit')
|
|
61
|
+
|
|
60
62
|
const data = {ExportDebtRequestsResponse: {
|
|
61
63
|
"request-data": {
|
|
62
64
|
// ...
|
package/lib/XMLMarshaller.js
CHANGED
|
@@ -178,7 +178,9 @@ const XMLMarshaller = class {
|
|
|
178
178
|
if (v.length === 10) return v
|
|
179
179
|
case 'number':
|
|
180
180
|
case 'bigint':
|
|
181
|
-
|
|
181
|
+
const d = new Date (v)
|
|
182
|
+
if (isNaN (d)) carp ()
|
|
183
|
+
v = d
|
|
182
184
|
}
|
|
183
185
|
if (v instanceof Date) {
|
|
184
186
|
return v.toJSON ().slice (0, 10)
|