cdk-comprehend-s3olap 2.0.121 → 2.0.122

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.
Files changed (79) hide show
  1. package/.jsii +4 -4
  2. package/lib/cdk-comprehend-s3olap.js +2 -2
  3. package/lib/comprehend-lambdas.js +2 -2
  4. package/lib/iam-roles.js +4 -4
  5. package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
  6. package/node_modules/@esbuild/linux-x64/package.json +1 -1
  7. package/node_modules/aws-sdk/CHANGELOG.md +9 -1
  8. package/node_modules/aws-sdk/README.md +1 -1
  9. package/node_modules/aws-sdk/apis/connect-2017-08-08.min.json +196 -187
  10. package/node_modules/aws-sdk/apis/marketplace-catalog-2018-09-17.min.json +82 -15
  11. package/node_modules/aws-sdk/apis/mediaconvert-2017-08-29.min.json +56 -32
  12. package/node_modules/aws-sdk/apis/rekognition-2016-06-27.min.json +224 -138
  13. package/node_modules/aws-sdk/clients/connect.d.ts +15 -4
  14. package/node_modules/aws-sdk/clients/ecs.d.ts +24 -24
  15. package/node_modules/aws-sdk/clients/marketplacecatalog.d.ts +67 -7
  16. package/node_modules/aws-sdk/clients/mediaconvert.d.ts +20 -1
  17. package/node_modules/aws-sdk/clients/omics.d.ts +2 -2
  18. package/node_modules/aws-sdk/clients/rekognition.d.ts +114 -16
  19. package/node_modules/aws-sdk/dist/aws-sdk-core-react-native.js +1 -1
  20. package/node_modules/aws-sdk/dist/aws-sdk-react-native.js +2532 -875
  21. package/node_modules/aws-sdk/dist/aws-sdk.js +505 -343
  22. package/node_modules/aws-sdk/dist/aws-sdk.min.js +79 -79
  23. package/node_modules/aws-sdk/dist/xml2js.js +2579 -922
  24. package/node_modules/aws-sdk/lib/core.js +1 -1
  25. package/node_modules/aws-sdk/package.json +2 -2
  26. package/node_modules/esbuild/bin/esbuild +1 -1
  27. package/node_modules/esbuild/lib/main.js +8 -8
  28. package/node_modules/esbuild/package.json +23 -23
  29. package/node_modules/xml2js/README.md +108 -7
  30. package/node_modules/xml2js/lib/parser.js +35 -7
  31. package/node_modules/xml2js/lib/xml2js.js +2 -0
  32. package/node_modules/xml2js/node_modules/xmlbuilder/CHANGELOG.md +47 -0
  33. package/node_modules/xml2js/node_modules/xmlbuilder/LICENSE +21 -21
  34. package/node_modules/xml2js/node_modules/xmlbuilder/README.md +86 -85
  35. package/node_modules/xml2js/node_modules/xmlbuilder/appveyor.yml +20 -0
  36. package/node_modules/xml2js/node_modules/xmlbuilder/lib/Derivation.js +10 -0
  37. package/node_modules/xml2js/node_modules/xmlbuilder/lib/DocumentPosition.js +12 -0
  38. package/node_modules/xml2js/node_modules/xmlbuilder/lib/NodeType.js +23 -0
  39. package/node_modules/xml2js/node_modules/xmlbuilder/lib/OperationType.js +11 -0
  40. package/node_modules/xml2js/node_modules/xmlbuilder/lib/Utility.js +11 -1
  41. package/node_modules/xml2js/node_modules/xmlbuilder/lib/WriterState.js +10 -0
  42. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLAttribute.js +86 -9
  43. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLCData.js +10 -6
  44. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLCharacterData.js +79 -0
  45. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLComment.js +10 -6
  46. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js +64 -0
  47. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js +16 -0
  48. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMImplementation.js +32 -0
  49. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMStringList.js +28 -0
  50. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDAttList.js +16 -11
  51. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDElement.js +7 -4
  52. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDEntity.js +49 -8
  53. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDNotation.js +20 -5
  54. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDeclaration.js +5 -2
  55. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocType.js +84 -5
  56. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocument.js +199 -5
  57. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocumentCB.js +165 -39
  58. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocumentFragment.js +24 -0
  59. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDummy.js +31 -0
  60. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLElement.js +207 -20
  61. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js +58 -0
  62. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNode.js +403 -50
  63. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNodeFilter.js +48 -0
  64. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNodeList.js +28 -0
  65. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js +19 -5
  66. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLRaw.js +6 -3
  67. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLStreamWriter.js +94 -197
  68. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLStringWriter.js +6 -305
  69. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLStringifier.js +109 -32
  70. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLText.js +43 -6
  71. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLTypeInfo.js +21 -0
  72. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLUserDataHandler.js +16 -0
  73. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLWriterBase.js +397 -59
  74. package/node_modules/xml2js/node_modules/xmlbuilder/lib/index.js +15 -3
  75. package/node_modules/xml2js/node_modules/xmlbuilder/package.json +5 -3
  76. package/node_modules/xml2js/node_modules/xmlbuilder/typings/index.d.ts +153 -0
  77. package/node_modules/xml2js/package.json +11 -5
  78. package/package.json +4 -4
  79. package/node_modules/xml2js/node_modules/xmlbuilder/.npmignore +0 -5
