Skip to content

Commit c88a981

Browse files
committed
version bump 1.0.7: node 10 deprecation
1 parent 8bb0c56 commit c88a981

File tree

13 files changed

+51
-26
lines changed

13 files changed

+51
-26
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
language: node_js
22
node_js:
3+
- "10"
34
- "9"
45
- "8"
56
- "7"

bits/05_buf.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
var has_buf = (typeof Buffer !== 'undefined' && typeof process !== 'undefined' && typeof process.versions !== 'undefined' && process.versions.node);
22

3+
if(typeof Buffer !== 'undefined') {
4+
// $FlowIgnore
5+
if(!Buffer.from) Buffer.from = function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); };
6+
// $FlowIgnore
7+
if(!Buffer.alloc) Buffer.alloc = function(n) { return new Buffer(n); };
8+
}
9+
310
function new_raw_buf(len/*:number*/) {
411
/* jshint -W056 */
5-
// $FlowIgnore
6-
return new (has_buf ? Buffer : Array)(len);
12+
return has_buf ? Buffer.alloc(len) : new Array(len);
713
/* jshint +W056 */
814
}
915

1016
var s2a = function s2a(s/*:string*/) {
11-
if(has_buf) return new Buffer(s, "binary");
17+
if(has_buf) return Buffer.from(s, "binary");
1218
return s.split("").map(function(x){ return x.charCodeAt(0) & 0xff; });
1319
};
1420

bits/08_blob.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if(has_buf/*:: && typeof Buffer !== 'undefined'*/) {
2222
};
2323
__hexlify = function(b/*:RawBytes|CFBlob*/,s/*:number*/,l/*:number*/)/*:string*/ { return Buffer.isBuffer(b)/*:: && b instanceof Buffer*/ ? b.toString('hex',s,s+l) : ___hexlify(b,s,l); };
2424
__toBuffer = function(bufs/*:Array<Array<RawBytes>>*/)/*:RawBytes*/ { return (bufs[0].length > 0 && Buffer.isBuffer(bufs[0][0])) ? Buffer.concat((bufs[0]/*:any*/)) : ___toBuffer(bufs);};
25-
s2a = function(s/*:string*/)/*:RawBytes*/ { return new Buffer(s, "binary"); };
25+
s2a = function(s/*:string*/)/*:RawBytes*/ { return Buffer.from(s, "binary"); };
2626
bconcat = function(bufs/*:Array<RawBytes>*/)/*:RawBytes*/ { return Buffer.isBuffer(bufs[0]) ? Buffer.concat(/*::(*/bufs/*:: :any)*/) : __bconcat(bufs); };
2727
}
2828

bits/31_version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
exports.version = '1.0.6';
1+
exports.version = '1.0.7';

cfb.flow.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,21 @@ var Base64 = (function make_b64(){
5050
})();
5151
var has_buf = (typeof Buffer !== 'undefined' && typeof process !== 'undefined' && typeof process.versions !== 'undefined' && process.versions.node);
5252

53+
if(typeof Buffer !== 'undefined') {
54+
// $FlowIgnore
55+
if(!Buffer.from) Buffer.from = function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); };
56+
// $FlowIgnore
57+
if(!Buffer.alloc) Buffer.alloc = function(n) { return new Buffer(n); };
58+
}
59+
5360
function new_raw_buf(len/*:number*/) {
5461
/* jshint -W056 */
55-
// $FlowIgnore
56-
return new (has_buf ? Buffer : Array)(len);
62+
return has_buf ? Buffer.alloc(len) : new Array(len);
5763
/* jshint +W056 */
5864
}
5965

6066
var s2a = function s2a(s/*:string*/) {
61-
if(has_buf) return new Buffer(s, "binary");
67+
if(has_buf) return Buffer.from(s, "binary");
6268
return s.split("").map(function(x){ return x.charCodeAt(0) & 0xff; });
6369
};
6470

@@ -87,7 +93,7 @@ if(has_buf/*:: && typeof Buffer !== 'undefined'*/) {
8793
};
8894
__hexlify = function(b/*:RawBytes|CFBlob*/,s/*:number*/,l/*:number*/)/*:string*/ { return Buffer.isBuffer(b)/*:: && b instanceof Buffer*/ ? b.toString('hex',s,s+l) : ___hexlify(b,s,l); };
8995
__toBuffer = function(bufs/*:Array<Array<RawBytes>>*/)/*:RawBytes*/ { return (bufs[0].length > 0 && Buffer.isBuffer(bufs[0][0])) ? Buffer.concat((bufs[0]/*:any*/)) : ___toBuffer(bufs);};
90-
s2a = function(s/*:string*/)/*:RawBytes*/ { return new Buffer(s, "binary"); };
96+
s2a = function(s/*:string*/)/*:RawBytes*/ { return Buffer.from(s, "binary"); };
9197
bconcat = function(bufs/*:Array<RawBytes>*/)/*:RawBytes*/ { return Buffer.isBuffer(bufs[0]) ? Buffer.concat(/*::(*/bufs/*:: :any)*/) : __bconcat(bufs); };
9298
}
9399

