Skip to content

Commit

Permalink
Remove checks for string or String and improve types.
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Bamford committed Dec 28, 2020
1 parent 5f96fb7 commit 20df05e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/txn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class Txn {
*/
public async queryWithVars(
q: string,
vars?: { [k: string]: any }, // tslint:disable-line no-any
vars?: { [k: string]: number | string | boolean | String },
metadata?: grpc.Metadata,
options?: grpc.CallOptions,
): Promise<types.Response> {
Expand All @@ -96,10 +96,7 @@ export class Txn {
if (vars !== undefined) {
const varsMap = req.getVarsMap();
Object.keys(vars).forEach((key: string) => {
const value = vars[key];
if (typeof value === "string" || value instanceof String) {
varsMap.set(key, value.toString());
}
varsMap.set(key, "" + vars[key]);
});
}

Expand Down

0 comments on commit 20df05e

Please sign in to comment.