js-downloadexcel
Advanced tools
Comparing version 0.0.5 to 0.0.6
20
index.js
@@ -70,3 +70,3 @@ // import XLSX from "js-xlsxstyle" | ||
val.fontSize && (s.font.sz = val.fontSize) | ||
s.font.bold = val.bold | ||
s.font.bold = val.isBold | ||
val.borderColor && (s.border = { | ||
@@ -149,3 +149,3 @@ right: { color: { rgb: val.borderColor } }, | ||
exports.setColorPosition = (json, cb, regEx) => { | ||
exports.setColorPosition = (json, regEx, { color = "000000", backgroundColor = 'ffffff', fontSize = '14', isBold = false, borderColor = '' }) => { | ||
let temp = json[getMaxLenObj(json)], keyMap = [], newArr = [{}] | ||
@@ -157,15 +157,7 @@ for (var k in temp) { | ||
newArr = newArr.concat(json) | ||
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)) | ||
let arr = newArr.map((v, i) => keyMap.map((k, j) => Object.assign({}, { | ||
v: v[k], bold: isBold, color, backgroundColor, fontSize, borderColor, | ||
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.5", | ||
"version": "0.0.6", | ||
"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
6061
152