fix: pass drops directly to filters/tags

This commit is contained in:
harttle
2019-05-12 20:03:32 +08:00
parent 4282accaa2
commit bef290923c
15 changed files with 93 additions and 42 deletions
+2 -3
View File
@@ -1,11 +1,10 @@
import { isNil, isString } from '../util/underscore'
import { Drop } from '../drop/drop'
import { isNil, isString, toValue } from '../util/underscore'
import { EmptyDrop } from '../drop/empty-drop'
export class BlankDrop extends EmptyDrop {
equals (value: any) {
if (value === false) return true
if (isNil(value instanceof Drop ? value.valueOf() : value)) return true
if (isNil(toValue(value))) return true
if (isString(value)) return /^\s*$/.test(value)
return super.equals(value)
}