소스 검색

constraint can be false

Adam Shaw 7 년 전
부모
커밋
d15b7eb367
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/validation.ts

+ 2 - 2
src/validation.ts

@@ -11,7 +11,7 @@ import { EventInput } from './structs/event'
 
 
 // TODO: rename to "criteria" ?
 // TODO: rename to "criteria" ?
 export type ConstraintInput = 'businessHours' | string | EventInput | EventInput[]
 export type ConstraintInput = 'businessHours' | string | EventInput | EventInput[]
-export type Constraint = 'businessHours' | string | EventStore
+export type Constraint = 'businessHours' | string | EventStore | false // false means won't pass at all
 export type OverlapFunc = ((stillEvent: EventApi, movingEvent: EventApi | null) => boolean)
 export type OverlapFunc = ((stillEvent: EventApi, movingEvent: EventApi | null) => boolean)
 export type AllowFunc = (span: DateSpanApi, movingEvent: EventApi | null) => boolean
 export type AllowFunc = (span: DateSpanApi, movingEvent: EventApi | null) => boolean
 
 
@@ -296,7 +296,7 @@ function constraintToRanges(
     )
     )
   }
   }
 
 
-  return []
+  return [] // if it's false
 }
 }
 
 
 // TODO: move to event-store file?
 // TODO: move to event-store file?