ondc-code-generator 0.4.1 → 0.4.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.
|
@@ -51,9 +51,16 @@ export function ConvertArrayToStringsInTestObject(testObject) {
|
|
|
51
51
|
return testDuplicate;
|
|
52
52
|
}
|
|
53
53
|
export function ConvertArrayToString(arr) {
|
|
54
|
-
let vals = arr.map((v) => `"${v}"`).join(", ");
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
// let vals = arr.map((v) => `"${v}"`).join(", ");
|
|
55
|
+
// console.log(`Converted array to string: ${vals}`);
|
|
56
|
+
// vals = vals.replace(/"/g, `"`);
|
|
57
|
+
for (const a of arr) {
|
|
58
|
+
if (typeof a !== "string") {
|
|
59
|
+
console.log(arr);
|
|
60
|
+
throw new Error(`Array contains non-string element: ${a}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return JSON.stringify(arr);
|
|
57
64
|
}
|
|
58
65
|
export function addTabToMarkdown(markdown) {
|
|
59
66
|
// Split the markdown into lines, add a tab to each line, and rejoin
|