@ethersproject/web
Advanced tools
Comparing version 5.7.0 to 5.7.1
@@ -1,2 +0,2 @@ | ||
export declare const version = "web/5.7.0"; | ||
export declare const version = "web/5.7.1"; | ||
//# sourceMappingURL=_version.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export const version = "web/5.7.0"; | ||
export const version = "web/5.7.1"; | ||
//# sourceMappingURL=_version.js.map |
@@ -43,2 +43,7 @@ "use strict"; | ||
} | ||
function unpercent(value) { | ||
return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { | ||
return String.fromCharCode(parseInt(code, 16)); | ||
})); | ||
} | ||
// This API is still a work in progress; the future changes will likely be: | ||
@@ -103,3 +108,3 @@ // - ConnectionInfo => FetchDataRequest<T = any> | ||
} | ||
const reData = new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$", "i"); | ||
const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); | ||
const dataMatch = ((url) ? url.match(reData) : null); | ||
@@ -111,4 +116,4 @@ if (dataMatch) { | ||
statusMessage: "OK", | ||
headers: { "content-type": dataMatch[1] }, | ||
body: base64Decode(dataMatch[2]) | ||
headers: { "content-type": (dataMatch[1] || "text/plain") }, | ||
body: (dataMatch[2] ? base64Decode(dataMatch[3]) : unpercent(dataMatch[3])) | ||
}; | ||
@@ -115,0 +120,0 @@ let result = response.body; |
@@ -1,2 +0,2 @@ | ||
export declare const version = "web/5.7.0"; | ||
export declare const version = "web/5.7.1"; | ||
//# sourceMappingURL=_version.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = void 0; | ||
exports.version = "web/5.7.0"; | ||
exports.version = "web/5.7.1"; | ||
//# sourceMappingURL=_version.js.map |
@@ -72,2 +72,7 @@ "use strict"; | ||
} | ||
function unpercent(value) { | ||
return (0, strings_1.toUtf8Bytes)(value.replace(/%([0-9a-f][0-9a-f])/gi, function (all, code) { | ||
return String.fromCharCode(parseInt(code, 16)); | ||
})); | ||
} | ||
// This API is still a work in progress; the future changes will likely be: | ||
@@ -132,3 +137,3 @@ // - ConnectionInfo => FetchDataRequest<T = any> | ||
} | ||
var reData = new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$", "i"); | ||
var reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); | ||
var dataMatch = ((url) ? url.match(reData) : null); | ||
@@ -140,4 +145,4 @@ if (dataMatch) { | ||
statusMessage: "OK", | ||
headers: { "content-type": dataMatch[1] }, | ||
body: (0, base64_1.decode)(dataMatch[2]) | ||
headers: { "content-type": (dataMatch[1] || "text/plain") }, | ||
body: (dataMatch[2] ? (0, base64_1.decode)(dataMatch[3]) : unpercent(dataMatch[3])) | ||
}; | ||
@@ -144,0 +149,0 @@ var result = response.body; |
@@ -28,3 +28,3 @@ { | ||
], | ||
"gitHead": "ec1b9583039a14a0e0fa15d0a2a6082a2f41cf5b", | ||
"gitHead": "44cbc7fa4e199c1d6113ceec3c5162f53def5bb8", | ||
"keywords": [ | ||
@@ -50,5 +50,5 @@ "Ethereum", | ||
"sideEffects": false, | ||
"tarballHash": "0xb3ee68f89ee8df5c4dbd69a5d346057d962d24d2ae08100490a2d1e51ee18f7f", | ||
"tarballHash": "0x37945bd0bcbf905a641db7e631bb538570042dbe6513e1e4cdd088f25b4ec274", | ||
"types": "./lib/index.d.ts", | ||
"version": "5.7.0" | ||
"version": "5.7.1" | ||
} |
@@ -1,1 +0,1 @@ | ||
export const version = "web/5.7.0"; | ||
export const version = "web/5.7.1"; |
@@ -85,2 +85,8 @@ "use strict"; | ||
function unpercent(value: string): Uint8Array { | ||
return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { | ||
return String.fromCharCode(parseInt(code, 16)); | ||
})); | ||
} | ||
// This API is still a work in progress; the future changes will likely be: | ||
@@ -169,3 +175,3 @@ // - ConnectionInfo => FetchDataRequest<T = any> | ||
const reData = new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$", "i"); | ||
const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); | ||
const dataMatch = ((url) ? url.match(reData): null); | ||
@@ -177,4 +183,4 @@ if (dataMatch) { | ||
statusMessage: "OK", | ||
headers: { "content-type": dataMatch[1] }, | ||
body: base64Decode(dataMatch[2]) | ||
headers: { "content-type": (dataMatch[1] || "text/plain")}, | ||
body: (dataMatch[2] ? base64Decode(dataMatch[3]): unpercent(dataMatch[3])) | ||
}; | ||
@@ -181,0 +187,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
127962
1873