mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-17 05:10:40 -07:00
12 lines
331 B
TypeScript
12 lines
331 B
TypeScript
import { isNil, isString, toValue } from '../util'
|
|
import { EmptyDrop } from '../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)
|
|
}
|
|
}
|