Skip to content

Commit

Permalink
Make builds actually evaluate Typescript type checks... (#830)
Browse files Browse the repository at this point in the history
* Fix SDK to conform to stricter type expectations
  • Loading branch information
Shaptic committed May 22, 2023
1 parent 0d97789 commit 3c683b8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
"compilerOptions": {
"declaration": true,
"declarationDir": "../lib",
"lib": ["es2015"],
"moduleResolution": "node",
"rootDir": "../src",
"outDir": "../lib",
"target": "es5"
"target": "es6"
},
"include": ["../src"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"scripts": {
"build": "cross-env NODE_ENV=development yarn _build",
"build:prod": "cross-env NODE_ENV=production yarn _build",
"build:node": "babel --extensions '.ts' --out-dir lib/ src/",
"build:node": "babel --extensions '.ts' --out-dir lib/ src/ && tsc -p ./config/tsconfig.json",
"build:browser": "webpack --stats-modules-space 999 -c config/webpack.config.browser.js",
"clean": "rm -rf lib/ dist/ coverage/ .nyc_output/",
"docs": "jsdoc -c ./config/.jsdoc.json --verbose",
Expand Down
2 changes: 1 addition & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class Server {
? Config.isAllowHttp()
: opts.allowHttp;

const customHeaders: object = {};
const customHeaders: Record<string, string> = {};

if (opts.appName) {
customHeaders["X-App-Name"] = opts.appName;
Expand Down
2 changes: 1 addition & 1 deletion src/stellar_toml_resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class StellarTomlResolver {
try {
const tomlObject = toml.parse(response.data);
return Promise.resolve(tomlObject);
} catch (e) {
} catch (e: any) {
return Promise.reject(
new Error(
`stellar.toml is invalid - Parsing error on line ${e.line}, column ${e.column}: ${e.message}`,
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ export namespace Utils {
let serverKP: Keypair;
try {
serverKP = Keypair.fromPublicKey(serverAccountID); // can throw 'Invalid Stellar public key'
} catch (err) {
} catch (err: any) {
throw new Error(
"Couldn't infer keypair from the provided 'serverAccountID': " +
err.message,
Expand Down Expand Up @@ -686,7 +686,7 @@ export namespace Utils {
let keypair: Keypair;
try {
keypair = Keypair.fromPublicKey(signer); // This can throw a few different errors
} catch (err) {
} catch (err: any) {
throw new InvalidSep10ChallengeError(
"Signer is not a valid address: " + err.message,
);
Expand Down

0 comments on commit 3c683b8

Please sign in to comment.