Skip to content

Commit

Permalink
Updated dist files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jan 21, 2020
1 parent adf5622 commit 1ff5f52
Show file tree
Hide file tree
Showing 73 changed files with 649 additions and 347 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ Changelog

This change log is managed by `scripts/cmds/update-versions` but may be manually updated.

ethers/v5.0.0-beta.169 (2020-01-20 19:42)
-----------------------------------------

- Fixed imports after refactor. ([adf5622](https://github.com/ethers-io/ethers.js/commit/adf56229c6cc83003d319ea9a004677e2555d478))
- Refactor some enum names and add UTF-8 error support to the umbrella package. ([931da2f](https://github.com/ethers-io/ethers.js/commit/931da2f77446fc9266cf07f0d7d78d4376625005))
- Allow arbitrary apiKey for UrlJsonRpcProvider. ([5878b54](https://github.com/ethers-io/ethers.js/commit/5878b54d6eded1329a6dc3b4023f876a87f72b6e))
- Added more general error handling (e.g. error, ignore, replace) for calling toUtf8String. ([a055edb](https://github.com/ethers-io/ethers.js/commit/a055edb5855b96fdf179403458c1694b96fd906c))

ethers/v5.0.0-beta.168 (2020-01-18 21:46)
-----------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions packages/ethers/dist/ethers-all.esm.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ethers/dist/ethers-all.umd.min.js

Large diffs are not rendered by default.

156 changes: 107 additions & 49 deletions packages/ethers/dist/ethers.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -6619,7 +6619,7 @@ class NumberCoder extends Coder {
}
}

const version$6 = "strings/5.0.0-beta.135";
const version$6 = "strings/5.0.0-beta.136";

"use strict";
const logger$8 = new Logger(version$6);
Expand All @@ -6633,8 +6633,79 @@ var UnicodeNormalizationForm;
UnicodeNormalizationForm["NFKD"] = "NFKD";
})(UnicodeNormalizationForm || (UnicodeNormalizationForm = {}));
;
var Utf8ErrorReason;
(function (Utf8ErrorReason) {
// A continuation byte was present where there was nothing to continue
// - offset = the index the codepoint began in
Utf8ErrorReason["UNEXPECTED_CONTINUE"] = "unexpected continuation byte";
// An invalid (non-continuation) byte to start a UTF-8 codepoint was found
// - offset = the index the codepoint began in
Utf8ErrorReason["BAD_PREFIX"] = "bad codepoint prefix";
// The string is too short to process the expected codepoint
// - offset = the index the codepoint began in
Utf8ErrorReason["OVERRUN"] = "string overrun";
// A missing continuation byte was expected but not found
// - offset = the index the continuation byte was expected at
Utf8ErrorReason["MISSING_CONTINUE"] = "missing continuation byte";
// The computed code point is outside the range for UTF-8
// - offset = start of this codepoint
// - badCodepoint = the computed codepoint; outside the UTF-8 range
Utf8ErrorReason["OUT_OF_RANGE"] = "out of UTF-8 range";
// UTF-8 strings may not contain UTF-16 surrogate pairs
// - offset = start of this codepoint
// - badCodepoint = the computed codepoint; inside the UTF-16 surrogate range
Utf8ErrorReason["UTF16_SURROGATE"] = "UTF-16 surrogate";
// The string is an overlong reperesentation
// - offset = start of this codepoint
// - badCodepoint = the computed codepoint; already bounds checked
Utf8ErrorReason["OVERLONG"] = "overlong representation";
})(Utf8ErrorReason || (Utf8ErrorReason = {}));
;
function errorFunc(reason, offset, bytes, output, badCodepoint) {
return logger$8.throwArgumentError(`invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes);
}
function ignoreFunc(reason, offset, bytes, output, badCodepoint) {
// If there is an invalid prefix (including stray continuation), skip any additional continuation bytes
if (reason === Utf8ErrorReason.BAD_PREFIX || reason === Utf8ErrorReason.UNEXPECTED_CONTINUE) {
let i = 0;
for (let o = offset + 1; o < bytes.length; o++) {
if (bytes[o] >> 6 !== 0x02) {
break;
}
i++;
}
return i;
}
// This byte runs us past the end of the string, so just jump to the end
// (but the first byte was read already read and therefore skipped)
if (reason === Utf8ErrorReason.OVERRUN) {
return bytes.length - offset - 1;
}
// Nothing to skip
return 0;
}
function replaceFunc(reason, offset, bytes, output, badCodepoint) {
// Overlong representations are otherwise "valid" code points; just non-deistingtished
if (reason === Utf8ErrorReason.OVERLONG) {
output.push(badCodepoint);
return 0;
}
// Put the replacement character into the output
output.push(0xfffd);
// Otherwise, process as if ignoring errors
return ignoreFunc(reason, offset, bytes, output, badCodepoint);
}
// Common error handing strategies
const Utf8ErrorFuncs = Object.freeze({
error: errorFunc,
ignore: ignoreFunc,
replace: replaceFunc
});
// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499
function getUtf8CodePoints(bytes, ignoreErrors) {
function getUtf8CodePoints(bytes, onError) {
if (onError == null) {
onError = Utf8ErrorFuncs.error;
}
bytes = arrayify(bytes);
const result = [];
let i = 0;
Expand Down Expand Up @@ -6665,25 +6736,17 @@ function getUtf8CodePoints(bytes, ignoreErrors) {
overlongMask = 0xffff;
}
else {
if (!ignoreErrors) {
if ((c & 0xc0) === 0x80) {
throw new Error("invalid utf8 byte sequence; unexpected continuation byte");
}
throw new Error("invalid utf8 byte sequence; invalid prefix");
if ((c & 0xc0) === 0x80) {
i += onError(Utf8ErrorReason.UNEXPECTED_CONTINUE, i - 1, bytes, result);
}
else {
i += onError(Utf8ErrorReason.BAD_PREFIX, i - 1, bytes, result);
}
continue;
}
// Do we have enough bytes in our data?
if (i + extraLength > bytes.length) {
if (!ignoreErrors) {
throw new Error("invalid utf8 byte sequence; too short");
}
// If there is an invalid unprocessed byte, skip continuation bytes
for (; i < bytes.length; i++) {
if (bytes[i] >> 6 !== 0x02) {
break;
}
}
if (i - 1 + extraLength >= bytes.length) {
i += onError(Utf8ErrorReason.OVERRUN, i - 1, bytes, result);
continue;
}
// Remove the length prefix from the char
Expand All @@ -6692,38 +6755,31 @@ function getUtf8CodePoints(bytes, ignoreErrors) {
let nextChar = bytes[i];
// Invalid continuation byte
if ((nextChar & 0xc0) != 0x80) {
i += onError(Utf8ErrorReason.MISSING_CONTINUE, i, bytes, result);
res = null;
break;
}
;
res = (res << 6) | (nextChar & 0x3f);
i++;
}
// See above loop for invalid contimuation byte
if (res === null) {
if (!ignoreErrors) {
throw new Error("invalid utf8 byte sequence; invalid continuation byte");
}
continue;
}
// Check for overlong seuences (more bytes than needed)
if (res <= overlongMask) {
if (!ignoreErrors) {
throw new Error("invalid utf8 byte sequence; overlong");
}
continue;
}
// Maximum code point
if (res > 0x10ffff) {
if (!ignoreErrors) {
throw new Error("invalid utf8 byte sequence; out-of-range");
}
i += onError(Utf8ErrorReason.OUT_OF_RANGE, i - 1 - extraLength, bytes, result, res);
continue;
}
// Reserved for UTF-16 surrogate halves
if (res >= 0xd800 && res <= 0xdfff) {
if (!ignoreErrors) {
throw new Error("invalid utf8 byte sequence; utf-16 surrogate");
}
i += onError(Utf8ErrorReason.UTF16_SURROGATE, i - 1 - extraLength, bytes, result, res);
continue;
}
// Check for overlong sequences (more bytes than needed)
if (res <= overlongMask) {
i += onError(Utf8ErrorReason.OVERLONG, i - 1 - extraLength, bytes, result, res);
continue;
}
result.push(res);
Expand Down Expand Up @@ -6772,8 +6828,8 @@ function escapeChar(value) {
const hex = ("0000" + value.toString(16));
return "\\u" + hex.substring(hex.length - 4);
}
function _toEscapedUtf8String(bytes, ignoreErrors) {
return '"' + getUtf8CodePoints(bytes, ignoreErrors).map((codePoint) => {
function _toEscapedUtf8String(bytes, onError) {
return '"' + getUtf8CodePoints(bytes, onError).map((codePoint) => {
if (codePoint < 256) {
switch (codePoint) {
case 8: return "\\b";
Expand Down Expand Up @@ -6803,8 +6859,8 @@ function _toUtf8String(codePoints) {
return String.fromCharCode((((codePoint >> 10) & 0x3ff) + 0xd800), ((codePoint & 0x3ff) + 0xdc00));
}).join("");
}
function toUtf8String(bytes, ignoreErrors) {
return _toUtf8String(getUtf8CodePoints(bytes, ignoreErrors));
function toUtf8String(bytes, onError) {
return _toUtf8String(getUtf8CodePoints(bytes, onError));
}
function toUtf8CodePoints(str, form = UnicodeNormalizationForm.current) {
return getUtf8CodePoints(toUtf8Bytes(str, form));
Expand Down Expand Up @@ -9856,7 +9912,7 @@ hash.ripemd160 = hash.ripemd.ripemd160;
var _version = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "sha2/5.0.0-beta.133";
exports.version = "sha2/5.0.0-beta.134";
});

var _version$1 = unwrapExports(_version);
Expand All @@ -9877,11 +9933,11 @@ var hash = __importStar(hash_1);


var logger = new lib_esm.Logger(_version.version);
var SupportedAlgorithms;
(function (SupportedAlgorithms) {
SupportedAlgorithms["sha256"] = "sha256";
SupportedAlgorithms["sha512"] = "sha512";
})(SupportedAlgorithms = exports.SupportedAlgorithms || (exports.SupportedAlgorithms = {}));
var SupportedAlgorithm;
(function (SupportedAlgorithm) {
SupportedAlgorithm["sha256"] = "sha256";
SupportedAlgorithm["sha512"] = "sha512";
})(SupportedAlgorithm = exports.SupportedAlgorithm || (exports.SupportedAlgorithm = {}));
;
function ripemd160(data) {
return "0x" + (hash.ripemd160().update(lib_esm$1.arrayify(data)).digest("hex"));
Expand All @@ -9896,7 +9952,7 @@ function sha512(data) {
}
exports.sha512 = sha512;
function computeHmac(algorithm, key, data) {
if (!SupportedAlgorithms[algorithm]) {
if (!SupportedAlgorithm[algorithm]) {
logger.throwError("unsupported algorithm " + algorithm, lib_esm.Logger.errors.UNSUPPORTED_OPERATION, {
operation: "hmac",
algorithm: algorithm
Expand All @@ -9908,7 +9964,7 @@ exports.computeHmac = computeHmac;
});

var browser$1 = unwrapExports(browser);
var browser_1 = browser.SupportedAlgorithms;
var browser_1 = browser.SupportedAlgorithm;
var browser_2 = browser.ripemd160;
var browser_3 = browser.sha256;
var browser_4 = browser.sha512;
Expand Down Expand Up @@ -12682,7 +12738,7 @@ var browser$5 = unwrapExports(browser$4);
var browser_1$2 = browser$4.Wordlist;
var browser_2$1 = browser$4.wordlists;

const version$e = "hdnode/5.0.0-beta.136";
const version$e = "hdnode/5.0.0-beta.137";

"use strict";
const logger$h = new Logger(version$e);
Expand Down Expand Up @@ -16160,7 +16216,7 @@ function poll(func, options) {
});
}

const version$j = "providers/5.0.0-beta.149";
const version$j = "providers/5.0.0-beta.150";

"use strict";
const logger$n = new Logger(version$j);
Expand Down Expand Up @@ -19171,6 +19227,7 @@ var utils$1 = /*#__PURE__*/Object.freeze({
toUtf8Bytes: toUtf8Bytes,
toUtf8CodePoints: toUtf8CodePoints,
toUtf8String: toUtf8String,
Utf8ErrorFuncs: Utf8ErrorFuncs,
formatBytes32String: formatBytes32String,
parseBytes32String: parseBytes32String,
hashMessage: hashMessage,
Expand Down Expand Up @@ -19207,12 +19264,13 @@ var utils$1 = /*#__PURE__*/Object.freeze({
entropyToMnemonic: entropyToMnemonic,
isValidMnemonic: isValidMnemonic,
mnemonicToSeed: mnemonicToSeed,
SupportedAlgorithms: browser_1,
SupportedAlgorithm: browser_1,
get UnicodeNormalizationForm () { return UnicodeNormalizationForm; },
get Utf8ErrorReason () { return Utf8ErrorReason; },
Indexed: Indexed
});

const version$l = "ethers/5.0.0-beta.168";
const version$l = "ethers/5.0.0-beta.169";

"use strict";
const errors = Logger.errors;
Expand Down
4 changes: 2 additions & 2 deletions packages/ethers/dist/ethers.esm.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 1ff5f52

Please sign in to comment.