Updated dist files.

This commit is contained in:
Richard Moore 2018-11-09 14:42:29 -05:00
parent 478aaf9619
commit 09b698b0a9
No known key found for this signature in database
GPG Key ID: 525F70A6FCABC295
16 changed files with 45 additions and 13 deletions

2
_version.d.ts vendored
View File

@ -1 +1 @@
export declare const version = "4.0.9";
export declare const version = "4.0.10";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "4.0.9";
exports.version = "4.0.10";

18
dist/ethers.js vendored
View File

@ -1,7 +1,7 @@
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ethers = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "4.0.9";
exports.version = "4.0.10";
},{}],2:[function(require,module,exports){
"use strict";
@ -861,6 +861,17 @@ function setCensorship(censorship, permanent) {
_permanentCensorErrors = !!permanent;
}
exports.setCensorship = setCensorship;
function checkNormalize() {
try {
if (String.fromCharCode(0xe9).normalize('NFD') !== String.fromCharCode(0x65, 0x0301)) {
throw new Error('broken');
}
}
catch (error) {
throwError('platform missing String.prototype.normalize', exports.UNSUPPORTED_OPERATION, { operation: 'String.prototype.normalize' });
}
}
exports.checkNormalize = checkNormalize;
},{"./_version":1}],6:[function(require,module,exports){
'use strict';
@ -13779,6 +13790,7 @@ function mnemonicToEntropy(mnemonic, wordlist) {
if (!wordlist) {
wordlist = lang_en_1.langEn;
}
errors.checkNormalize();
var words = wordlist.split(mnemonic);
if ((words.length % 3) !== 0) {
throw new Error('invalid mnemonic');
@ -15926,6 +15938,7 @@ exports.parseEther = parseEther;
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
var constants_1 = require("../constants");
var errors_1 = require("../errors");
var bytes_1 = require("./bytes");
///////////////////////////////
var UnicodeNormalizationForm;
@ -15941,6 +15954,7 @@ var UnicodeNormalizationForm;
function toUtf8Bytes(str, form) {
if (form === void 0) { form = UnicodeNormalizationForm.current; }
if (form != UnicodeNormalizationForm.current) {
errors_1.checkNormalize();
str = str.normalize(form);
}
var result = [];
@ -16109,7 +16123,7 @@ function parseBytes32String(bytes) {
}
exports.parseBytes32String = parseBytes32String;
},{"../constants":3,"./bytes":62}],84:[function(require,module,exports){
},{"../constants":3,"../errors":5,"./bytes":62}],84:[function(require,module,exports){
'use strict';
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;

2
dist/ethers.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -188,6 +188,7 @@ declare module 'ethers/errors' {
export function checkNew(self: any, kind: any): void;
export function checkArgumentCount(count: number, expectedCount: number, suffix?: string): void;
export function setCensorship(censorship: boolean, permanent?: boolean): void;
export function checkNormalize(): void;
}
declare module 'ethers/providers' {
@ -261,7 +262,7 @@ declare module 'ethers/utils/shims' {
}
declare module 'ethers/_version' {
export const version = "4.0.9";
export const version = "4.0.10";
}
declare module 'ethers/utils/bignumber' {

1
errors.d.ts vendored
View File

@ -14,3 +14,4 @@ export declare function throwError(message: string, code: string, params: any):
export declare function checkNew(self: any, kind: any): void;
export declare function checkArgumentCount(count: number, expectedCount: number, suffix?: string): void;
export declare function setCensorship(censorship: boolean, permanent?: boolean): void;
export declare function checkNormalize(): void;

View File

@ -108,3 +108,14 @@ function setCensorship(censorship, permanent) {
_permanentCensorErrors = !!permanent;
}
exports.setCensorship = setCensorship;
function checkNormalize() {
try {
if (String.fromCharCode(0xe9).normalize('NFD') !== String.fromCharCode(0x65, 0x0301)) {
throw new Error('broken');
}
}
catch (error) {
throwError('platform missing String.prototype.normalize', exports.UNSUPPORTED_OPERATION, { operation: 'String.prototype.normalize' });
}
}
exports.checkNormalize = checkNormalize;

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "ethers",
"version": "4.0.9",
"version": "4.0.10",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "ethers",
"version": "4.0.9",
"version": "4.0.10",
"description": "Ethereum wallet library.",
"main": "./index.js",
"types": "./index.d.ts",

View File

@ -1 +1 @@
export const version = "4.0.9";
export const version = "4.0.10";

View File

@ -166,6 +166,7 @@ function mnemonicToEntropy(mnemonic, wordlist) {
if (!wordlist) {
wordlist = lang_en_1.langEn;
}
errors.checkNormalize();
var words = wordlist.split(mnemonic);
if ((words.length % 3) !== 0) {
throw new Error('invalid mnemonic');

View File

@ -1,6 +1,7 @@
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
var constants_1 = require("../constants");
var errors_1 = require("../errors");
var bytes_1 = require("./bytes");
///////////////////////////////
var UnicodeNormalizationForm;
@ -16,6 +17,7 @@ var UnicodeNormalizationForm;
function toUtf8Bytes(str, form) {
if (form === void 0) { form = UnicodeNormalizationForm.current; }
if (form != UnicodeNormalizationForm.current) {
errors_1.checkNormalize();
str = str.normalize(form);
}
var result = [];

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -131,9 +131,7 @@ var LangJa = /** @class */ (function (_super) {
return wordlist.indexOf(word);
};
LangJa.prototype.split = function (mnemonic) {
if (!mnemonic.normalize) {
errors.throwError('Japanese is unsupported on this platform; missing String.prototype.normalize', errors.UNSUPPORTED_OPERATION, { operation: 'String.prototype.normalize' });
}
errors.checkNormalize();
return mnemonic.split(/(?:\u3000| )+/g);
};
LangJa.prototype.join = function (words) {