Skip to content

Commit

Permalink
Upgrade to [email protected], [email protected] & typescrip…
Browse files Browse the repository at this point in the history
  • Loading branch information
scottohara committed Aug 4, 2023
1 parent aa01081 commit 6c3588f
Show file tree
Hide file tree
Showing 8 changed files with 571 additions and 435 deletions.
974 changes: 552 additions & 422 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@
"@types/mini-css-extract-plugin": "2.4.0",
"@types/mocha": "9.1.1",
"@types/sinon-chai": "3.2.8",
"@typescript-eslint/eslint-plugin": "5.30.5",
"@typescript-eslint/parser": "5.30.5",
"@typescript-eslint/eslint-plugin": "6.2.1",
"@typescript-eslint/parser": "6.2.1",
"angular-mocks": "1.8.3",
"chai": "4.3.6",
"concurrently": "7.4.0",
"copy-webpack-plugin": "9.0.1",
"coverage-istanbul-loader": "3.0.5",
"css-loader": "6.4.0",
"cypress": "12.17.2",
"eslint": "8.19.0",
"eslint-config-oharagroup": "3.9.0",
"eslint": "8.46.0",
"eslint-config-oharagroup": "3.10.0",
"html-loader": "2.1.2",
"html-webpack-plugin": "5.4.0",
"ignore-loader": "0.1.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Mock } from "mocks/types";

export default class AuthenticatedMockProvider implements Mock<boolean> {
public constructor(private readonly authenticated: boolean = true) {}
public constructor(private readonly authenticated = true) {}

public $get(): boolean {
// Return the mock authenticated status object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@ describe("ogModalErrorService", (): void => {

describe("when the message is escape key press", (): void => {
it("should do nothing", (): void => {
ogModalErrorService.showError();
ogModalErrorService.showError("escape key press");
$uibModal.open.should.not.have.been.called;
});
});

it("should register a catch callback", (): void => {
ogModalErrorService.showError("");
(undefined !== $uibModal.catchCallback).should.be.true;
(undefined === $uibModal.catchCallback?.()).should.be.true;
});
});
});
2 changes: 1 addition & 1 deletion spec/public/transactions/controllers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ describe("TransactionIndexController", (): void => {
});

describe("(context mode)", (): void => {
const scenarios: { type: "account" | "category" | "payee" | "security"; field: (keyof BasicTransaction | keyof SecurityTransaction); contextFactory: () => Entity; }[] = [
const scenarios: { type: "account" | "category" | "payee" | "security"; field: keyof BasicTransaction | keyof SecurityTransaction; contextFactory: () => Entity; }[] = [
{ type: "account", field: "primary_account", contextFactory: createAccount },
{ type: "payee", field: "payee", contextFactory: createPayee },
{ type: "security", field: "security", contextFactory: createSecurity },
Expand Down
2 changes: 1 addition & 1 deletion src/categories/controllers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class CategoryIndexController {

delete category.children;

return flattened.concat(category, undefined === children ? [] : children);
return flattened.concat(category, children ?? []);
}, []);

this.tableActions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,17 @@ export default class OgInputCalculatorDirective {
// Matches any number of digits, periods or commas, followed by +, -, * or /
const matches: RegExpExecArray | null = (/(?<operand>[-\d.,]+)(?<operator>[+\-*/])(?<residual>.*)/giu).exec(value);

if (null !== matches && undefined !== matches.groups) {
if (undefined === matches?.groups) {
// Recalculate
scope.calculate(value);
} else {
const { operand, operator, residual } = matches.groups;

// Push the first (operand) and second (operator) matches onto the stack
scope.push(Number(operand), operator as OgInputCalculatorOperator);

// Update the view value to the third match (anything after the operator), which is typically an empty string
iElement.val(residual);
} else {
// Recalculate
scope.calculate(value);
}

// Return the current result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class OgModalErrorService {
message
})
}
}).result.catch(undefined);
}).result.catch((): void => undefined);
}
}
}
Expand Down

0 comments on commit 6c3588f

Please sign in to comment.