@@ -20,7 +20,7 @@ AWS.util.update(AWS, {
20
20
  /**
21
21
  * @constant
22
22
  */
23
- VERSION: '2.1353.0',
23
+ VERSION: '2.1354.0',
24
24
 
25
25
  /**
26
26
  * @api private
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aws-sdk",
3
3
  "description": "AWS SDK for JavaScript",
4
- "version": "2.1353.0",
4
+ "version": "2.1354.0",
5
5
  "author": {
6
6
  "name": "Amazon Web Services",
7
7
  "email": "",
@@ -50,7 +50,7 @@
50
50
  "url": "0.10.3",
51
51
  "util": "^0.12.4",
52
52
  "uuid": "8.0.0",
53
- "xml2js": "0.4.19"
53
+ "xml2js": "0.5.0"
54
54
  },
55
55
  "main": "lib/aws.js",
56
56
  "browser": {
@@ -199,7 +199,7 @@ for your current platform.`);
199
199
  "node_modules",
200
200
  ".cache",
201
201
  "esbuild",
202
- `pnpapi-${pkg.replace("/", "-")}-${"0.17.15"}-${path.basename(subpath)}`
202
+ `pnpapi-${pkg.replace("/", "-")}-${"0.17.16"}-${path.basename(subpath)}`
203
203
  );
204
204
  if (!fs.existsSync(binTargetPath)) {
205
205
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -735,8 +735,8 @@ function createChannel(streamIn) {
735
735
  if (isFirstPacket) {
736
736
  isFirstPacket = false;
737
737
  let binaryVersion = String.fromCharCode(...bytes);
738
- if (binaryVersion !== "0.17.15") {
739
- throw new Error(`Cannot start service: Host version "${"0.17.15"}" does not match binary version ${quote(binaryVersion)}`);
738
+ if (binaryVersion !== "0.17.16") {
739
+ throw new Error(`Cannot start service: Host version "${"0.17.16"}" does not match binary version ${quote(binaryVersion)}`);
740
740
  }
741
741
  return;
742
742
  }
@@ -1905,7 +1905,7 @@ for your current platform.`);
1905
1905
  "node_modules",
1906
1906
  ".cache",
1907
1907
  "esbuild",
1908
- `pnpapi-${pkg.replace("/", "-")}-${"0.17.15"}-${path.basename(subpath)}`
1908
+ `pnpapi-${pkg.replace("/", "-")}-${"0.17.16"}-${path.basename(subpath)}`
1909
1909
  );
1910
1910
  if (!fs.existsSync(binTargetPath)) {
1911
1911
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -1940,7 +1940,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1940
1940
  }
1941
1941
  }
1942
1942
  var _a;
1943
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.17.15";
1943
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.17.16";
1944
1944
  var esbuildCommandAndArgs = () => {
1945
1945
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1946
1946
  throw new Error(
@@ -2007,7 +2007,7 @@ var fsAsync = {
2007
2007
  }
2008
2008
  }
2009
2009
  };
2010
- var version = "0.17.15";
2010
+ var version = "0.17.16";
2011
2011
  var build = (options) => ensureServiceIsRunning().build(options);
2012
2012
  var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
2013
2013
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -2117,7 +2117,7 @@ var ensureServiceIsRunning = () => {
2117
2117
  if (longLivedService)
2118
2118
  return longLivedService;
2119
2119
  let [command, args] = esbuildCommandAndArgs();
2120
- let child = child_process.spawn(command, args.concat(`--service=${"0.17.15"}`, "--ping"), {
2120
+ let child = child_process.spawn(command, args.concat(`--service=${"0.17.16"}`, "--ping"), {
2121
2121
  windowsHide: true,
2122
2122
  stdio: ["pipe", "pipe", "inherit"],
2123
2123
  cwd: defaultWD
@@ -2217,7 +2217,7 @@ var runServiceSync = (callback) => {
2217
2217
  esbuild: node_exports
2218
2218
  });
2219
2219
  callback(service);
2220
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.17.15"}`), {
2220
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.17.16"}`), {
2221
2221
  cwd: defaultWD,
2222
2222
  windowsHide: true,
2223
2223
  input: stdin,
@@ -2237,7 +2237,7 @@ var workerThreadService = null;
2237
2237
  var startWorkerThreadService = (worker_threads2) => {
2238
2238
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2239
2239
  let worker = new worker_threads2.Worker(__filename, {
2240
- workerData: { workerPort, defaultWD, esbuildVersion: "0.17.15" },
2240
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.17.16" },
2241
2241
  transferList: [workerPort],
2242
2242
  // From node's documentation: https://nodejs.org/api/worker_threads.html
2243
2243
  //
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild",
3
- "version": "0.17.15",
3
+ "version": "0.17.16",
4
4
  "description": "An extremely fast JavaScript and CSS bundler and minifier.",
5
5
  "repository": "https://github.com/evanw/esbuild",
6
6
  "scripts": {
@@ -15,28 +15,28 @@
15
15
  "esbuild": "bin/esbuild"
16
16
  },
17
17
  "optionalDependencies": {
18
- "@esbuild/android-arm": "0.17.15",
19
- "@esbuild/android-arm64": "0.17.15",
20
- "@esbuild/android-x64": "0.17.15",
21
- "@esbuild/darwin-arm64": "0.17.15",
22
- "@esbuild/darwin-x64": "0.17.15",
23
- "@esbuild/freebsd-arm64": "0.17.15",
24
- "@esbuild/freebsd-x64": "0.17.15",
25
- "@esbuild/linux-arm": "0.17.15",
26
- "@esbuild/linux-arm64": "0.17.15",
27
- "@esbuild/linux-ia32": "0.17.15",
28
- "@esbuild/linux-loong64": "0.17.15",
29
- "@esbuild/linux-mips64el": "0.17.15",
30
- "@esbuild/linux-ppc64": "0.17.15",
31
- "@esbuild/linux-riscv64": "0.17.15",
32
- "@esbuild/linux-s390x": "0.17.15",
33
- "@esbuild/linux-x64": "0.17.15",
34
- "@esbuild/netbsd-x64": "0.17.15",
35
- "@esbuild/openbsd-x64": "0.17.15",
36
- "@esbuild/sunos-x64": "0.17.15",
37
- "@esbuild/win32-arm64": "0.17.15",
38
- "@esbuild/win32-ia32": "0.17.15",
39
- "@esbuild/win32-x64": "0.17.15"
18
+ "@esbuild/android-arm": "0.17.16",
19
+ "@esbuild/android-arm64": "0.17.16",
20
+ "@esbuild/android-x64": "0.17.16",
21
+ "@esbuild/darwin-arm64": "0.17.16",
22
+ "@esbuild/darwin-x64": "0.17.16",
23
+ "@esbuild/freebsd-arm64": "0.17.16",
24
+ "@esbuild/freebsd-x64": "0.17.16",
25
+ "@esbuild/linux-arm": "0.17.16",
26
+ "@esbuild/linux-arm64": "0.17.16",
27
+ "@esbuild/linux-ia32": "0.17.16",
28
+ "@esbuild/linux-loong64": "0.17.16",
29
+ "@esbuild/linux-mips64el": "0.17.16",
30
+ "@esbuild/linux-ppc64": "0.17.16",
31
+ "@esbuild/linux-riscv64": "0.17.16",
32
+ "@esbuild/linux-s390x": "0.17.16",
33
+ "@esbuild/linux-x64": "0.17.16",
34
+ "@esbuild/netbsd-x64": "0.17.16",
35
+ "@esbuild/openbsd-x64": "0.17.16",
36
+ "@esbuild/sunos-x64": "0.17.16",
37
+ "@esbuild/win32-arm64": "0.17.16",
38
+ "@esbuild/win32-ia32": "0.17.16",
39
+ "@esbuild/win32-x64": "0.17.16"
40
40
  },
41
41
  "license": "MIT"
42
42
  }
@@ -104,6 +104,33 @@ not, we got you covered! Starting with 0.2.8 you can also leave it out, in
104
104
  which case `xml2js` will helpfully add it for you, no bad surprises and
105
105
  inexplicable bugs!
106
106
 
107
+ Promise usage
108
+ -------------
109
+
110
+ ```javascript
111
+ var xml2js = require('xml2js');
112
+ var xml = '<foo></foo>';
113
+
114
+ // With parser
115
+ var parser = new xml2js.Parser(/* options */);
116
+ parser.parseStringPromise(xml).then(function (result) {
117
+ console.dir(result);
118
+ console.log('Done');
119
+ })
120
+ .catch(function (err) {
121
+ // Failed
122
+ });
123
+
124
+ // Without parser
125
+ xml2js.parseStringPromise(xml /*, options */).then(function (result) {
126
+ console.dir(result);
127
+ console.log('Done');
128
+ })
129
+ .catch(function (err) {
130
+ // Failed
131
+ });
132
+ ```
133
+
107
134
  Parsing multiple files
108
135
  ----------------------
109
136
 
@@ -146,20 +173,86 @@ XML builder usage
146
173
  Since 0.4.0, objects can be also be used to build XML:
147
174
 
148
175
  ```javascript
149
- var fs = require('fs'),
150
- xml2js = require('xml2js');
176
+ var xml2js = require('xml2js');
151
177
 
152
178
  var obj = {name: "Super", Surname: "Man", age: 23};
153
179
 
154
180
  var builder = new xml2js.Builder();
155
181
  var xml = builder.buildObject(obj);
156
182
  ```
183
+ will result in:
184
+
185
+ ```xml
186
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
187
+ <root>
188
+ <name>Super</name>
189
+ <Surname>Man</Surname>
190
+ <age>23</age>
191
+ </root>
192
+ ```
157
193
 
158
194
  At the moment, a one to one bi-directional conversion is guaranteed only for
159
195
  default configuration, except for `attrkey`, `charkey` and `explicitArray` options
160
196
  you can redefine to your taste. Writing CDATA is supported via setting the `cdata`
161
197
  option to `true`.
162
198
 
199
+ To specify attributes:
200
+ ```javascript
201
+ var xml2js = require('xml2js');
202
+
203
+ var obj = {root: {$: {id: "my id"}, _: "my inner text"}};
204
+
205
+ var builder = new xml2js.Builder();
206
+ var xml = builder.buildObject(obj);
207
+ ```
208
+ will result in:
209
+ ```xml
210
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
211
+ <root id="my id">my inner text</root>
212
+ ```
213
+
214
+ ### Adding xmlns attributes
215
+
216
+ You can generate XML that declares XML namespace prefix / URI pairs with xmlns attributes.
217
+
218
+ Example declaring a default namespace on the root element:
219
+
220
+ ```javascript
221
+ let obj = {
222
+ Foo: {
223
+ $: {
224
+ "xmlns": "http://foo.com"
225
+ }
226
+ }
227
+ };
228
+ ```
229
+ Result of `buildObject(obj)`:
230
+ ```xml
231
+ <Foo xmlns="http://foo.com"/>
232
+ ```
233
+ Example declaring non-default namespaces on non-root elements:
234
+ ```javascript
235
+ let obj = {
236
+ 'foo:Foo': {
237
+ $: {
238
+ 'xmlns:foo': 'http://foo.com'
239
+ },
240
+ 'bar:Bar': {
241
+ $: {
242
+ 'xmlns:bar': 'http://bar.com'
243
+ }
244
+ }
245
+ }
246
+ }
247
+ ```
248
+ Result of `buildObject(obj)`:
249
+ ```xml
250
+ <foo:Foo xmlns:foo="http://foo.com">
251
+ <bar:Bar xmlns:bar="http://bar.com"/>
252
+ </foo:Foo>
253
+ ```
254
+
255
+
163
256
  Processing attribute, tag names and values
164
257
  ------------------------------------------
165
258
 
@@ -231,21 +324,25 @@ value})``. Possible options are:
231
324
  Version 0.1 default was `@`.
232
325
  * `charkey` (default: `_`): Prefix that is used to access the character
233
326
  content. Version 0.1 default was `#`.
234
- * `explicitCharkey` (default: `false`)
327
+ * `explicitCharkey` (default: `false`) Determines whether or not to use
328
+ a `charkey` prefix for elements with no attributes.
235
329
  * `trim` (default: `false`): Trim the whitespace at the beginning and end of
236
330
  text nodes.
237
331
  * `normalizeTags` (default: `false`): Normalize all tag names to lowercase.
238
332
  * `normalize` (default: `false`): Trim whitespaces inside text nodes.
239
333
  * `explicitRoot` (default: `true`): Set this if you want to get the root
240
334
  node in the resulting object.
241
- * `emptyTag` (default: `''`): what will the value of empty nodes be.
335
+ * `emptyTag` (default: `''`): what will the value of empty nodes be. In case
336
+ you want to use an empty object as a default value, it is better to provide a factory
337
+ function `() => ({})` instead. Without this function a plain object would
338
+ become a shared reference across all occurrences with unwanted behavior.
242
339
  * `explicitArray` (default: `true`): Always put child nodes in an array if
243
340
  true; otherwise an array is created only if there is more than one.
244
341
  * `ignoreAttrs` (default: `false`): Ignore all XML attributes and only create
245
342
  text nodes.
246
343
  * `mergeAttrs` (default: `false`): Merge attributes and child elements as
247
344
  properties of the parent, instead of keying attributes off a child
248
- attribute object. This option is ignored if `ignoreAttrs` is `false`.
345
+ attribute object. This option is ignored if `ignoreAttrs` is `true`.
249
346
  * `validator` (default `null`): You can specify a callable that validates
250
347
  the resulting structure somehow, however you want. See unit tests
251
348
  for an example.
@@ -290,7 +387,7 @@ value})``. Possible options are:
290
387
  value processing functions. Accepts an `Array` of functions with following
