Skip to content

Commit 6f13d59

Browse files
committed
Simpler
1 parent 92c4af1 commit 6f13d59

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/xlsx.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,9 @@ function toColumn(c) {
9393
// For example: "A1" -> [0, 0], "B2" -> [1, 1], "AA10" -> [26, 9].
9494
function fromCellReference(s) {
9595
const [, sc, sr] = s.match(/^([A-Z]*)(\d*)$/i);
96-
let c = undefined;
97-
if (sc) {
98-
c = 0;
96+
let c = 0;
97+
if (sc)
9998
for (let i = 0; i < sc.length; i++)
10099
c += Math.pow(26, sc.length - i - 1) * (sc.charCodeAt(i) - 64);
101-
}
102100
return [c ? c - 1 : undefined, sr ? +sr - 1 : undefined];
103101
}

0 commit comments

Comments
 (0)