Upgrade to typescript v4.2.2 (#188)

* upgrade to typescript v4.2.2

* prettier; remove outdated test
This commit is contained in:
Xianny
2021-03-30 13:26:05 -07:00
committed by GitHub
parent 525bc8197b
commit 7bf009fbf6
50 changed files with 58 additions and 426 deletions

View File

@@ -39,7 +39,7 @@
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"tslint": "5.11.0",
"typescript": "3.0.1"
"typescript": "4.2.2"
},
"dependencies": {
"@0x/assert": "^3.0.21",

View File

@@ -14,6 +14,6 @@ export function shortZip<T1, T2>(a: T1[], b: T2[]): Array<[T1, T2]> {
export function replaceKeysDeep(obj: {}, mapKeys: (key: string) => string | void): _.Dictionary<{}> {
return _.transform(obj, (result, value, key) => {
const currentKey = mapKeys(key) || key;
result[currentKey] = _.isObject(value) ? replaceKeysDeep(value, mapKeys) : value;
result[currentKey] = _.isObject(value) ? replaceKeysDeep(value as {}, mapKeys) : (value as {});
});
}

View File

@@ -22,14 +22,14 @@ export class OrderFactory {
): Promise<SignedOrder> {
const fifteenMinutesInSeconds = 15 * 60;
const currentBlockTimestamp = await getLatestBlockTimestampAsync();
const order = ({
const order = {
takerAddress: constants.NULL_ADDRESS,
senderAddress: constants.NULL_ADDRESS,
expirationTimeSeconds: new BigNumber(currentBlockTimestamp).plus(fifteenMinutesInSeconds),
salt: generatePseudoRandomSalt(),
...this._defaultOrderParams,
...customOrderParams,
} as any) as Order;
} as Order; // tslint:disable-line:no-object-literal-type-assertion
const orderHashBuff = orderHashUtils.getOrderHashBuffer(order);
const signature = signingUtils.signMessage(orderHashBuff, this._privateKey, signatureType);
const signedOrder = {

View File

@@ -30,7 +30,8 @@ export const orderUtils = {
return cancel;
},
createOrderWithoutSignature(signedOrder: SignedOrder): Order {
return _.omit(signedOrder, ['signature']) as Order;
const { signature, ...order } = signedOrder;
return order;
},
createBatchMatchOrders(signedOrdersLeft: SignedOrder[], signedOrdersRight: SignedOrder[]): BatchMatchOrder {
return {