mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-19 14:30:38 -07:00
docs: website for LiquidJS
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { isFunction } from '../util/underscore'
|
||||
|
||||
export interface IComparable {
|
||||
export interface Comparable {
|
||||
equals: (rhs: any) => boolean;
|
||||
gt: (rhs: any) => boolean;
|
||||
geq: (rhs: any) => boolean;
|
||||
@@ -8,6 +8,6 @@ export interface IComparable {
|
||||
leq: (rhs: any) => boolean;
|
||||
}
|
||||
|
||||
export function isComparable (arg: any): arg is IComparable {
|
||||
export function isComparable (arg: any): arg is Comparable {
|
||||
return arg && isFunction(arg.equals)
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Drop } from './drop'
|
||||
import { IComparable } from './icomparable'
|
||||
import { Comparable } from './comparable'
|
||||
import { isObject, isString, isArray } from '../util/underscore'
|
||||
|
||||
export class EmptyDrop extends Drop implements IComparable {
|
||||
export class EmptyDrop extends Drop implements Comparable {
|
||||
public equals (value: any) {
|
||||
if (isString(value) || isArray(value)) return value.length === 0
|
||||
if (isObject(value)) return Object.keys(value).length === 0
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Drop } from './drop'
|
||||
import { IComparable } from './icomparable'
|
||||
import { Comparable } from './comparable'
|
||||
import { isNil, toValue } from '../util/underscore'
|
||||
import { BlankDrop } from '../drop/blank-drop'
|
||||
|
||||
export class NullDrop extends Drop implements IComparable {
|
||||
export class NullDrop extends Drop implements Comparable {
|
||||
public equals (value: any) {
|
||||
return isNil(toValue(value)) || value instanceof BlankDrop
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user