minimal adjustments
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / table / dist / mapDataUsingRowHeightIndex.js.map
1 {"version":3,"sources":["../src/mapDataUsingRowHeightIndex.js"],"names":["unmappedRows","rowHeightIndex","config","tableWidth","length","mappedRows","map","cells","index0","rowHeight","Array","from","fill","forEach","value","index1","cellLines","columns","width","wrapWord","cellLine","index2"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;oCACgBA,Y,EAAcC,c,EAAgBC,M,KAAW;AACvD,QAAMC,UAAU,GAAGH,YAAY,CAAC,CAAD,CAAZ,CAAgBI,MAAnC;AAEA,QAAMC,UAAU,GAAGL,YAAY,CAACM,GAAb,CAAiB,CAACC,KAAD,EAAQC,MAAR,KAAmB;AACrD,UAAMC,SAAS,GAAGC,KAAK,CAACC,IAAN,CAAW,IAAID,KAAJ,CAAUT,cAAc,CAACO,MAAD,CAAxB,CAAX,EAA8C,MAAM;AACpE,aAAO,IAAIE,KAAJ,CAAUP,UAAV,EAAsBS,IAAtB,CAA2B,EAA3B,CAAP;AACD,KAFiB,CAAlB,CADqD,CAKrD;AACA;AACA;;AAEAL,IAAAA,KAAK,CAACM,OAAN,CAAc,CAACC,KAAD,EAAQC,MAAR,KAAmB;AAC/B,YAAMC,SAAS,GAAG,uBAASF,KAAT,EAAgBZ,MAAM,CAACe,OAAP,CAAeF,MAAf,EAAuBG,KAAvC,EAA8ChB,MAAM,CAACe,OAAP,CAAeF,MAAf,EAAuBI,QAArE,CAAlB;AAEAH,MAAAA,SAAS,CAACH,OAAV,CAAkB,CAACO,QAAD,EAAWC,MAAX,KAAsB;AACtCZ,QAAAA,SAAS,CAACY,MAAD,CAAT,CAAkBN,MAAlB,IAA4BK,QAA5B;AACD,OAFD;AAGD,KAND;AAQA,WAAOX,SAAP;AACD,GAlBkB,CAAnB;AAoBA,SAAO,qBAAQJ,UAAR,CAAP;AACD,C","sourcesContent":["import flatten from 'lodash.flatten';\nimport wrapCell from './wrapCell';\n\n/**\n * @param {Array} unmappedRows\n * @param {number[]} rowHeightIndex\n * @param {object} config\n * @returns {Array}\n */\nexport default (unmappedRows, rowHeightIndex, config) => {\n  const tableWidth = unmappedRows[0].length;\n\n  const mappedRows = unmappedRows.map((cells, index0) => {\n    const rowHeight = Array.from(new Array(rowHeightIndex[index0]), () => {\n      return new Array(tableWidth).fill('');\n    });\n\n    // rowHeight\n    //     [{row index within rowSaw; index2}]\n    //     [{cell index within a virtual row; index1}]\n\n    cells.forEach((value, index1) => {\n      const cellLines = wrapCell(value, config.columns[index1].width, config.columns[index1].wrapWord);\n\n      cellLines.forEach((cellLine, index2) => {\n        rowHeight[index2][index1] = cellLine;\n      });\n    });\n\n    return rowHeight;\n  });\n\n  return flatten(mappedRows);\n};\n"],"file":"mapDataUsingRowHeightIndex.js"}