291
388
  signature:
292
389
  ```javascript
293
- function (name){
390
+ function (value, name){
294
391
  //do something with `name`
295
392
  return name
296
393
  }
@@ -310,7 +407,7 @@ value})``. Possible options are:
310
407
  processing functions. Accepts an `Array` of functions with following
311
408
  signature:
312
409
  ```javascript
313
- function (name){
410
+ function (value, name){
314
411
  //do something with `name`
315
412
  return name
316
413
  }
@@ -322,6 +419,10 @@ Options for the `Builder` class
322
419
  These options are specified by ``new Builder({optionName: value})``.
323
420
  Possible options are:
324
421
 
422
+ * `attrkey` (default: `$`): Prefix that is used to access the attributes.
423
+ Version 0.1 default was `@`.
424
+ * `charkey` (default: `_`): Prefix that is used to access the character
425
+ content. Version 0.1 default was `#`.
325
426
  * `rootName` (default `root` or the root key name): root element name to be used in case
326
427
  `explicitRoot` is `false` or to override the root element name.
327
428
  * `renderOpts` (default `{ 'pretty': true, 'indent': ' ', 'newline': '\n' }`):
@@ -35,6 +35,7 @@
35
35
  extend(Parser, superClass);
36
36
 
37
37
  function Parser(opts) {
38
+ this.parseStringPromise = bind(this.parseStringPromise, this);
38
39
  this.parseString = bind(this.parseString, this);
39
40
  this.reset = bind(this.reset, this);
40
41
  this.assignOrPush = bind(this.assignOrPush, this);
@@ -140,14 +141,14 @@
140
141
  this.saxParser.onopentag = (function(_this) {
141
142
  return function(node) {
142
143
  var key, newValue, obj, processedKey, ref;
143
- obj = {};
144
+ obj = Object.create(null);
144
145
  obj[charkey] = "";
145
146
  if (!_this.options.ignoreAttrs) {
146
147
  ref = node.attributes;
147
148
  for (key in ref) {
148
149
  if (!hasProp.call(ref, key)) continue;
149
150
  if (!(attrkey in obj) && !_this.options.mergeAttrs) {
150
- obj[attrkey] = {};
151
+ obj[attrkey] = Object.create(null);
151
152
  }
152
153
  newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key];
153
154
  processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key;
@@ -197,7 +198,11 @@
197
198
  }
198
199
  }
199
200
  if (isEmpty(obj)) {
200
- obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr;
201
+ if (typeof _this.options.emptyTag === 'function') {
202
+ obj = _this.options.emptyTag();
203
+ } else {
204
+ obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr;
205
+ }
201
206
  }
202
207
  if (_this.options.validator != null) {
203
208
  xpath = "/" + ((function() {
@@ -221,7 +226,7 @@
221
226
  }
222
227
  if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === 'object') {
223
228
  if (!_this.options.preserveChildrenOrder) {
224
- node = {};
229
+ node = Object.create(null);
225
230
  if (_this.options.attrkey in obj) {
226
231
  node[_this.options.attrkey] = obj[_this.options.attrkey];
227
232
  delete obj[_this.options.attrkey];
@@ -236,7 +241,7 @@
236
241
  obj = node;
237
242
  } else if (s) {
238
243
  s[_this.options.childkey] = s[_this.options.childkey] || [];
239
- objClone = {};
244
+ objClone = Object.create(null);
240
245
  for (key in obj) {
241
246
  if (!hasProp.call(obj, key)) continue;
242
247
  objClone[key] = obj[key];
@@ -253,7 +258,7 @@
253
258
  } else {
254
259
  if (_this.options.explicitRoot) {
255
260
  old = obj;
256
- obj = {};
261
+ obj = Object.create(null);
257
262
  obj[nodeName] = old;
258
263
  }
259
264
  _this.resultObject = obj;
@@ -331,9 +336,23 @@
331
336
  }
332
337
  };
333
338
 
339
+ Parser.prototype.parseStringPromise = function(str) {
340
+ return new Promise((function(_this) {
341
+ return function(resolve, reject) {
342
+ return _this.parseString(str, function(err, value) {
343
+ if (err) {
344
+ return reject(err);
345
+ } else {
346
+ return resolve(value);
347
+ }
348
+ });
349
+ };
350
+ })(this));
351
+ };
352
+
334
353
  return Parser;
335
354
 
336
- })(events.EventEmitter);
355
+ })(events);
337
356
 
338
357
  exports.parseString = function(str, a, b) {
339
358
  var cb, options, parser;
@@ -354,4 +373,13 @@
354
373
  return parser.parseString(str, cb);
355
374
  };
356
375
 
376
+ exports.parseStringPromise = function(str, a) {
377
+ var options, parser;
378
+ if (typeof a === 'object') {
379
+ options = a;
380
+ }
381
+ parser = new exports.Parser(options);
382
+ return parser.parseStringPromise(str);
383
+ };
384
+
357
385
  }).call(this);
@@ -34,4 +34,6 @@
34
34
 
35
35
  exports.parseString = parser.parseString;
36
36
 
37
+ exports.parseStringPromise = parser.parseStringPromise;
38
+
37
39
  }).call(this);
