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
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { isComparable } from '../drop/icomparable'
|
||||
import { isComparable } from '../drop/comparable'
|
||||
import { isFunction } from '../util/underscore'
|
||||
import { isTruthy } from '../render/boolean'
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { FilterImpl } from './filter-impl'
|
||||
|
||||
export type FilterImplOptions = (this: FilterImpl, value: any, ...args: any[]) => any
|
||||
export interface FilterImplOptions {
|
||||
(this: FilterImpl, value: any, ...args: any[]): any;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ export { isFalsy, isTruthy } from './render/boolean'
|
||||
export { TagToken } from './tokens/tag-token'
|
||||
export { Context } from './context/context'
|
||||
export { Template } from './template/template'
|
||||
export { FilterImplOptions } from './template/filter/filter-impl-options'
|
||||
export { TagImplOptions } from './template/tag/tag-impl-options'
|
||||
export { ParseStream } from './parser/parse-stream'
|
||||
export { Token } from './tokens/token'
|
||||
|
||||
Reference in New Issue
Block a user