File tree Expand file tree Collapse file tree 6 files changed +22
-14
lines changed
Expand file tree Collapse file tree 6 files changed +22
-14
lines changed Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff 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
2222export 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' ) ;
Original file line number Diff line number Diff line change 671671 }
672672 },
673673 "required" : [
674- " exclude" ,
675- " include" ,
676674 " kind"
677675 ],
678676 "type" : " object"
Original file line number Diff line number Diff line change 617617 }
618618 },
619619 "required" : [
620- " exclude" ,
621- " include" ,
622620 " kind"
623621 ],
624622 "type" : " object"
Original file line number Diff line number Diff line change 594594 }
595595 },
596596 "required" : [
597- " exclude" ,
598- " include" ,
599597 " kind"
600598 ],
601599 "type" : " object"
Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments