Merge branch 'master' into updates

This commit is contained in:
Basti 2020-05-07 09:30:29 +02:00
commit 6be06b2e57
No known key found for this signature in database
GPG Key ID: BE4634D632D39B67

View File

@ -36,7 +36,7 @@ class IPFS {
cat (hashData) { cat (hashData) {
let ipfsHash = hashData; // default - if it is a string let ipfsHash = hashData; // default - if it is a string
if (hashData.hasOwnProperty('hashSize')) { if (Object.prototype.hasOwnProperty.call(hashData, 'hashSize')) {
ipfsHash = this.encodeHash(hashData); ipfsHash = this.encodeHash(hashData);
} }
if (this._config['gatewayUrl']) { if (this._config['gatewayUrl']) {
@ -48,7 +48,7 @@ class IPFS {
pin (hashData) { pin (hashData) {
let ipfsHash = hashData; // default - if it is a string let ipfsHash = hashData; // default - if it is a string
if (hashData.hasOwnProperty('hashSize')) { if (Object.prototype.hasOwnProperty.call(hashData, 'hashSize')) {
ipfsHash = this.encodeHash(hashData); ipfsHash = this.encodeHash(hashData);
} }
return this._ipfsAPI.pin.add(multihashes.toB58String(ipfsHash)); return this._ipfsAPI.pin.add(multihashes.toB58String(ipfsHash));