@@ -2,6 +2,48 @@
2
2
 
3
3
  All notable changes to this project are documented in this file. This project adheres to [Semantic Versioning](http://semver.org/#semantic-versioning-200).
4
4
 
5
+ ## [11.0.0] - 2019-02-18
6
+ - Calling `end()` with arguments no longer overwrites writer options. See [#120](https://github.com/oozcitak/xmlbuilder-js/issues/120).
7
+ - Added writer state and customizable space and endline functions to help customize writer behavior. Also added `openNode` and `closeNode` functions to writer. See [#193](https://github.com/oozcitak/xmlbuilder-js/issues/193).
8
+ - Fixed a bug where writer functions would not be called for nodes with a single child node in pretty print mode. See [#195](https://github.com/oozcitak/xmlbuilder-js/issues/195).
9
+ - Renamed `elEscape` to `textEscape` in `XMLStringifier`.
10
+ - Fixed a bug where empty arrays would produce child nodes. See [#190](https://github.com/oozcitak/xmlbuilder-js/issues/190).
11
+ - Removed the `skipNullAttributes` option. `null` attributes are now skipped by default. Added the `keepNullAttributes` option in case someone needs the old behavior.
12
+ - Removed the `skipNullNodes` option. `null` nodes are now skipped by default. Added the `keepNullNodes` option in case someone needs the old behavior.
13
+ - `undefined` values are now skipped when converting JS objects.
14
+ - Renamed stringify functions. See [#194](https://github.com/oozcitak/xmlbuilder-js/issues/194):
15
+ * `eleName` -> `name`
16
+ * `attName` -> `name`
17
+ * `eleText` -> `text`
18
+ - Fixed argument order for `attribute` function in the writer. See [#196](https://github.com/oozcitak/xmlbuilder-js/issues/196).
19
+ - Added `openAttribute` and `closeAttribute` functions to writer. See [#196](https://github.com/oozcitak/xmlbuilder-js/issues/196).
20
+ - Added node types to node objects. Node types and writer states are exported by the module with the `nodeType` and `writerState` properties.
21
+ - Fixed a bug where array items would not be correctly converted. See [#159](https://github.com/oozcitak/xmlbuilder-js/issues/159).
22
+ - Fixed a bug where mixed-content inside JS objects with `#text` decorator would not be correctly converted. See [#171](https://github.com/oozcitak/xmlbuilder-js/issues/171).
23
+ - Fixed a bug where JS objects would not be expanded in callback mode. See [#173](https://github.com/oozcitak/xmlbuilder-js/issues/173).
24
+ - Fixed a bug where character validation would not obey document's XML version. Added separate validation for XML 1.0 and XML 1.1 documents. See [#169](https://github.com/oozcitak/xmlbuilder-js/issues/169).
25
+ - Fixed a bug where names would not be validated according to the spec. See [#49](https://github.com/oozcitak/xmlbuilder-js/issues/49).
26
+ - Renamed `text` property to `value` in comment and cdata nodes to unify the API.
27
+ - Removed `doctype` function to prevent name clash with DOM implementation. Use the `dtd` function instead.
28
+ - Removed dummy nodes from the XML tree (Those were created while chain-building the tree).
29
+ - Renamed `attributes`property to `attribs` to prevent name clash with DOM property with the same name.
30
+ - Implemented the DOM standard (read-only) to support XPath lookups. XML namespaces are not currently supported. See [#122](https://github.com/oozcitak/xmlbuilder-js/issues/122).
31
+
32
+ ## [10.1.1] - 2018-10-24
33
+ - Fixed an edge case where a null node at root level would be printed although `skipNullNodes` was set. See [#187](https://github.com/oozcitak/xmlbuilder-js/issues/187).
34
+
35
+ ## [10.1.0] - 2018-10-10
36
+ - Added the `skipNullNodes` option to skip nodes with null values. See [#158](https://github.com/oozcitak/xmlbuilder-js/issues/158).
37
+
38
+ ## [10.0.0] - 2018-04-26
39
+ - Added current indentation level as a parameter to the onData function when in callback mode. See [#125](https://github.com/oozcitak/xmlbuilder-js/issues/125).
40
+ - Added name of the current node and parent node to error messages where possible. See [#152](https://github.com/oozcitak/xmlbuilder-js/issues/152). This has the potential to break code depending on the content of error messages.
41
+ - Fixed an issue where objects created with Object.create(null) created an error. See [#176](https://github.com/oozcitak/xmlbuilder-js/issues/176).
42
+ - Added test builds for node.js v8 and v10.
43
+
44
+ ## [9.0.7] - 2018-02-09
45
+ - Simplified regex used for validating encoding.
46
+
5
47
  ## [9.0.4] - 2017-08-16
6
48
  - `spacebeforeslash` writer option accepts `true` as well as space char(s).
7
49
 
@@ -345,6 +387,11 @@ root.ele({ number: [ "one", "two" ]});
345
387
  ## 0.0.1 - 2010-11-02
346
388
  - Initial release
347
389
 
390
+ [11.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v10.1.1...v11.0.0
391
+ [10.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v10.1.0...v10.1.1
392
+ [10.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v10.0.0...v10.1.0
393
+ [10.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.7...v10.0.0
394
+ [9.0.7]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.4...v9.0.7
348
395
  [9.0.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.3...v9.0.4
349
396
  [9.0.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.2...v9.0.3
350
397
  [9.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.1...v9.0.2
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2013 Ozgur Ozcitak
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Ozgur Ozcitak
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.