js-downloadexcel
Advanced tools
Comparing version 0.0.4 to 0.0.5
19
index.js
@@ -148,3 +148,3 @@ // import XLSX from "js-xlsxstyle" | ||
exports.getColorPosition = (json, cb, regEx) => { | ||
exports.setColorPosition = (json, cb, regEx) => { | ||
let temp = json[getMaxLenObj(json)], keyMap = [], newArr = [{}] | ||
@@ -156,8 +156,15 @@ for (var k in temp) { | ||
newArr = newArr.concat(json) | ||
let arr = newArr.map((v, i) => keyMap.map((k, j) => Object.assign({}, { | ||
v: v[k], | ||
position: regEx.test(v[k]) ? (j > 25 ? getCharCol(j) : String.fromCharCode(65 + j)) + (i + 1) : '', | ||
...cb(v[k]) | ||
}))).reduce((prev, next) => prev.concat(next)) | ||
let arr = newArr.map((v, i) => keyMap.map((k, j) => { | ||
let obj = cb(v[k]) | ||
return obj ? Object.assign({}, { | ||
v: v[k], | ||
position: regEx.test(v[k]) ? (j > 25 ? getCharCol(j) : String.fromCharCode(65 + j)) + (i + 1) : '', | ||
...obj | ||
}) : Object.assign({}, { | ||
v: v[k], | ||
position: regEx.test(v[k]) ? (j > 25 ? getCharCol(j) : String.fromCharCode(65 + j)) + (i + 1) : '', | ||
}) | ||
} | ||
)).reduce((prev, next) => prev.concat(next)) | ||
return arr | ||
} |
{ | ||
"name": "js-downloadexcel", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "下载excel", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6167
160