@@ -177,7 +183,7 @@ type CFBFiles = {[n:string]:CFBEntry};
177183
/* [MS-CFB] v20171201 */
178184
var CFB = (function _CFB(){
179185
var exports/*:CFBModule*/ = /*::(*/{}/*:: :any)*/;
180-
exports.version = '1.0.6';
186+
exports.version = '1.0.7';
181187
/* [MS-CFB] 2.6.4 */
182188
function namecmp(l/*:string*/, r/*:string*/)/*:number*/ {
183189
var L = l.split("/"), R = r.split("/");

cfb.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,21 @@ var Base64 = (function make_b64(){
5050
})();
5151
var has_buf = (typeof Buffer !== 'undefined' && typeof process !== 'undefined' && typeof process.versions !== 'undefined' && process.versions.node);
5252

53+
if(typeof Buffer !== 'undefined') {
54+
// $FlowIgnore
55+
if(!Buffer.from) Buffer.from = function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); };
56+
// $FlowIgnore
57+
if(!Buffer.alloc) Buffer.alloc = function(n) { return new Buffer(n); };
58+
}
59+
5360
function new_raw_buf(len) {
5461
/* jshint -W056 */
55-
// $FlowIgnore
56-
return new (has_buf ? Buffer : Array)(len);
62+
return has_buf ? Buffer.alloc(len) : new Array(len);
5763
/* jshint +W056 */
5864
}
5965

6066
var s2a = function s2a(s) {
61-
if(has_buf) return new Buffer(s, "binary");
67+
if(has_buf) return Buffer.from(s, "binary");
6268
return s.split("").map(function(x){ return x.charCodeAt(0) & 0xff; });
6369
};
6470

@@ -87,7 +93,7 @@ if(has_buf) {
8793
};
8894
__hexlify = function(b,s,l) { return Buffer.isBuffer(b) ? b.toString('hex',s,s+l) : ___hexlify(b,s,l); };
8995
__toBuffer = function(bufs) { return (bufs[0].length > 0 && Buffer.isBuffer(bufs[0][0])) ? Buffer.concat((bufs[0])) : ___toBuffer(bufs);};
90-
s2a = function(s) { return new Buffer(s, "binary"); };
96+
s2a = function(s) { return Buffer.from(s, "binary"); };
9197
bconcat = function(bufs) { return Buffer.isBuffer(bufs[0]) ? Buffer.concat(bufs) : __bconcat(bufs); };
9298
}
9399

@@ -159,7 +165,7 @@ function new_buf(sz) {
159165
/* [MS-CFB] v20171201 */
160166
var CFB = (function _CFB(){
161167
var exports = {};
162-
exports.version = '1.0.6';
168+
exports.version = '1.0.7';
163169
/* [MS-CFB] 2.6.4 */
164170
function namecmp(l, r) {
165171
var L = l.split("/"), R = r.split("/");

dist/cfb.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,21 @@ var Base64 = (function make_b64(){
5050
})();
5151
var has_buf = (typeof Buffer !== 'undefined' && typeof process !== 'undefined' && typeof process.versions !== 'undefined' && process.versions.node);
5252

53+
if(typeof Buffer !== 'undefined') {
54+
// $FlowIgnore
55+
if(!Buffer.from) Buffer.from = function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); };
56+
// $FlowIgnore
57+
if(!Buffer.alloc) Buffer.alloc = function(n) { return new Buffer(n); };
58+
}
59+
5360
function new_raw_buf(len) {
5461
/* jshint -W056 */
55-
// $FlowIgnore
56-
return new (has_buf ? Buffer : Array)(len);
62+
return has_buf ? Buffer.alloc(len) : new Array(len);
5763
/* jshint +W056 */
5864
}
5965

6066
var s2a = function s2a(s) {
61-
if(has_buf) return new Buffer(s, "binary");
67+
if(has_buf) return Buffer.from(s, "binary");
6268
return s.split("").map(function(x){ return x.charCodeAt(0) & 0xff; });
6369
};
6470

@@ -87,7 +93,7 @@ if(has_buf) {
8793
};
8894
__hexlify = function(b,s,l) { return Buffer.isBuffer(b) ? b.toString('hex',s,s+l) : ___hexlify(b,s,l); };
8995
__toBuffer = function(bufs) { return (bufs[0].length > 0 && Buffer.isBuffer(bufs[0][0])) ? Buffer.concat((bufs[0])) : ___toBuffer(bufs);};
90-
s2a = function(s) { return new Buffer(s, "binary"); };
96+
s2a = function(s) { return Buffer.from(s, "binary"); };
9197
bconcat = function(bufs) { return Buffer.isBuffer(bufs[0]) ? Buffer.concat(bufs) : __bconcat(bufs); };
9298
}
9399

@@ -159,7 +165,7 @@ function new_buf(sz) {
159165
/* [MS-CFB] v20171201 */
160166
var CFB = (function _CFB(){
161167
var exports = {};
162-
exports.version = '1.0.6';
168+
exports.version = '1.0.7';
163169
/* [MS-CFB] 2.6.4 */
164170
function namecmp(l, r) {
165171
var L = l.split("/"), R = r.split("/");

dist/cfb.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cfb.min.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/xlscfb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type CFBFiles = {[n:string]:CFBEntry};
3838
/* [MS-CFB] v20171201 */
3939
var CFB = (function _CFB(){
4040
var exports/*:CFBModule*/ = /*::(*/{}/*:: :any)*/;
41-
exports.version = '1.0.6';
41+
exports.version = '1.0.7';
4242
/* [MS-CFB] 2.6.4 */
4343
function namecmp(l/*:string*/, r/*:string*/)/*:number*/ {
4444
var L = l.split("/"), R = r.split("/");

0 commit comments

Comments
 (0)