mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 20:44:32 -05:00
Add typings condition operators for Action class (#1909)
This commit is contained in:
@@ -318,7 +318,7 @@ describe('Action', () => {
|
||||
}).toThrow(/invalid field/i);
|
||||
|
||||
expect(() => {
|
||||
new Action('noop', 'name', 'James', null, fieldTypes);
|
||||
new Action(null, 'name', 'James', null, fieldTypes);
|
||||
}).toThrow(/invalid action operation/i);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -416,17 +416,19 @@ export class Condition {
|
||||
}
|
||||
}
|
||||
|
||||
let ACTION_OPS = ['set', 'link-schedule'];
|
||||
type ActionOperator = 'set' | 'link-schedule';
|
||||
|
||||
let ACTION_OPS: ActionOperator[] = ['set', 'link-schedule'];
|
||||
|
||||
export class Action {
|
||||
field;
|
||||
op;
|
||||
op: ActionOperator;
|
||||
options;
|
||||
rawValue;
|
||||
type;
|
||||
value;
|
||||
|
||||
constructor(op, field, value, options, fieldTypes) {
|
||||
constructor(op: ActionOperator, field, value, options, fieldTypes) {
|
||||
assert(
|
||||
ACTION_OPS.includes(op),
|
||||
'internal',
|
||||
|
||||
6
upcoming-release-notes/1909.md
Normal file
6
upcoming-release-notes/1909.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Maintenance
|
||||
authors: [Marethyu1]
|
||||
---
|
||||
|
||||
Type hardening action operator in rules.tsx
|
||||
Reference in New Issue
Block a user