Skip to content

Commit

Permalink
Merge branch 'fix-cli-typings' into 'master'
Browse files Browse the repository at this point in the history
Fix cli typings

See merge request orestes/orestes-js!38
  • Loading branch information
fbuecklers committed May 19, 2022
2 parents 1904828 + 11d58db commit cb58f2a
Show file tree
Hide file tree
Showing 8 changed files with 249 additions and 126 deletions.
2 changes: 1 addition & 1 deletion cli/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ async function uploadFile(db: EntityManager, bucket: string, filePath: string, c
});

return await file.upload({ force: true });
} catch (e) {
} catch (e: any) {
if (retires <= 0) {
console.warn(`Failed to upload file ${filePath}. ${retires} retries left.`);
throw new Error(`Failed to upload file ${filePath}: ${e.message}`);
Expand Down
6 changes: 3 additions & 3 deletions cli/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ export function isFile(path: string) : Promise<boolean> {
* @param {string} dir The path where a directory should exist.
* @return {Promise<void>} Resolves when the given directory is existing.
*/
export function ensureDir(dir: string): Promise<any> {
export function ensureDir(dir: string): Promise<void> {
return isDir(dir).then((directory) => {
if (!directory) {
return mkdir(dir, { recursive: true });
return mkdir(dir, { recursive: true }).then(() => {});
}
return Promise.resolve();
return undefined;
});
}

Expand Down
2 changes: 1 addition & 1 deletion lib/connector/Connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { ReadStream } from 'fs';
import { PersistentError } from '../error';
import { Message } from './Message';
import {
Json, JsonMap, Class, JsonLike,
Json, Class, JsonLike,
} from '../util';

export type Receiver = (response: Response) => void;
Expand Down
2 changes: 1 addition & 1 deletion lib/connector/WebSocketConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class WebSocketConnector {
} else {
observer.complete();
}
} catch (e) {
} catch (e: any) {
if (!firstErr) {
firstErr = e;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/intersection/Validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class Validator {
if ((valLib[method] as Function).apply(this, args) === false) {
this.errors.push(errorMessage || method);
}
} catch (e) {
} catch (e: any) {
this.errors.push(errorMessage || e.message);
}
return this;
Expand Down
2 changes: 1 addition & 1 deletion lib/metamodel/ModelBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class ModelBuilder {
try {
const model = this.getModel(ref);
this.buildAttributes(model);
} catch (e) {
} catch (e: any) {
throw new PersistentError(`Can't create model for entity class ${ref}`, e);
}
});
Expand Down
Loading

0 comments on commit cb58f2a

Please sign in to comment.