We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b12d779 commit 08984b2Copy full SHA for 08984b2
lib/buffer.js
@@ -404,17 +404,15 @@ function fromObject(obj) {
404
return b;
405
}
406
407
- if (obj != null) {
408
- if (obj.length !== undefined || isAnyArrayBuffer(obj.buffer)) {
409
- if (typeof obj.length !== 'number' || obj.length !== obj.length) {
410
- return new FastBuffer();
411
- }
412
- return fromArrayLike(obj);
+ if (obj.length !== undefined || isAnyArrayBuffer(obj.buffer)) {
+ if (typeof obj.length !== 'number' || obj.length !== obj.length) {
+ return new FastBuffer();
413
+ return fromArrayLike(obj);
+ }
414
415
- if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
416
- return fromArrayLike(obj.data);
417
+ if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
+ return fromArrayLike(obj.data);
418
419
420
0 commit comments