sheetjs-clone/bits/05_buf.js
SheetJS cd2e639fc2 version bump 0.11.11: CFB miscellany
- export `sheet_to_txt` (fixes #905 h/t @aj4mq)
- BIFF4 Format Record aligned to BIFF 2/3 (fixes #909 h/t @ToujouAya)
- updated CFB to 1.0.1
- typescript standalone demo
- nexe / pkg xlsx.njs demo
2017-12-01 00:48:10 -05:00

18 lines
560 B
JavaScript

var has_buf = (typeof Buffer !== 'undefined' && typeof process !== 'undefined' && typeof process.versions !== 'undefined' && process.versions.node);
function new_raw_buf(len/*:number*/) {
/* jshint -W056 */
// $FlowIgnore
return new (has_buf ? Buffer : Array)(len);
/* jshint +W056 */
}
function s2a(s/*:string*/) {
if(has_buf) return new Buffer(s, "binary");
return s.split("").map(function(x){ return x.charCodeAt(0) & 0xff; });
}
var bconcat = function(bufs) { return [].concat.apply([], bufs); };
var chr0 = /\u0000/g, chr1 = /[\u0001-\u0006]/g;