@mitre/inspec-objects 2.0.4 → 2.0.5

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.
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.objectifyDescriptions = objectifyDescriptions;
4
4
  const tslib_1 = require("tslib");
5
5
  const lodash_1 = tslib_1.__importDefault(require("lodash"));
6
- const flat_1 = require("flat");
7
- const flat_2 = require("flat");
8
6
  const global_1 = require("../utilities/global");
9
7
  const logging_1 = require("../utilities/logging");
10
8
  /**
@@ -60,7 +58,7 @@ class Control {
60
58
  this.refs = [];
61
59
  this.tags = {};
62
60
  if (data) {
63
- Object.entries(data).forEach(([key, value]) => {
61
+ Object.entries(lodash_1.default.cloneDeep(data)).forEach(([key, value]) => {
64
62
  lodash_1.default.set(this, key, value);
65
63
  });
66
64
  }
@@ -73,13 +71,7 @@ class Control {
73
71
  * @returns {Control} A new Control object created from the unformatted data.
74
72
  */
75
73
  toUnformattedObject() {
76
- const flattened = (0, flat_1.flatten)(this);
77
- Object.entries(flattened).forEach(([key, value]) => {
78
- if (typeof value === 'string') {
79
- lodash_1.default.set(flattened, key, value);
80
- }
81
- });
82
- return new Control((0, flat_2.unflatten)(flattened));
74
+ return new Control(this);
83
75
  }
84
76
  /**
85
77
  * Converts the control object to a string representation in a specific format.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mitre/inspec-objects",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "Typescript objects for normalizing between InSpec profiles and XCCDF benchmarks",
5
5
  "main": "lib/index.js",
6
6
  "publishConfig": {
@@ -24,7 +24,6 @@
24
24
  },
25
25
  "homepage": "https://github.com/mitre/ts-inspec-objects#readme",
26
26
  "dependencies": {
27
- "@types/flat": "5.0.5",
28
27
  "@types/he": "^1.1.2",
29
28
  "@types/json-diff": "^1.0.0",
30
29
  "@types/jstoxml": "^2.0.2",
@@ -32,7 +31,6 @@
32
31
  "@types/mustache": "^4.2.0",
33
32
  "@types/pretty": "^2.0.1",
34
33
  "fast-xml-parser": "^5.0.7",
35
- "flat": "6.0.1",
36
34
  "he": "^1.2.0",
37
35
  "htmlparser2": "^10.0.0",
38
36
  "inspecjs": "^2.6.6",