refactor: IDrop interface => abstract method

This commit is contained in:
harttle
2019-02-28 00:05:08 +08:00
parent d5b9916b2f
commit b69c3a3203
6 changed files with 12 additions and 20 deletions
+2 -2
View File
@@ -1,11 +1,11 @@
import { isNil, isString } from '../util/underscore'
import { isDrop } from '../drop/idrop'
import { Drop } from '../drop/drop'
import { EmptyDrop } from '../drop/empty-drop'
export class BlankDrop extends EmptyDrop {
equals (value: any) {
if (value === false) return true
if (isNil(isDrop(value) ? value.valueOf() : value)) return true
if (isNil(value instanceof Drop ? value.valueOf() : value)) return true
if (isString(value)) return /^\s*$/.test(value)
return super.equals(value)
}