Skip to content

Commit 39daa11

Browse files
committed
Merge branch 'edge'
2 parents dac6541 + 93de38a commit 39daa11

File tree

6 files changed

+22
-14
lines changed

6 files changed

+22
-14
lines changed

src/ConfigBuilder.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -656,10 +656,7 @@ export const buildOperatorConfigWithDefaults = (data: OperatorJsonConfig): Opera
656656
...cacheTTLDefaults,
657657
actionedEventsDefault: opActionedEventsDefault,
658658
actionedEventsMax: opActionedEventsMax,
659-
provider: {
660-
store: 'memory',
661-
...cacheOptDefaults
662-
}
659+
provider: {...defaultProvider}
663660
};
664661
} else {
665662
const {

src/Rule/AuthorRule.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ export interface AuthorRuleConfig {
1212
/**
1313
* Will "pass" if any set of AuthorCriteria passes
1414
* */
15-
include: AuthorCriteria[];
15+
include?: AuthorCriteria[];
1616
/**
1717
* Only runs if include is not present. Will "pass" if any of set of the AuthorCriteria does not pass
1818
* */
19-
exclude: AuthorCriteria[];
19+
exclude?: AuthorCriteria[];
2020
}
2121

2222
export interface AuthorRuleOptions extends AuthorRuleConfig, RuleOptions {
@@ -34,8 +34,13 @@ export class AuthorRule extends Rule {
3434
constructor(options: AuthorRuleOptions) {
3535
super(options);
3636

37-
this.include = options.include.map(x => new Author(x));
38-
this.exclude = options.exclude.map(x => new Author(x));
37+
const {
38+
include,
39+
exclude,
40+
} = options;
41+
42+
this.include = include !== undefined ? include.map(x => new Author(x)) : [];
43+
this.exclude = exclude !== undefined ? exclude.map(x => new Author(x)) : [];
3944

4045
if(this.include.length === 0 && this.exclude.length === 0) {
4146
throw new Error('At least one of the properties [include,exclude] on Author Rule must not be empty');

src/Schema/App.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,6 @@
671671
}
672672
},
673673
"required": [
674-
"exclude",
675-
"include",
676674
"kind"
677675
],
678676
"type": "object"

src/Schema/Rule.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,8 +617,6 @@
617617
}
618618
},
619619
"required": [
620-
"exclude",
621-
"include",
622620
"kind"
623621
],
624622
"type": "object"

src/Schema/RuleSet.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,6 @@
594594
}
595595
},
596596
"required": [
597-
"exclude",
598-
"include",
599597
"kind"
600598
],
601599
"type": "object"

src/Subreddit/SubredditResources.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,18 @@ export class SubredditResources {
898898
return false
899899
}
900900
break;
901+
case 'op':
902+
if(item instanceof Submission) {
903+
log.warn(`On a Submission the 'op' property will always be true. Did you mean to use this on a comment instead?`);
904+
break;
905+
}
906+
// @ts-ignore
907+
if (item.is_submitter !== crit[k]) {
908+
// @ts-ignore
909+
log.debug(`Failed: Expected => ${k}:${crit[k]} | Found => ${k}:${item[k]}`)
910+
return false
911+
}
912+
break;
901913
default:
902914
// @ts-ignore
903915
if (item[k] !== undefined) {

0 commit comments

Comments
 (0)