@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 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.1 linux-x64 node-v18.19.1
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
@@ -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 });
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.5.1",
2
+ "version": "1.5.2",
3
3
  "commands": {
4
4
  "cm:stacks:audit:fix": {
5
5
  "id": "cm:stacks:audit:fix",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentstack/cli-audit",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "Contentstack audit plugin",
5
5
  "author": "Contentstack CLI",
6
6
  "homepage": "https://github.com/contentstack/cli",