| 14237 | return this.removeFileExtension(this.getFileName(filepath)) |
| 14238 | } |
| 14239 | static joinArraysOn(joinOn, arrays, columns) { |
| 14240 | const rows = {} |
| 14241 | let index = 0 |
| 14242 | if (!columns) columns = arrays.map(arr => Object.keys(arr[0])) |
| 14243 | arrays.forEach((arr, index) => { |
| 14244 | const cols = columns[index] |
| 14245 | arr.forEach(row => { |
| 14246 | const key = joinOn ? row[joinOn] : index++ |
| 14247 | if (!rows[key]) rows[key] = {} |
| 14248 | const obj = rows[key] |
| 14249 | cols.forEach(col => (obj[col] = row[col])) |
| 14250 | }) |
| 14251 | }) |
| 14252 | return Object.values(rows) |
| 14253 | } |
| 14254 | static getParentFolder(path) { |
| 14255 | if (path.endsWith("/")) path = this._removeLastSlash(path) |
| 14256 | return path.replace(/\/[^\/]*$/, "") + "/" |