SheetJS
5c7df1f3db
- reworked IIFE - avoid Buffer read helpers (see https://github.com/joyent/node/issues/7809) - avoid nested functions in parse - eliminate consecutive nulls in test files (libreoffice) - travis + coveralls support - jscs linting
10 lines
298 B
JavaScript
10 lines
298 B
JavaScript
/** Break the file up into sectors */
|
|
function sectorify(file, ssz) {
|
|
var nsectors = Math.ceil(file.length/ssz)-1;
|
|
var sectors = new Array(nsectors);
|
|
for(var i=1; i < nsectors; ++i) sectors[i-1] = file.slice(i*ssz,(i+1)*ssz);
|
|
sectors[nsectors-1] = file.slice(nsectors*ssz);
|
|
return sectors;
|
|
}
|
|
|