Skip to content

Commit

Permalink
style: simplify prettier config
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg authored and anilhelvaci committed Aug 15, 2023
1 parent 5e15482 commit f16bc3f
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 60 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
},
"prettier": {
"arrowParens": "avoid",
"trailingComma": "all",
"singleQuote": true
},
"scripts": {
Expand Down
30 changes: 15 additions & 15 deletions packages/cosmic-proto/dist/agoric/swingset/msgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ export const MsgDeliverInbound = {
fromJSON(object) {
return {
messages: Array.isArray(object?.messages)
? object.messages.map((e) => String(e))
? object.messages.map(e => String(e))
: [],
nums: Array.isArray(object?.nums)
? object.nums.map((e) => Long.fromValue(e))
? object.nums.map(e => Long.fromValue(e))
: [],
ack: isSet(object.ack) ? Long.fromValue(object.ack) : Long.UZERO,
submitter: isSet(object.submitter)
Expand All @@ -78,12 +78,12 @@ export const MsgDeliverInbound = {
toJSON(message) {
const obj = {};
if (message.messages) {
obj.messages = message.messages.map((e) => e);
obj.messages = message.messages.map(e => e);
} else {
obj.messages = [];
}
if (message.nums) {
obj.nums = message.nums.map((e) => (e || Long.UZERO).toString());
obj.nums = message.nums.map(e => (e || Long.UZERO).toString());
} else {
obj.nums = [];
}
Expand All @@ -97,8 +97,8 @@ export const MsgDeliverInbound = {
},
fromPartial(object) {
const message = createBaseMsgDeliverInbound();
message.messages = object.messages?.map((e) => e) || [];
message.nums = object.nums?.map((e) => Long.fromValue(e)) || [];
message.messages = object.messages?.map(e => e) || [];
message.nums = object.nums?.map(e => Long.fromValue(e)) || [];
message.ack =
object.ack !== undefined && object.ack !== null
? Long.fromValue(object.ack)
Expand Down Expand Up @@ -378,7 +378,7 @@ export const MsgProvision = {
? bytesFromBase64(object.address)
: new Uint8Array(),
powerFlags: Array.isArray(object?.powerFlags)
? object.powerFlags.map((e) => String(e))
? object.powerFlags.map(e => String(e))
: [],
submitter: isSet(object.submitter)
? bytesFromBase64(object.submitter)
Expand All @@ -393,7 +393,7 @@ export const MsgProvision = {
message.address !== undefined ? message.address : new Uint8Array(),
));
if (message.powerFlags) {
obj.powerFlags = message.powerFlags.map((e) => e);
obj.powerFlags = message.powerFlags.map(e => e);
} else {
obj.powerFlags = [];
}
Expand All @@ -407,7 +407,7 @@ export const MsgProvision = {
const message = createBaseMsgProvision();
message.nickname = object.nickname ?? '';
message.address = object.address ?? new Uint8Array();
message.powerFlags = object.powerFlags?.map((e) => e) || [];
message.powerFlags = object.powerFlags?.map(e => e) || [];
message.submitter = object.submitter ?? new Uint8Array();
return message;
},
Expand Down Expand Up @@ -588,35 +588,35 @@ export class MsgClientImpl {
InstallBundle(request) {
const data = MsgInstallBundle.encode(request).finish();
const promise = this.rpc.request(this.service, 'InstallBundle', data);
return promise.then((data) =>
return promise.then(data =>
MsgInstallBundleResponse.decode(new _m0.Reader(data)),
);
}
DeliverInbound(request) {
const data = MsgDeliverInbound.encode(request).finish();
const promise = this.rpc.request(this.service, 'DeliverInbound', data);
return promise.then((data) =>
return promise.then(data =>
MsgDeliverInboundResponse.decode(new _m0.Reader(data)),
);
}
WalletAction(request) {
const data = MsgWalletAction.encode(request).finish();
const promise = this.rpc.request(this.service, 'WalletAction', data);
return promise.then((data) =>
return promise.then(data =>
MsgWalletActionResponse.decode(new _m0.Reader(data)),
);
}
WalletSpendAction(request) {
const data = MsgWalletSpendAction.encode(request).finish();
const promise = this.rpc.request(this.service, 'WalletSpendAction', data);
return promise.then((data) =>
return promise.then(data =>
MsgWalletSpendActionResponse.decode(new _m0.Reader(data)),
);
}
Provision(request) {
const data = MsgProvision.encode(request).finish();
const promise = this.rpc.request(this.service, 'Provision', data);
return promise.then((data) =>
return promise.then(data =>
MsgProvisionResponse.decode(new _m0.Reader(data)),
);
}
Expand Down Expand Up @@ -653,7 +653,7 @@ function base64FromBytes(arr) {
return globalThis.Buffer.from(arr).toString('base64');
} else {
const bin = [];
arr.forEach((byte) => {
arr.forEach(byte => {
bin.push(String.fromCharCode(byte));
});
return globalThis.btoa(bin.join(''));
Expand Down
8 changes: 4 additions & 4 deletions packages/cosmic-proto/dist/agoric/swingset/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,21 +280,21 @@ export class QueryClientImpl {
Params(request) {
const data = QueryParamsRequest.encode(request).finish();
const promise = this.rpc.request(this.service, 'Params', data);
return promise.then((data) =>
return promise.then(data =>
QueryParamsResponse.decode(new _m0.Reader(data)),
);
}
Egress(request) {
const data = QueryEgressRequest.encode(request).finish();
const promise = this.rpc.request(this.service, 'Egress', data);
return promise.then((data) =>
return promise.then(data =>
QueryEgressResponse.decode(new _m0.Reader(data)),
);
}
Mailbox(request) {
const data = QueryMailboxRequest.encode(request).finish();
const promise = this.rpc.request(this.service, 'Mailbox', data);
return promise.then((data) =>
return promise.then(data =>
QueryMailboxResponse.decode(new _m0.Reader(data)),
);
}
Expand Down Expand Up @@ -331,7 +331,7 @@ function base64FromBytes(arr) {
return globalThis.Buffer.from(arr).toString('base64');
} else {
const bin = [];
arr.forEach((byte) => {
arr.forEach(byte => {
bin.push(String.fromCharCode(byte));
});
return globalThis.btoa(bin.join(''));
Expand Down
52 changes: 25 additions & 27 deletions packages/cosmic-proto/dist/agoric/swingset/swingset.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const CoreEvalProposal = {
title: isSet(object.title) ? String(object.title) : '',
description: isSet(object.description) ? String(object.description) : '',
evals: Array.isArray(object?.evals)
? object.evals.map((e) => CoreEval.fromJSON(e))
? object.evals.map(e => CoreEval.fromJSON(e))
: [],
};
},
Expand All @@ -57,9 +57,7 @@ export const CoreEvalProposal = {
message.description !== undefined &&
(obj.description = message.description);
if (message.evals) {
obj.evals = message.evals.map((e) =>
e ? CoreEval.toJSON(e) : undefined,
);
obj.evals = message.evals.map(e => (e ? CoreEval.toJSON(e) : undefined));
} else {
obj.evals = [];
}
Expand All @@ -69,7 +67,7 @@ export const CoreEvalProposal = {
const message = createBaseCoreEvalProposal();
message.title = object.title ?? '';
message.description = object.description ?? '';
message.evals = object.evals?.map((e) => CoreEval.fromPartial(e)) || [];
message.evals = object.evals?.map(e => CoreEval.fromPartial(e)) || [];
return message;
},
};
Expand Down Expand Up @@ -190,33 +188,33 @@ export const Params = {
fromJSON(object) {
return {
beansPerUnit: Array.isArray(object?.beansPerUnit)
? object.beansPerUnit.map((e) => StringBeans.fromJSON(e))
? object.beansPerUnit.map(e => StringBeans.fromJSON(e))
: [],
feeUnitPrice: Array.isArray(object?.feeUnitPrice)
? object.feeUnitPrice.map((e) => Coin.fromJSON(e))
? object.feeUnitPrice.map(e => Coin.fromJSON(e))
: [],
bootstrapVatConfig: isSet(object.bootstrapVatConfig)
? String(object.bootstrapVatConfig)
: '',
powerFlagFees: Array.isArray(object?.powerFlagFees)
? object.powerFlagFees.map((e) => PowerFlagFee.fromJSON(e))
? object.powerFlagFees.map(e => PowerFlagFee.fromJSON(e))
: [],
queueMax: Array.isArray(object?.queueMax)
? object.queueMax.map((e) => QueueSize.fromJSON(e))
? object.queueMax.map(e => QueueSize.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.beansPerUnit) {
obj.beansPerUnit = message.beansPerUnit.map((e) =>
obj.beansPerUnit = message.beansPerUnit.map(e =>
e ? StringBeans.toJSON(e) : undefined,
);
} else {
obj.beansPerUnit = [];
}
if (message.feeUnitPrice) {
obj.feeUnitPrice = message.feeUnitPrice.map((e) =>
obj.feeUnitPrice = message.feeUnitPrice.map(e =>
e ? Coin.toJSON(e) : undefined,
);
} else {
Expand All @@ -225,14 +223,14 @@ export const Params = {
message.bootstrapVatConfig !== undefined &&
(obj.bootstrapVatConfig = message.bootstrapVatConfig);
if (message.powerFlagFees) {
obj.powerFlagFees = message.powerFlagFees.map((e) =>
obj.powerFlagFees = message.powerFlagFees.map(e =>
e ? PowerFlagFee.toJSON(e) : undefined,
);
} else {
obj.powerFlagFees = [];
}
if (message.queueMax) {
obj.queueMax = message.queueMax.map((e) =>
obj.queueMax = message.queueMax.map(e =>
e ? QueueSize.toJSON(e) : undefined,
);
} else {
Expand All @@ -243,14 +241,14 @@ export const Params = {
fromPartial(object) {
const message = createBaseParams();
message.beansPerUnit =
object.beansPerUnit?.map((e) => StringBeans.fromPartial(e)) || [];
object.beansPerUnit?.map(e => StringBeans.fromPartial(e)) || [];
message.feeUnitPrice =
object.feeUnitPrice?.map((e) => Coin.fromPartial(e)) || [];
object.feeUnitPrice?.map(e => Coin.fromPartial(e)) || [];
message.bootstrapVatConfig = object.bootstrapVatConfig ?? '';
message.powerFlagFees =
object.powerFlagFees?.map((e) => PowerFlagFee.fromPartial(e)) || [];
object.powerFlagFees?.map(e => PowerFlagFee.fromPartial(e)) || [];
message.queueMax =
object.queueMax?.map((e) => QueueSize.fromPartial(e)) || [];
object.queueMax?.map(e => QueueSize.fromPartial(e)) || [];
return message;
},
};
Expand Down Expand Up @@ -284,14 +282,14 @@ export const State = {
fromJSON(object) {
return {
queueAllowed: Array.isArray(object?.queueAllowed)
? object.queueAllowed.map((e) => QueueSize.fromJSON(e))
? object.queueAllowed.map(e => QueueSize.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.queueAllowed) {
obj.queueAllowed = message.queueAllowed.map((e) =>
obj.queueAllowed = message.queueAllowed.map(e =>
e ? QueueSize.toJSON(e) : undefined,
);
} else {
Expand All @@ -302,7 +300,7 @@ export const State = {
fromPartial(object) {
const message = createBaseState();
message.queueAllowed =
object.queueAllowed?.map((e) => QueueSize.fromPartial(e)) || [];
object.queueAllowed?.map(e => QueueSize.fromPartial(e)) || [];
return message;
},
};
Expand Down Expand Up @@ -395,15 +393,15 @@ export const PowerFlagFee = {
return {
powerFlag: isSet(object.powerFlag) ? String(object.powerFlag) : '',
fee: Array.isArray(object?.fee)
? object.fee.map((e) => Coin.fromJSON(e))
? object.fee.map(e => Coin.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
message.powerFlag !== undefined && (obj.powerFlag = message.powerFlag);
if (message.fee) {
obj.fee = message.fee.map((e) => (e ? Coin.toJSON(e) : undefined));
obj.fee = message.fee.map(e => (e ? Coin.toJSON(e) : undefined));
} else {
obj.fee = [];
}
Expand All @@ -412,7 +410,7 @@ export const PowerFlagFee = {
fromPartial(object) {
const message = createBasePowerFlagFee();
message.powerFlag = object.powerFlag ?? '';
message.fee = object.fee?.map((e) => Coin.fromPartial(e)) || [];
message.fee = object.fee?.map(e => Coin.fromPartial(e)) || [];
return message;
},
};
Expand Down Expand Up @@ -514,7 +512,7 @@ export const Egress = {
? bytesFromBase64(object.peer)
: new Uint8Array(),
powerFlags: Array.isArray(object?.powerFlags)
? object.powerFlags.map((e) => String(e))
? object.powerFlags.map(e => String(e))
: [],
};
},
Expand All @@ -526,7 +524,7 @@ export const Egress = {
message.peer !== undefined ? message.peer : new Uint8Array(),
));
if (message.powerFlags) {
obj.powerFlags = message.powerFlags.map((e) => e);
obj.powerFlags = message.powerFlags.map(e => e);
} else {
obj.powerFlags = [];
}
Expand All @@ -536,7 +534,7 @@ export const Egress = {
const message = createBaseEgress();
message.nickname = object.nickname ?? '';
message.peer = object.peer ?? new Uint8Array();
message.powerFlags = object.powerFlags?.map((e) => e) || [];
message.powerFlags = object.powerFlags?.map(e => e) || [];
return message;
},
};
Expand Down Expand Up @@ -629,7 +627,7 @@ function base64FromBytes(arr) {
return globalThis.Buffer.from(arr).toString('base64');
} else {
const bin = [];
arr.forEach((byte) => {
arr.forEach(byte => {
bin.push(String.fromCharCode(byte));
});
return globalThis.btoa(bin.join(''));
Expand Down
12 changes: 5 additions & 7 deletions packages/cosmic-proto/dist/agoric/vstorage/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const QueryChildrenResponse = {
fromJSON(object) {
return {
children: Array.isArray(object?.children)
? object.children.map((e) => String(e))
? object.children.map(e => String(e))
: [],
pagination: isSet(object.pagination)
? PageResponse.fromJSON(object.pagination)
Expand All @@ -197,7 +197,7 @@ export const QueryChildrenResponse = {
toJSON(message) {
const obj = {};
if (message.children) {
obj.children = message.children.map((e) => e);
obj.children = message.children.map(e => e);
} else {
obj.children = [];
}
Expand All @@ -209,7 +209,7 @@ export const QueryChildrenResponse = {
},
fromPartial(object) {
const message = createBaseQueryChildrenResponse();
message.children = object.children?.map((e) => e) || [];
message.children = object.children?.map(e => e) || [];
message.pagination =
object.pagination !== undefined && object.pagination !== null
? PageResponse.fromPartial(object.pagination)
Expand All @@ -229,14 +229,12 @@ export class QueryClientImpl {
Data(request) {
const data = QueryDataRequest.encode(request).finish();
const promise = this.rpc.request(this.service, 'Data', data);
return promise.then((data) =>
QueryDataResponse.decode(new _m0.Reader(data)),
);
return promise.then(data => QueryDataResponse.decode(new _m0.Reader(data)));
}
Children(request) {
const data = QueryChildrenRequest.encode(request).finish();
const promise = this.rpc.request(this.service, 'Children', data);
return promise.then((data) =>
return promise.then(data =>
QueryChildrenResponse.decode(new _m0.Reader(data)),
);
}
Expand Down
Loading

0 comments on commit f16bc3f

Please sign in to comment.