@onehat/data 1.8.14 → 1.8.17

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 (2) hide show
  1. package/package.json +8 -8
  2. package/src/Entity.js +5 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/data",
3
- "version": "1.8.14",
3
+ "version": "1.8.17",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -37,16 +37,16 @@
37
37
  "dependencies": {
38
38
  "@onehat/events": "^1.6.5",
39
39
  "accounting-js": "^1.1.1",
40
- "axios": "^0.21.4",
41
- "chrono-node": "^2.3.5",
42
- "fast-xml-parser": "^3.19.0",
40
+ "axios": "^0.27.2",
41
+ "chrono-node": "^2.3.9",
42
+ "fast-xml-parser": "^4.0.9",
43
43
  "he": "^1.2.0",
44
- "js-base64": "^3.6.1",
44
+ "js-base64": "^3.7.2",
45
45
  "lodash": "^4.17.21",
46
- "moment": "^2.29.1",
46
+ "moment": "^2.29.4",
47
47
  "numeral": "^2.0.6",
48
- "qs": "^6.10.3",
49
- "relative-time-parser": "^1.0.13",
48
+ "qs": "^6.11.0",
49
+ "relative-time-parser": "^1.0.15",
50
50
  "uuid": "^8.3.2"
51
51
  },
52
52
  "devDependencies": {
package/src/Entity.js CHANGED
@@ -1297,6 +1297,10 @@ class Entity extends EventEmitter {
1297
1297
  if (this.isFrozen) {
1298
1298
  return;
1299
1299
  }
1300
+
1301
+ // Save destroyed properties
1302
+ this.destroyedProperties = this.displayValues;
1303
+
1300
1304
  this._id = this.id; // save id, so we can query it later--even on a destroyed entity
1301
1305
 
1302
1306
  // parent objects
@@ -1318,10 +1322,7 @@ class Entity extends EventEmitter {
1318
1322
  }
1319
1323
 
1320
1324
  get [Symbol.toStringTag]() {
1321
- if (this.isDestroyed) {
1322
- throw Error('this.toStringTag is no longer valid. Entity has been destroyed.');
1323
- }
1324
- return 'Entity {' + this.id + '} - ' + this.displayValue;
1325
+ return 'Entity {' + this.id + '} - ' + (this.isDestroyed ? 'destroyed' : this.displayValue);
1325
1326
  }
1326
1327
 
1327
1328
  get toJSON() {