Comparing version 4.3.0 to 4.3.1
[ | ||
{ | ||
"version": "4.3.1", | ||
"changes": [ | ||
{ | ||
"note": "Dependencies updated" | ||
} | ||
], | ||
"timestamp": 1554997931 | ||
}, | ||
{ | ||
"version": "4.3.0", | ||
@@ -4,0 +13,0 @@ "changes": [ |
@@ -8,2 +8,6 @@ <!-- | ||
## v4.3.1 - _April 11, 2019_ | ||
* Dependencies updated | ||
## v4.3.0 - _March 21, 2019_ | ||
@@ -10,0 +14,0 @@ |
@@ -59,3 +59,3 @@ "use strict"; | ||
var numIndexedArgs = log.topics.length - 1; | ||
if (_.isUndefined(this._eventIds[eventId]) || _.isUndefined(this._eventIds[eventId][numIndexedArgs])) { | ||
if (this._eventIds[eventId] === undefined || this._eventIds[eventId][numIndexedArgs] === undefined) { | ||
return log; | ||
@@ -86,3 +86,3 @@ } | ||
var value = param.indexed ? log.topics[topicsIndex++] : decodedData[i]; | ||
if (_.isUndefined(value)) { | ||
if (value === undefined) { | ||
didFailToDecode = true; | ||
@@ -119,12 +119,12 @@ return; | ||
var candidateFunctionInfos = this._selectorToFunctionInfo[functionSelector]; | ||
if (_.isUndefined(candidateFunctionInfos)) { | ||
if (candidateFunctionInfos === undefined) { | ||
throw new Error("No functions registered for selector '" + functionSelector + "'"); | ||
} | ||
var functionInfo = _.find(candidateFunctionInfos, function (candidateFunctionInfo) { | ||
return (_.isUndefined(contractName) || _.toLower(contractName) === _.toLower(candidateFunctionInfo.contractName)); | ||
return (contractName === undefined || _.toLower(contractName) === _.toLower(candidateFunctionInfo.contractName)); | ||
}); | ||
if (_.isUndefined(functionInfo)) { | ||
if (functionInfo === undefined) { | ||
throw new Error("No function registered with selector " + functionSelector + " and contract name " + contractName + "."); | ||
} | ||
else if (_.isUndefined(functionInfo.abiEncoder)) { | ||
else if (functionInfo.abiEncoder === undefined) { | ||
throw new Error("Function ABI Encoder is not defined, for function registered with selector " + functionSelector + " and contract name " + contractName + "."); | ||
@@ -154,3 +154,3 @@ } | ||
var _this = this; | ||
if (_.isUndefined(abiArray)) { | ||
if (abiArray === undefined) { | ||
return; | ||
@@ -157,0 +157,0 @@ } |
@@ -19,5 +19,5 @@ "use strict"; | ||
DataType.prototype.encode = function (value, rules, selector) { | ||
var rules_ = _.isUndefined(rules) ? constants_1.constants.DEFAULT_ENCODING_RULES : rules; | ||
var rules_ = rules === undefined ? constants_1.constants.DEFAULT_ENCODING_RULES : rules; | ||
var calldata = new calldata_1.Calldata(rules_); | ||
if (!_.isUndefined(selector)) { | ||
if (selector !== undefined) { | ||
calldata.setSelector(selector); | ||
@@ -31,8 +31,8 @@ } | ||
DataType.prototype.decode = function (calldata, rules, selector) { | ||
if (!_.isUndefined(selector) && !_.startsWith(calldata, selector)) { | ||
if (selector !== undefined && !_.startsWith(calldata, selector)) { | ||
throw new Error("Tried to decode calldata, but it was missing the function selector. Expected prefix '" + selector + "'. Got '" + calldata + "'."); | ||
} | ||
var hasSelector = !_.isUndefined(selector); | ||
var hasSelector = selector !== undefined; | ||
var rawCalldata = new raw_calldata_1.RawCalldata(calldata, hasSelector); | ||
var rules_ = _.isUndefined(rules) ? constants_1.constants.DEFAULT_DECODING_RULES : rules; | ||
var rules_ = rules === undefined ? constants_1.constants.DEFAULT_DECODING_RULES : rules; | ||
var value = rawCalldata.getSizeInBytes() > 0 ? this.generateValue(rawCalldata, rules_) : this.getDefaultValue(rules_); | ||
@@ -52,3 +52,3 @@ return value; | ||
var lastIndexOfScopeDelimiter = name.lastIndexOf('.'); | ||
var isScopedName = !_.isUndefined(lastIndexOfScopeDelimiter) && lastIndexOfScopeDelimiter > 0; | ||
var isScopedName = lastIndexOfScopeDelimiter !== undefined && lastIndexOfScopeDelimiter > 0; | ||
var shortName = isScopedName ? name.substr(lastIndexOfScopeDelimiter + 1) : name; | ||
@@ -55,0 +55,0 @@ var detailedSignature = shortName + " " + this.getSignatureType(); |
@@ -16,3 +16,2 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var _ = require("lodash"); | ||
var blob_1 = require("../../calldata/blocks/blob"); | ||
@@ -31,3 +30,3 @@ var data_type_1 = require("../data_type"); | ||
var signature = this.getSignature(); | ||
var parentName = _.isUndefined(parentBlock) ? '' : parentBlock.getName(); | ||
var parentName = parentBlock === undefined ? '' : parentBlock.getName(); | ||
var block = new blob_1.BlobCalldataBlock(name, signature, parentName, encodedValue); | ||
@@ -34,0 +33,0 @@ return block; |
@@ -17,3 +17,2 @@ "use strict"; | ||
var ethUtil = require("ethereumjs-util"); | ||
var _ = require("lodash"); | ||
var pointer_1 = require("../../calldata/blocks/pointer"); | ||
@@ -31,3 +30,3 @@ var constants_1 = require("../../utils/constants"); | ||
AbstractPointerDataType.prototype.generateCalldataBlock = function (value, parentBlock) { | ||
if (_.isUndefined(parentBlock)) { | ||
if (parentBlock === undefined) { | ||
throw new Error("DependentDataType requires a parent block to generate its block"); | ||
@@ -34,0 +33,0 @@ } |
@@ -50,3 +50,3 @@ "use strict"; | ||
_this._arrayElementType = arrayElementType; | ||
if (isArray && !_.isUndefined(arrayLength)) { | ||
if (isArray && arrayLength !== undefined) { | ||
_a = __read(_this._createMembersWithLength(dataItem, arrayLength), 2), _this._members = _a[0], _this._memberIndexByName = _a[1]; | ||
@@ -71,3 +71,3 @@ } | ||
// populated in the constructor. So we must construct the set of members now. | ||
if (this._isArray && _.isUndefined(this._arrayLength)) { | ||
if (this._isArray && this._arrayLength === undefined) { | ||
var arrayLengthBuf = calldata.popWord(); | ||
@@ -104,3 +104,3 @@ var arrayLengthHex = ethUtil.bufferToHex(arrayLengthBuf); | ||
// An array with an undefined length is never static. | ||
if (this._isArray && _.isUndefined(this._arrayLength)) { | ||
if (this._isArray && this._arrayLength === undefined) { | ||
return false; | ||
@@ -112,3 +112,3 @@ } | ||
}); | ||
var isStatic = _.isUndefined(dependentMember); | ||
var isStatic = dependentMember === undefined; | ||
return isStatic; | ||
@@ -119,6 +119,6 @@ }; | ||
var defaultValue; | ||
if (this._isArray && _.isUndefined(this._arrayLength)) { | ||
if (this._isArray && this._arrayLength === undefined) { | ||
defaultValue = []; | ||
} | ||
else if (!_.isUndefined(rules) && rules.shouldConvertStructsToObjects && !this._isArray) { | ||
else if (rules !== undefined && rules.shouldConvertStructsToObjects && !this._isArray) { | ||
defaultValue = {}; | ||
@@ -143,11 +143,11 @@ _.each(this._memberIndexByName, function (idx, key) { | ||
// Sanity check: if the set has a defined length then `value` must have the same length. | ||
if (!_.isUndefined(this._arrayLength) && value.length !== this._arrayLength) { | ||
if (this._arrayLength !== undefined && value.length !== this._arrayLength) { | ||
throw new Error("Expected array of " + JSON.stringify(this._arrayLength) + " elements, but got array of length " + JSON.stringify(value.length)); | ||
} | ||
// Create a new calldata block for this set. | ||
var parentName = _.isUndefined(parentBlock) ? '' : parentBlock.getName(); | ||
var parentName = parentBlock === undefined ? '' : parentBlock.getName(); | ||
var block = new set_1.SetCalldataBlock(this.getDataItem().name, this.getSignature(), parentName); | ||
// If this set has an undefined length then set its header to be the number of elements. | ||
var members = this._members; | ||
if (this._isArray && _.isUndefined(this._arrayLength)) { | ||
if (this._isArray && this._arrayLength === undefined) { | ||
_a = __read(this._createMembersWithLength(this.getDataItem(), value.length), 1), members = _a[0]; | ||
@@ -169,3 +169,3 @@ var lenBuf = ethUtil.setLengthLeft(ethUtil.toBuffer("0x" + value.length.toString(constants_1.constants.HEX_BASE)), constants_1.constants.EVM_WORD_WIDTH_IN_BYTES); | ||
// Create a new calldata block for this set. | ||
var parentName = _.isUndefined(parentBlock) ? '' : parentBlock.getName(); | ||
var parentName = parentBlock === undefined ? '' : parentBlock.getName(); | ||
var block = new set_1.SetCalldataBlock(this.getDataItem().name, this.getSignature(), parentName); | ||
@@ -202,3 +202,3 @@ // Create blocks for members of set. | ||
// Sanity check | ||
if (_.isUndefined(dataItem.components)) { | ||
if (dataItem.components === undefined) { | ||
throw new Error("Tried to create a set using key/value pairs, but no components were defined by the input DataItem '" + dataItem.name + "'."); | ||
@@ -225,3 +225,3 @@ } | ||
var components = memberItem.components; | ||
if (!_.isUndefined(components)) { | ||
if (components !== undefined) { | ||
childDataItem.components = components; | ||
@@ -243,7 +243,7 @@ } | ||
var memberDataItem = { | ||
type: _.isUndefined(_this._arrayElementType) ? '' : _this._arrayElementType, | ||
type: _this._arrayElementType === undefined ? '' : _this._arrayElementType, | ||
name: dataItem.name + "[" + idx.toString(constants_1.constants.DEC_BASE) + "]", | ||
}; | ||
var components = dataItem.components; | ||
if (!_.isUndefined(components)) { | ||
if (components !== undefined) { | ||
memberDataItem.components = components; | ||
@@ -250,0 +250,0 @@ } |
@@ -17,3 +17,2 @@ "use strict"; | ||
var ethUtil = require("ethereumjs-util"); | ||
var _ = require("lodash"); | ||
var constants_1 = require("../../utils/constants"); | ||
@@ -34,5 +33,3 @@ var calldata_block_1 = require("../calldata_block"); | ||
PointerCalldataBlock.prototype.toBuffer = function () { | ||
var destinationOffset = !_.isUndefined(this._aliasFor) | ||
? this._aliasFor.getOffsetInBytes() | ||
: this._dependency.getOffsetInBytes(); | ||
var destinationOffset = this._aliasFor !== undefined ? this._aliasFor.getOffsetInBytes() : this._dependency.getOffsetInBytes(); | ||
var parentOffset = this._parent.getOffsetInBytes(); | ||
@@ -39,0 +36,0 @@ var parentHeaderSize = this._parent.getHeaderSizeInBytes(); |
@@ -28,3 +28,3 @@ "use strict"; | ||
var rawDataComponents = []; | ||
if (!_.isUndefined(this._header)) { | ||
if (this._header !== undefined) { | ||
rawDataComponents.push(this._header); | ||
@@ -47,3 +47,3 @@ } | ||
SetCalldataBlock.prototype.toBuffer = function () { | ||
if (!_.isUndefined(this._header)) { | ||
if (this._header !== undefined) { | ||
return this._header; | ||
@@ -50,0 +50,0 @@ } |
@@ -53,3 +53,3 @@ "use strict"; | ||
// Sanity check: root block must be set | ||
if (_.isUndefined(this._root)) { | ||
if (this._root === undefined) { | ||
throw new Error('expected root'); | ||
@@ -126,3 +126,3 @@ } | ||
// Step 1/1 Create a reverse iterator (starts from the end of the calldata to the beginning) | ||
if (_.isUndefined(this._root)) { | ||
if (this._root === undefined) { | ||
throw new Error('expected root'); | ||
@@ -168,3 +168,3 @@ } | ||
// Sanity check: must have a root block. | ||
if (_.isUndefined(this._root)) { | ||
if (this._root === undefined) { | ||
throw new Error('expected root'); | ||
@@ -219,3 +219,3 @@ } | ||
// Sanity check: must have a root block. | ||
if (_.isUndefined(this._root)) { | ||
if (this._root === undefined) { | ||
throw new Error('expected root'); | ||
@@ -222,0 +222,0 @@ } |
@@ -72,3 +72,3 @@ "use strict"; | ||
// A pointer that is an alias for another pointer is ignored. | ||
if (member instanceof pointer_1.PointerCalldataBlock && _.isUndefined(member.getAlias())) { | ||
if (member instanceof pointer_1.PointerCalldataBlock && member.getAlias() === undefined) { | ||
var dependency = member.getDependency(); | ||
@@ -87,3 +87,3 @@ queue.mergeBack(BaseIterator._createQueue(dependency)); | ||
var nextBlock = _this.nextBlock(); | ||
if (!_.isUndefined(nextBlock)) { | ||
if (nextBlock !== undefined) { | ||
return { | ||
@@ -90,0 +90,0 @@ value: nextBlock, |
@@ -58,3 +58,3 @@ "use strict"; | ||
var scopeOffset = this._scopes.peekFront(); | ||
if (_.isUndefined(scopeOffset)) { | ||
if (scopeOffset === undefined) { | ||
throw new Error("Tried to access undefined scope."); | ||
@@ -61,0 +61,0 @@ } |
@@ -160,6 +160,6 @@ "use strict"; | ||
// @TODO: DataTypeement Fixed/UFixed types | ||
if (_.isUndefined(dataType)) { | ||
if (dataType === undefined) { | ||
throw new Error("Unrecognized data type: '" + dataItem.type + "'"); | ||
} | ||
else if (!_.isUndefined(parentDataType) && !dataType.isStatic()) { | ||
else if (parentDataType !== undefined && !dataType.isStatic()) { | ||
var pointerToDataType = new Pointer(dataType, parentDataType); | ||
@@ -213,4 +213,4 @@ return pointerToDataType; | ||
function createMethod(methodName, input, output) { | ||
var methodInput = _.isUndefined(input) ? [] : consolidateDataItemsIntoArray(input); | ||
var methodOutput = _.isUndefined(output) ? [] : consolidateDataItemsIntoArray(output); | ||
var methodInput = input === undefined ? [] : consolidateDataItemsIntoArray(input); | ||
var methodOutput = output === undefined ? [] : consolidateDataItemsIntoArray(output); | ||
var methodAbi = { | ||
@@ -217,0 +217,0 @@ name: methodName, |
@@ -52,9 +52,9 @@ "use strict"; | ||
var matches = ArrayDataType._MATCHER.exec(type); | ||
if (_.isNull(matches) || matches.length !== 3) { | ||
if (matches === null || matches.length !== 3) { | ||
throw new Error("Could not parse array: " + type); | ||
} | ||
else if (_.isUndefined(matches[1])) { | ||
else if (matches[1] === undefined) { | ||
throw new Error("Could not parse array type: " + type); | ||
} | ||
else if (_.isUndefined(matches[2])) { | ||
else if (matches[2] === undefined) { | ||
throw new Error("Could not parse array length: " + type); | ||
@@ -75,3 +75,3 @@ } | ||
var lastIndexOfScopeDelimiter = name.lastIndexOf('.'); | ||
var isScopedName = !_.isUndefined(lastIndexOfScopeDelimiter) && lastIndexOfScopeDelimiter > 0; | ||
var isScopedName = lastIndexOfScopeDelimiter !== undefined && lastIndexOfScopeDelimiter > 0; | ||
var shortName = isScopedName ? name.substr(lastIndexOfScopeDelimiter + 1) : name; | ||
@@ -88,3 +88,3 @@ var detailedSignature = shortName + " " + this._computeSignature(isDetailed); | ||
var elementComponents = this.getDataItem().components; | ||
if (!_.isUndefined(elementComponents)) { | ||
if (elementComponents !== undefined) { | ||
elementDataItem.components = elementComponents; | ||
@@ -95,3 +95,3 @@ } | ||
// Construct signature for array of type `element` | ||
if (_.isUndefined(this._arrayLength)) { | ||
if (this._arrayLength === undefined) { | ||
return elementSignature + "[]"; | ||
@@ -98,0 +98,0 @@ } |
@@ -17,3 +17,2 @@ "use strict"; | ||
var ethereum_types_1 = require("ethereum-types"); | ||
var _ = require("lodash"); | ||
var configured_bignumber_1 = require("../../configured_bignumber"); | ||
@@ -40,3 +39,3 @@ var blob_1 = require("../abstract_data_types/types/blob"); | ||
var matches = IntDataType._MATCHER.exec(type); | ||
var width = !_.isNull(matches) && matches.length === 2 && !_.isUndefined(matches[1]) | ||
var width = matches !== null && matches.length === 2 && matches[1] !== undefined | ||
? parseInt(matches[1], constants_1.constants.DEC_BASE) | ||
@@ -43,0 +42,0 @@ : IntDataType._DEFAULT_WIDTH; |
@@ -36,3 +36,3 @@ "use strict"; | ||
var matches = StaticBytesDataType._MATCHER.exec(type); | ||
var width = !_.isNull(matches) && matches.length === 3 && !_.isUndefined(matches[2]) | ||
var width = matches !== null && matches.length === 3 && matches[2] !== undefined | ||
? parseInt(matches[2], constants_1.constants.DEC_BASE) | ||
@@ -39,0 +39,0 @@ : StaticBytesDataType._DEFAULT_WIDTH; |
@@ -40,3 +40,3 @@ "use strict"; | ||
var lastIndexOfScopeDelimiter = name.lastIndexOf('.'); | ||
var isScopedName = !_.isUndefined(lastIndexOfScopeDelimiter) && lastIndexOfScopeDelimiter > 0; | ||
var isScopedName = lastIndexOfScopeDelimiter !== undefined && lastIndexOfScopeDelimiter > 0; | ||
var shortName = isScopedName ? name.substr(lastIndexOfScopeDelimiter + 1) : name; | ||
@@ -43,0 +43,0 @@ var detailedSignature = shortName + " " + this._computeSignatureOfMembers(isDetailed); |
@@ -17,3 +17,2 @@ "use strict"; | ||
var ethereum_types_1 = require("ethereum-types"); | ||
var _ = require("lodash"); | ||
var configured_bignumber_1 = require("../../configured_bignumber"); | ||
@@ -39,3 +38,3 @@ var blob_1 = require("../abstract_data_types/types/blob"); | ||
var matches = UIntDataType._MATCHER.exec(type); | ||
var width = !_.isNull(matches) && matches.length === 2 && !_.isUndefined(matches[1]) | ||
var width = matches !== null && matches.length === 2 && matches[1] !== undefined | ||
? parseInt(matches[1], constants_1.constants.DEC_BASE) | ||
@@ -42,0 +41,0 @@ : UIntDataType._DEFAULT_WIDTH; |
@@ -47,9 +47,9 @@ "use strict"; | ||
function isAbiDataEqual(name, type, x, y) { | ||
if (_.isUndefined(x) && _.isUndefined(y)) { | ||
if (x === undefined && y === undefined) { | ||
return true; | ||
} | ||
else if (_.isUndefined(x) && !_.isUndefined(y)) { | ||
else if (x === undefined && y !== undefined) { | ||
return false; | ||
} | ||
else if (!_.isUndefined(x) && _.isUndefined(y)) { | ||
else if (x !== undefined && y === undefined) { | ||
return false; | ||
@@ -76,3 +76,3 @@ } | ||
} | ||
else if (_.isNull(name)) { | ||
else if (name === null) { | ||
throw new Error('Internal error: type was tuple but names was null'); | ||
@@ -79,0 +79,0 @@ } |
@@ -58,3 +58,2 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var _ = require("lodash"); | ||
/** | ||
@@ -77,3 +76,3 @@ * Transforms callback-based function -- func(arg1, arg2 .. argN, callback) -- into an ES6-compatible Promise. | ||
var callback = function (err, data) { | ||
_.isNull(err) || _.isUndefined(err) ? resolve(data) : reject(err); | ||
err === null || err === undefined ? resolve(data) : reject(err); | ||
}; | ||
@@ -80,0 +79,0 @@ originalFn.apply(thisArg, __spread(callArgs, [callback])); |
@@ -61,3 +61,3 @@ "use strict"; | ||
} | ||
else if (!_.isUndefined(supportedProvider.sendAsync)) { | ||
else if (supportedProvider.sendAsync !== undefined) { | ||
provider.sendAsync = supportedProvider.sendAsync.bind(supportedProvider); | ||
@@ -67,3 +67,3 @@ return provider; | ||
} | ||
else if (!_.isUndefined(supportedProvider.send)) { | ||
else if (supportedProvider.send !== undefined) { | ||
// HACK(fabio): Detect if the `send` method has the old interface `send(payload, cb)` such | ||
@@ -70,0 +70,0 @@ // as in versions < Web3.js@1.0.0-beta.37. If so, do a simple re-mapping |
{ | ||
"name": "@0x/utils", | ||
"version": "4.3.0", | ||
"version": "4.3.1", | ||
"engines": { | ||
@@ -15,2 +15,3 @@ "node": ">=6.12" | ||
"lint": "tslint --format stylish --project .", | ||
"fix": "tslint --fix --format stylish --project .", | ||
"test": "yarn run_mocha", | ||
@@ -32,3 +33,3 @@ "test:circleci": "yarn test:coverage", | ||
"devDependencies": { | ||
"@0x/tslint-config": "^3.0.0", | ||
"@0x/tslint-config": "^3.0.1", | ||
"@types/detect-node": "2.0.0", | ||
@@ -49,4 +50,4 @@ "@types/lodash": "4.14.104", | ||
"dependencies": { | ||
"@0x/types": "^2.2.1", | ||
"@0x/typescript-typings": "^4.2.1", | ||
"@0x/types": "^2.2.2", | ||
"@0x/typescript-typings": "^4.2.2", | ||
"@types/node": "*", | ||
@@ -57,3 +58,3 @@ "abortcontroller-polyfill": "^1.1.9", | ||
"detect-node": "2.0.3", | ||
"ethereum-types": "^2.1.1", | ||
"ethereum-types": "^2.1.2", | ||
"ethereumjs-util": "^5.1.1", | ||
@@ -68,3 +69,3 @@ "ethers": "~4.0.4", | ||
}, | ||
"gitHead": "0f45409b4d481b72280db4eb872c0c72beeea504" | ||
"gitHead": "c78a60299053f0ec825bf34dd3ea0cea7bb9365b" | ||
} |
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
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
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
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
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
724088
236
9514
Updated@0x/types@^2.2.2
Updatedethereum-types@^2.1.2