Comparing version 1.1.38 to 1.1.40
{ | ||
"name": "libcip54", | ||
"version": "1.1.38", | ||
"version": "1.1.40", | ||
"description": "Cardano Smart NFT Library", | ||
@@ -5,0 +5,0 @@ "main": "lib/src/index.js", |
@@ -803,8 +803,2 @@ "use strict"; | ||
} | ||
else if (src.substring(0, 7) === 'ipfs://') { | ||
const res = await axios_1.default.get(IPFS_GATEWAY + src.substring(7), { responseType: 'arraybuffer' }); | ||
if (!result.mediaType) | ||
result.mediaType = res.headers['content-type']; | ||
result.buffer = res.data; | ||
} | ||
else if (src.substring(0, 14) === 'ipfs://ipfs://') { | ||
@@ -824,2 +818,8 @@ const res = await axios_1.default.get(IPFS_GATEWAY + src.substring(14), { responseType: 'arraybuffer' }); | ||
} | ||
else if (src.substring(0, 7) === 'ipfs://') { | ||
const res = await axios_1.default.get(IPFS_GATEWAY + src.substring(7), { responseType: 'arraybuffer' }); | ||
if (!result.mediaType) | ||
result.mediaType = res.headers['content-type']; | ||
result.buffer = res.data; | ||
} | ||
else if (src.substring(0, 5) === 'ar://') { | ||
@@ -838,3 +838,10 @@ const res = await axios_1.default.get(ARWEAVE_GATEWAY + src.substring(5), { responseType: 'arraybuffer' }); | ||
else if (first.match(/utf8/i)) { | ||
lbuffer = decodeURIComponent(rest.join(',')); | ||
if (rest.join(',').match(/(%[0-9]{2})/)) { | ||
try { | ||
lbuffer = decodeURIComponent(rest.join(',')); | ||
} | ||
catch (e) { } | ||
} | ||
if (!lbuffer) | ||
lbuffer = rest.join(','); | ||
} | ||
@@ -1224,3 +1231,10 @@ else { | ||
else if (first.match(/utf8/i)) { | ||
byteString = decodeURIComponent(rest.join(',')); | ||
if (rest.join(',').match(/(%[0-9]{2})/)) { | ||
try { | ||
byteString = decodeURIComponent(rest.join(',')); | ||
return byteString; | ||
} | ||
catch (e) { } | ||
} | ||
byteString = rest.join(','); | ||
} | ||
@@ -1227,0 +1241,0 @@ else { |
{ | ||
"name": "libcip54", | ||
"version": "1.1.38", | ||
"version": "1.1.40", | ||
"description": "Cardano Smart NFT Library", | ||
@@ -5,0 +5,0 @@ "main": "lib/src/index.js", |
66645
1444