From 242d5c655e6ba1d09a71c31ca0174347a8a62774 Mon Sep 17 00:00:00 2001 From: SheetJS Date: Tue, 4 Feb 2014 11:10:42 -0500 Subject: [PATCH] xlsb browser fix --- bits/35_ziputils.js | 2 +- xlsx.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bits/35_ziputils.js b/bits/35_ziputils.js index 9b95346..f514a57 100644 --- a/bits/35_ziputils.js +++ b/bits/35_ziputils.js @@ -1,6 +1,6 @@ function getdata(data) { if(!data) return null; - if(data.data) return data.data; + if(data.data) return data.name.substr(-4) !== ".bin" ? data.data : data.data.split("").map(function(x) { return x.charCodeAt(0); }); if(data.asNodeBuffer && typeof Buffer !== 'undefined' && data.name.substr(-4)===".bin") return data.asNodeBuffer(); if(data.asBinary && data.name.substr(-4) !== ".bin") return data.asBinary(); if(data._data && data._data.getContent) { diff --git a/xlsx.js b/xlsx.js index 20c54a8..f9f20c8 100644 --- a/xlsx.js +++ b/xlsx.js @@ -433,7 +433,7 @@ function _getchar(x) { return String.fromCharCode(x); } function getdata(data) { if(!data) return null; - if(data.data) return data.data; + if(data.data) return data.name.substr(-4) !== ".bin" ? data.data : data.data.split("").map(function(x) { return x.charCodeAt(0); }); if(data.asNodeBuffer && typeof Buffer !== 'undefined' && data.name.substr(-4)===".bin") return data.asNodeBuffer(); if(data.asBinary && data.name.substr(-4) !== ".bin") return data.asBinary(); if(data._data && data._data.getContent) {