Skip to content

Commit

Permalink
tweak contract
Browse files Browse the repository at this point in the history
  • Loading branch information
silesky committed Jan 2, 2022
1 parent ebbc89c commit 99b6a91
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"node": ">=12"
},
"scripts": {
"start": "dts watch",
"start": "dts watch --tsconfig ./tsconfig.prod.json",
"build": "dts build --tsconfig ./tsconfig.prod.json",
"test": "dts test",
"t:watch": "dts test --watch",
Expand Down
13 changes: 2 additions & 11 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,10 @@ export class JsonRpcClient<Api extends JsonRpcApiContract = EmptyObject> {

constructor(
// Intentionally re-defining some options-inline for better intellisense.
config:
| {
url: string;
headers?: Record<string, string>;
idGeneratorFn?: () => string;
}
| JsonRpcConfig
config: JsonRpcConfigOptions
) {
this.config =
config instanceof JsonRpcConfig ? config : new JsonRpcConfig(config);

this.config = new JsonRpcConfig(config);
this.config.validate();

this.#client = this.#buildAxiosClient(this.config);
}

Expand Down
2 changes: 1 addition & 1 deletion test/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe("contracts", () => {

/* skip intentionally - dtslint is a better tool. */
test.skip("[Typings]: batch", () => {
// should work with interface if extended
// should work with interface if
interface IContract extends JsonRpcApiContract {
hello: () => { name: string };
}
Expand Down

0 comments on commit 99b6a91

Please sign in to comment.