Skip to content

Commit

Permalink
feat(export-fields): Minor changes related to column names
Browse files Browse the repository at this point in the history
  • Loading branch information
RazvanMitrica committed Oct 14, 2024
1 parent 741b30d commit 33f3752
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,16 +224,19 @@ internals.parseSchema = (joiSchema, dynamicSchemas, keyName, path, parentIsArray
if (keyName && parsedItem) {
const prefixedItemArray = [];

for (let i = 0; i < internals.maximumElementsInArray; ++i) {
for (let i = 1; i <= internals.maximumElementsInArray; ++i) {
prefixedItemArray.push(parsedItem.map((headerQuery) => {

const key = Object.keys(headerQuery)[0];
let name;
if (label) {
name = parsedItem.length === 1 ? `${label} ${i}` : `${label} ${i} ${key}`;
if (label === '_') {
name = parsedItem.length === 1 || i === 1 ? `${key}` : `${key} ${i}`;
}
else if (label) {
name = parsedItem.length === 1 || i === 1 ? `${label} ${key}` : `${label} ${i} ${key}`;
}
else {
name = parsedItem.length === 1 ? `${keyName}_${i}` : `${keyName}_${i}.${key}`;
name = parsedItem.length === 1 ? `${keyName} ${i}` : `${keyName} ${i} ${key}`;
}

const sliced = headerQuery[key].slice();
Expand Down

0 comments on commit 33f3752

Please # to comment.