@onehat/data 1.19.30 → 1.19.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/data",
3
- "version": "1.19.30",
3
+ "version": "1.19.32",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -37,10 +37,10 @@
37
37
  "homepage": "https://github.com/OneHatRepo/data#readme",
38
38
  "dependencies": {
39
39
  "@onehat/events": "^1.6.6",
40
+ "async-wait-until": "^2.0.12",
40
41
  "accounting-js": "^1.1.1",
41
- "axios": "^1.4.0",
42
- "chrono-node": "^2.6.3",
43
- "fast-xml-parser": "^4.2.4",
42
+ "axios": "^1.6.2",
43
+ "chrono-node": "^2.7.3",
44
44
  "he": "^1.2.0",
45
45
  "js-base64": "^3.7.5",
46
46
  "lodash": "^4.17.21",
@@ -49,7 +49,10 @@
49
49
  "numeral": "^2.0.6",
50
50
  "qs": "^6.11.2",
51
51
  "relative-time-parser": "^1.0.15",
52
- "uuid": "^9.0.0"
52
+ "uuid": "^9.0.1"
53
+ },
54
+ "peerDependencies": {
55
+ "fast-xml-parser": "^4.3.2"
53
56
  },
54
57
  "devDependencies": {
55
58
  "@babel/core": "^7.22.1",
@@ -1,10 +1,10 @@
1
1
  /** @module Reader */
2
2
 
3
3
  import JsonReader from './JsonReader.js';
4
- import XmlReader from './XmlReader.js';
4
+ // import XmlReader from './XmlReader.js';
5
5
 
6
6
  const ReaderTypes = {
7
7
  [JsonReader.type]: JsonReader,
8
- [XmlReader.type]: XmlReader,
8
+ // [XmlReader.type]: XmlReader,
9
9
  };
10
10
  export default ReaderTypes;
@@ -7,6 +7,7 @@ import {
7
7
  v4 as uuid,
8
8
  } from 'uuid';
9
9
  import moment from 'moment';
10
+ import { waitUntil } from 'async-wait-until';
10
11
  import _ from 'lodash';
11
12
 
12
13
  /**
@@ -387,28 +388,8 @@ export default class Repository extends EventEmitter {
387
388
  this.throwError('this.waitUntilDoneLoading is no longer valid. Repository has been destroyed.');
388
389
  return;
389
390
  }
390
-
391
- function delayUntil(fn, maxAttempts = 100, interval = 100) {
392
- return new Promise((resolve, reject) => {
393
- let currentAttempt = 0;
394
- const checkCondition = async () => {
395
- currentAttempt++;
396
-
397
- if (fn()) {
398
- resolve();
399
- } else if (currentAttempt < maxAttempts) {
400
- setTimeout(checkCondition, interval);
401
- } else {
402
- reject(new Error('maxAttempts reached. Condition not met.'));
403
- }
404
- };
405
-
406
- checkCondition();
407
- });
408
- }
409
-
410
391
 
411
- await delayUntil(() => !this.isLoading);
392
+ await waitUntil(() => !this.isLoading, { timeout });
412
393
  }
413
394
 
414
395
  /**