This repository was archived by the owner on Oct 20, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { AbstractRule } from './abstract-rule' ;
2+ import { NumberVal } from './number-val' ;
23
34export class Multiple extends AbstractRule {
45
@@ -13,6 +14,10 @@ export class Multiple extends AbstractRule {
1314 * Validate.
1415 */
1516 public validate ( input : any ) : boolean {
17+ if ( ! new NumberVal ( ) . validate ( input ) ) {
18+ return false ;
19+ }
20+
1621 if ( this . multipleOf === 0 ) {
1722 return this . multipleOf === input ;
1823 }
Original file line number Diff line number Diff line change 11import { AbstractRule } from './abstract-rule' ;
2+ import { NumberVal } from './number-val' ;
23
34export class Negative extends AbstractRule {
45
56 /**
67 * Validate.
78 */
89 public validate ( input : any ) : boolean {
10+ if ( ! new NumberVal ( ) . validate ( input ) ) {
11+ return false ;
12+ }
13+
914 return input < 0 ;
1015 }
1116}
Original file line number Diff line number Diff line change 11import { AbstractRule } from './abstract-rule' ;
2+ import { NumberVal } from './number-val' ;
23
34export class Positive extends AbstractRule {
45
56 /**
67 * Validate.
78 */
89 public validate ( input : any ) : boolean {
10+ if ( ! new NumberVal ( ) . validate ( input ) ) {
11+ return false ;
12+ }
13+
914 return input > 0 ;
1015 }
1116}
You can’t perform that action at this time.
0 commit comments