@contentstack/cli-audit 1.5.1 → 1.5.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 +1 -1
- package/lib/modules/entries.js +10 -0
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
|
|
|
19
19
|
$ csdx COMMAND
|
|
20
20
|
running command...
|
|
21
21
|
$ csdx (--version|-v)
|
|
22
|
-
@contentstack/cli-audit/1.5.
|
|
22
|
+
@contentstack/cli-audit/1.5.2 linux-x64 node-v18.19.1
|
|
23
23
|
$ csdx --help [COMMAND]
|
|
24
24
|
USAGE
|
|
25
25
|
$ csdx COMMAND
|
package/lib/modules/entries.js
CHANGED
|
@@ -206,6 +206,11 @@ class Entries {
|
|
|
206
206
|
* `tree`, `fieldStructure`, and `field`.
|
|
207
207
|
*/
|
|
208
208
|
validateReferenceField(tree, fieldStructure, field) {
|
|
209
|
+
if (typeof field === 'string') {
|
|
210
|
+
let stringReference = field;
|
|
211
|
+
stringReference = stringReference.replace(/'/g, '"');
|
|
212
|
+
field = JSON.parse(stringReference);
|
|
213
|
+
}
|
|
209
214
|
return this.validateReferenceValues(tree, fieldStructure, field);
|
|
210
215
|
}
|
|
211
216
|
/**
|
|
@@ -601,6 +606,11 @@ class Entries {
|
|
|
601
606
|
*/
|
|
602
607
|
fixMissingReferences(tree, field, entry) {
|
|
603
608
|
const missingRefs = [];
|
|
609
|
+
if (typeof entry === 'string') {
|
|
610
|
+
let stringReference = entry;
|
|
611
|
+
stringReference = stringReference.replace(/'/g, '"');
|
|
612
|
+
entry = JSON.parse(stringReference);
|
|
613
|
+
}
|
|
604
614
|
entry = entry === null || entry === void 0 ? void 0 : entry.map((reference) => {
|
|
605
615
|
const { uid } = reference;
|
|
606
616
|
const refExist = (0, find_1.default)(this.entryMetaData, { uid });
|
package/oclif.manifest.json
CHANGED