feat: nil/null/empty/blank literals, resolves #102

This commit is contained in:
harttle
2019-02-24 21:50:01 +08:00
parent 54b2adce12
commit 88c9e96392
19 changed files with 355 additions and 52 deletions
+26
View File
@@ -0,0 +1,26 @@
import { Drop } from './drop'
import { IComparable } from './icomparable'
import { isNil } from 'src/util/underscore'
import { IDrop, isDrop } from 'src/drop/idrop'
import { BlankDrop } from 'src/drop/blank-drop'
export class NullDrop extends Drop implements IDrop, IComparable {
equals (value: any) {
return isNil(isDrop(value) ? value.value() : value) || value instanceof BlankDrop
}
gt () {
return false
}
geq () {
return false
}
lt () {
return false
}
leq () {
return false
}
value () {
return null
}
}