mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 21:00:40 -07:00
12 lines
353 B
TypeScript
12 lines
353 B
TypeScript
import { isNil, isString, toValue } from '../util/underscore'
|
|
import { EmptyDrop } from '../drop/empty-drop'
|
|
|
|
export class BlankDrop extends EmptyDrop {
|
|
public equals (value: any) {
|
|
if (value === false) return true
|
|
if (isNil(toValue(value))) return true
|
|
if (isString(value)) return /^\s*$/.test(value)
|
|
return super.equals(value)
|
|
}
|
|
}
|