liquidjs

  • Version 9.40.0
  • Published
  • 1.26 MB
  • No dependencies
  • MIT license

Install

npm i liquidjs
yarn add liquidjs
pnpm add liquidjs

Overview

A simple, expressive and safe Shopify / Github Pages compatible template engine in pure JavaScript.

Index

Variables

Functions

Classes

Interfaces

Enums

Type Aliases

Namespaces

Variables

variable defaultOperators

const defaultOperators: Operators;

    variable defaultOptions

    const defaultOptions: NormalizedFullOptions;

      variable toThenable

      const toThenable: <T>(
      val: T | Generator<unknown, T, unknown> | Promise<T>
      ) => Promise<T>;

        variable version

        const version: string;

          Functions

          function assert

          assert: <T>(
          predicate: T | null | undefined,
          message?: string | (() => string)
          ) => void;

            function createTrie

            createTrie: (operators: Operators) => Trie;

              function evalQuotedToken

              evalQuotedToken: (token: QuotedToken) => string;

                function evalToken

                evalToken: (token: Token | undefined, ctx: Context, lenient?: boolean) => any;

                  function isFalsy

                  isFalsy: (val: any, ctx: Context) => boolean;

                    function isTruthy

                    isTruthy: (val: any, ctx: Context) => boolean;

                      function toPromise

                      toPromise: <T>(
                      val: Generator<unknown, T, unknown> | Promise<T> | T
                      ) => Promise<T>;

                        function toValue

                        toValue: (value: any) => any;

                          function toValueSync

                          toValueSync: <T>(val: Generator<unknown, T, unknown> | T) => T;

                            Classes

                            class AssertionError

                            class AssertionError extends Error {}

                              constructor

                              constructor(message: string);

                                class Context

                                class Context {}

                                  constructor

                                  constructor(
                                  env?: {},
                                  opts?: NormalizedFullOptions,
                                  renderOptions?: RenderOptions
                                  );

                                    property environments

                                    environments: Scope;
                                    • user passed in scope {% increment %}, {% decrement %} changes this scope, whereas {% capture %}, {% assign %} only hide this scope

                                    property globals

                                    globals: Scope;
                                    • global scope used as fallback for missing variables

                                    property opts

                                    opts: NormalizedFullOptions;
                                    • The normalized liquid options object

                                    property strictVariables

                                    strictVariables: boolean;
                                    • Throw when accessing undefined variable?

                                    property sync

                                    sync: boolean;

                                      method bottom

                                      bottom: () => Scope;

                                        method get

                                        get: (paths: PropertyKey[]) => object;

                                          method getAll

                                          getAll: () => Scope;

                                            method getFromScope

                                            getFromScope: (scope: object, paths: PropertyKey[] | string) => object;

                                              method getRegister

                                              getRegister: (key: string) => any;

                                                method pop

                                                pop: () => Scope | undefined;

                                                  method push

                                                  push: (ctx: object) => number;

                                                    method restoreRegister

                                                    restoreRegister: (keyValues: [string, any][]) => void;

                                                      method saveRegister

                                                      saveRegister: (...keys: string[]) => [string, any][];

                                                        method setRegister

                                                        setRegister: (key: string, value: any) => any;

                                                          class Drop

                                                          abstract class Drop {}

                                                            method liquidMethodMissing

                                                            liquidMethodMissing: (
                                                            key: string | number
                                                            ) => Promise<string | undefined> | string | undefined;

                                                              class Expression

                                                              class Expression {}

                                                                constructor

                                                                constructor(tokens: IterableIterator<Token>);

                                                                  method evaluate

                                                                  evaluate: (
                                                                  ctx: Context,
                                                                  lenient?: boolean
                                                                  ) => Generator<unknown, unknown, unknown>;

                                                                    class Hash

                                                                    class Hash {}
                                                                    • Key-Value Pairs Representing Tag Arguments Example: For the markup , foo:'bar', coo:2 reversed %}, hash['foo'] === 'bar' hash['coo'] === 2 hash['reversed'] === undefined

                                                                    constructor

                                                                    constructor(markup: string, jekyllStyle?: boolean);

                                                                      property hash

                                                                      hash: HashValue;

                                                                        method render

                                                                        render: (ctx: Context) => Generator<unknown, HashValue, unknown>;

                                                                          class InternalUndefinedVariableError

                                                                          class InternalUndefinedVariableError extends Error {}

                                                                            constructor

                                                                            constructor(variableName: string);

                                                                              property variableName

                                                                              variableName: string;

                                                                                class Liquid

                                                                                class Liquid {}

                                                                                  constructor

                                                                                  constructor(opts?: LiquidOptions);

                                                                                    property filters

                                                                                    readonly filters: FilterMap;

                                                                                      property options

                                                                                      readonly options: NormalizedFullOptions;

                                                                                        property parser

                                                                                        readonly parser: Parser;

                                                                                          property renderer

                                                                                          readonly renderer: Render;

                                                                                            property tags

                                                                                            readonly tags: TagMap;

                                                                                              method evalValue

                                                                                              evalValue: (str: string, ctx: Context) => Promise<any>;

                                                                                                method evalValueSync

                                                                                                evalValueSync: (str: string, ctx: Context) => any;

                                                                                                  method express

                                                                                                  express: () => (
                                                                                                  this: any,
                                                                                                  filePath: string,
                                                                                                  ctx: object,
                                                                                                  callback: (err: Error | null, rendered: string) => void
                                                                                                  ) => void;

                                                                                                    method parse

                                                                                                    parse: (html: string, filepath?: string) => Template[];

                                                                                                      method parseAndRender

                                                                                                      parseAndRender: (
                                                                                                      html: string,
                                                                                                      scope?: object,
                                                                                                      renderOptions?: RenderOptions
                                                                                                      ) => Promise<any>;

                                                                                                        method parseAndRenderSync

                                                                                                        parseAndRenderSync: (
                                                                                                        html: string,
                                                                                                        scope?: object,
                                                                                                        renderOptions?: RenderOptions
                                                                                                        ) => any;

                                                                                                          method parseFile

                                                                                                          parseFile: (file: string) => Promise<Template[]>;

                                                                                                            method parseFileSync

                                                                                                            parseFileSync: (file: string) => Template[];

                                                                                                              method plugin

                                                                                                              plugin: (plugin: (this: Liquid, L: typeof Liquid) => void) => void;

                                                                                                                method registerFilter

                                                                                                                registerFilter: (name: string, filter: FilterImplOptions) => void;

                                                                                                                  method registerTag

                                                                                                                  registerTag: (name: string, tag: TagImplOptions) => void;

                                                                                                                    method render

                                                                                                                    render: (
                                                                                                                    tpl: Template[],
                                                                                                                    scope?: object,
                                                                                                                    renderOptions?: RenderOptions
                                                                                                                    ) => Promise<any>;

                                                                                                                      method renderFile

                                                                                                                      renderFile: (
                                                                                                                      file: string,
                                                                                                                      ctx?: object,
                                                                                                                      renderOptions?: RenderOptions
                                                                                                                      ) => Promise<any>;

                                                                                                                        method renderFileSync

                                                                                                                        renderFileSync: (
                                                                                                                        file: string,
                                                                                                                        ctx?: object,
                                                                                                                        renderOptions?: RenderOptions
                                                                                                                        ) => any;

                                                                                                                          method renderFileToNodeStream

                                                                                                                          renderFileToNodeStream: (
                                                                                                                          file: string,
                                                                                                                          scope?: object,
                                                                                                                          renderOptions?: RenderOptions
                                                                                                                          ) => Promise<NodeJS.ReadableStream>;

                                                                                                                            method renderSync

                                                                                                                            renderSync: (
                                                                                                                            tpl: Template[],
                                                                                                                            scope?: object,
                                                                                                                            renderOptions?: RenderOptions
                                                                                                                            ) => any;

                                                                                                                              method renderToNodeStream

                                                                                                                              renderToNodeStream: (
                                                                                                                              tpl: Template[],
                                                                                                                              scope?: object,
                                                                                                                              renderOptions?: RenderOptions
                                                                                                                              ) => NodeJS.ReadableStream;

                                                                                                                                class LiquidError

                                                                                                                                abstract class LiquidError extends Error {}

                                                                                                                                  constructor

                                                                                                                                  constructor(err: Error, token: Token);

                                                                                                                                    property context

                                                                                                                                    context: string;

                                                                                                                                      method update

                                                                                                                                      protected update: () => void;

                                                                                                                                        class ParseError

                                                                                                                                        class ParseError extends LiquidError {}

                                                                                                                                          constructor

                                                                                                                                          constructor(err: Error, token: Token);

                                                                                                                                            class ParseStream

                                                                                                                                            class ParseStream<T extends Token = TopLevelToken> {}

                                                                                                                                              constructor

                                                                                                                                              constructor(tokens: T[], parseToken: ParseToken<T>);

                                                                                                                                                method on

                                                                                                                                                on: <T2 extends Template | T>(
                                                                                                                                                name: string,
                                                                                                                                                cb: (this: ParseStream, arg: T2) => void
                                                                                                                                                ) => ParseStream<T>;

                                                                                                                                                  method start

                                                                                                                                                  start: () => this;

                                                                                                                                                    method stop

                                                                                                                                                    stop: () => this;

                                                                                                                                                      class RenderError

                                                                                                                                                      class RenderError extends LiquidError {}

                                                                                                                                                        constructor

                                                                                                                                                        constructor(err: Error, tpl: Template);

                                                                                                                                                          method is

                                                                                                                                                          static is: (obj: any) => obj is RenderError;

                                                                                                                                                            class TagToken

                                                                                                                                                            class TagToken extends DelimitedToken {}

                                                                                                                                                              constructor

                                                                                                                                                              constructor(
                                                                                                                                                              input: string,
                                                                                                                                                              begin: number,
                                                                                                                                                              end: number,
                                                                                                                                                              options: NormalizedFullOptions,
                                                                                                                                                              file?: string
                                                                                                                                                              );

                                                                                                                                                                property args

                                                                                                                                                                args: string;

                                                                                                                                                                  property name

                                                                                                                                                                  name: string;

                                                                                                                                                                    class TimezoneDate

                                                                                                                                                                    class TimezoneDate implements LiquidDate {}
                                                                                                                                                                    • A date implementation with timezone info, just like Ruby date

                                                                                                                                                                      Implementation: - create a Date offset by it's timezone difference, avoiding overriding a bunch of methods - rewrite getTimezoneOffset() to trick strftime

                                                                                                                                                                    constructor

                                                                                                                                                                    constructor(init: string | number | Date | TimezoneDate, timezoneOffset: number);

                                                                                                                                                                      method createDateFixedToTimezone

                                                                                                                                                                      static createDateFixedToTimezone: (dateString: string) => LiquidDate;
                                                                                                                                                                      • Create a Date object fixed to it's declared Timezone. Both - 2021-08-06T02:29:00.000Z and - 2021-08-06T02:29:00.000+08:00 will always be displayed as - 2021-08-06 02:29:00 regardless timezoneOffset in JavaScript realm

                                                                                                                                                                        The implementation hack: Instead of calling .getMonth()/.getUTCMonth() respect to preserveTimezones, we create a different Date to trick strftime, it's both simpler and more performant. Given that a template is expected to be parsed fewer times than rendered.

                                                                                                                                                                      method getDate

                                                                                                                                                                      getDate: () => number;

                                                                                                                                                                        method getDay

                                                                                                                                                                        getDay: () => number;

                                                                                                                                                                          method getFullYear

                                                                                                                                                                          getFullYear: () => number;

                                                                                                                                                                            method getHours

                                                                                                                                                                            getHours: () => number;

                                                                                                                                                                              method getMilliseconds

                                                                                                                                                                              getMilliseconds: () => number;

                                                                                                                                                                                method getMinutes

                                                                                                                                                                                getMinutes: () => number;

                                                                                                                                                                                  method getMonth

                                                                                                                                                                                  getMonth: () => number;

                                                                                                                                                                                    method getSeconds

                                                                                                                                                                                    getSeconds: () => number;

                                                                                                                                                                                      method getTime

                                                                                                                                                                                      getTime: () => number;

                                                                                                                                                                                        method getTimezoneOffset

                                                                                                                                                                                        getTimezoneOffset: () => number;

                                                                                                                                                                                          method toLocaleDateString

                                                                                                                                                                                          toLocaleDateString: (locale?: string) => string;

                                                                                                                                                                                            method toLocaleTimeString

                                                                                                                                                                                            toLocaleTimeString: (locale?: string) => string;

                                                                                                                                                                                              class Token

                                                                                                                                                                                              abstract class Token {}

                                                                                                                                                                                                constructor

                                                                                                                                                                                                constructor(
                                                                                                                                                                                                kind: TokenKind,
                                                                                                                                                                                                input: string,
                                                                                                                                                                                                begin: number,
                                                                                                                                                                                                end: number,
                                                                                                                                                                                                file?: string
                                                                                                                                                                                                );

                                                                                                                                                                                                  property begin

                                                                                                                                                                                                  begin: number;

                                                                                                                                                                                                    property end

                                                                                                                                                                                                    end: number;

                                                                                                                                                                                                      property file

                                                                                                                                                                                                      file?: string;

                                                                                                                                                                                                        property input

                                                                                                                                                                                                        input: string;

                                                                                                                                                                                                          property kind

                                                                                                                                                                                                          kind: TokenKind;

                                                                                                                                                                                                            method getPosition

                                                                                                                                                                                                            getPosition: () => number[];

                                                                                                                                                                                                              method getText

                                                                                                                                                                                                              getText: () => string;

                                                                                                                                                                                                                method size

                                                                                                                                                                                                                size: () => number;

                                                                                                                                                                                                                  class TokenizationError

                                                                                                                                                                                                                  class TokenizationError extends LiquidError {}

                                                                                                                                                                                                                    constructor

                                                                                                                                                                                                                    constructor(message: string, token: Token);

                                                                                                                                                                                                                      class Tokenizer

                                                                                                                                                                                                                      class Tokenizer {}

                                                                                                                                                                                                                        constructor

                                                                                                                                                                                                                        constructor(input: string, trie?: Trie, file?: string);

                                                                                                                                                                                                                          property file

                                                                                                                                                                                                                          file: string;

                                                                                                                                                                                                                            property input

                                                                                                                                                                                                                            input: string;

                                                                                                                                                                                                                              property N

                                                                                                                                                                                                                              N: number;

                                                                                                                                                                                                                                property p

                                                                                                                                                                                                                                p: number;

                                                                                                                                                                                                                                  method advance

                                                                                                                                                                                                                                  advance: (i?: number) => void;

                                                                                                                                                                                                                                    method end

                                                                                                                                                                                                                                    end: () => boolean;

                                                                                                                                                                                                                                      method match

                                                                                                                                                                                                                                      match: (word: string) => boolean;

                                                                                                                                                                                                                                        method mkError

                                                                                                                                                                                                                                        mkError: (msg: string, begin: number) => TokenizationError;

                                                                                                                                                                                                                                          method peek

                                                                                                                                                                                                                                          peek: (n?: number) => string;

                                                                                                                                                                                                                                            method peekType

                                                                                                                                                                                                                                            peekType: (n?: number) => number;

                                                                                                                                                                                                                                              method readEndrawOrRawContent

                                                                                                                                                                                                                                              readEndrawOrRawContent: (options: NormalizedFullOptions) => HTMLToken | TagToken;

                                                                                                                                                                                                                                                method readExpression

                                                                                                                                                                                                                                                readExpression: () => Expression;

                                                                                                                                                                                                                                                  method readExpressionTokens

                                                                                                                                                                                                                                                  readExpressionTokens: () => IterableIterator<Token>;

                                                                                                                                                                                                                                                    method readFileNameTemplate

                                                                                                                                                                                                                                                    readFileNameTemplate: (
                                                                                                                                                                                                                                                    options: NormalizedFullOptions
                                                                                                                                                                                                                                                    ) => IterableIterator<TopLevelToken>;

                                                                                                                                                                                                                                                      method readFilter

                                                                                                                                                                                                                                                      readFilter: () => FilterToken | null;

                                                                                                                                                                                                                                                        method readFilterArg

                                                                                                                                                                                                                                                        readFilterArg: () => FilterArg | undefined;

                                                                                                                                                                                                                                                          method readFilters

                                                                                                                                                                                                                                                          readFilters: () => FilterToken[];

                                                                                                                                                                                                                                                            method readHash

                                                                                                                                                                                                                                                            readHash: (jekyllStyle?: boolean) => HashToken | undefined;

                                                                                                                                                                                                                                                              method readHashes

                                                                                                                                                                                                                                                              readHashes: (jekyllStyle?: boolean) => HashToken[];

                                                                                                                                                                                                                                                                method readHTMLToken

                                                                                                                                                                                                                                                                readHTMLToken: (stopStrings: string[]) => HTMLToken;

                                                                                                                                                                                                                                                                  method readIdentifier

                                                                                                                                                                                                                                                                  readIdentifier: () => IdentifierToken;

                                                                                                                                                                                                                                                                    method readLiquidTagToken

                                                                                                                                                                                                                                                                    readLiquidTagToken: (options: NormalizedFullOptions) => LiquidTagToken;

                                                                                                                                                                                                                                                                      method readLiquidTagTokens

                                                                                                                                                                                                                                                                      readLiquidTagTokens: (options?: NormalizedFullOptions) => LiquidTagToken[];

                                                                                                                                                                                                                                                                        method readOperator

                                                                                                                                                                                                                                                                        readOperator: () => OperatorToken | undefined;

                                                                                                                                                                                                                                                                          method readOutputToken

                                                                                                                                                                                                                                                                          readOutputToken: (options?: NormalizedFullOptions) => OutputToken;

                                                                                                                                                                                                                                                                            method readQuoted

                                                                                                                                                                                                                                                                            readQuoted: () => QuotedToken | undefined;

                                                                                                                                                                                                                                                                              method readRange

                                                                                                                                                                                                                                                                              readRange: () => RangeToken | undefined;

                                                                                                                                                                                                                                                                                method readTagName

                                                                                                                                                                                                                                                                                readTagName: () => string;

                                                                                                                                                                                                                                                                                  method readTagToken

                                                                                                                                                                                                                                                                                  readTagToken: (options?: NormalizedFullOptions) => TagToken;

                                                                                                                                                                                                                                                                                    method readTo

                                                                                                                                                                                                                                                                                    readTo: (end: string) => number;

                                                                                                                                                                                                                                                                                      method readToDelimiter

                                                                                                                                                                                                                                                                                      readToDelimiter: (delimiter: string) => number;

                                                                                                                                                                                                                                                                                        method readTopLevelToken

                                                                                                                                                                                                                                                                                        readTopLevelToken: (options: NormalizedFullOptions) => TopLevelToken;

                                                                                                                                                                                                                                                                                          method readTopLevelTokens

                                                                                                                                                                                                                                                                                          readTopLevelTokens: (options?: NormalizedFullOptions) => TopLevelToken[];

                                                                                                                                                                                                                                                                                            method readValue

                                                                                                                                                                                                                                                                                            readValue: () => ValueToken | undefined;

                                                                                                                                                                                                                                                                                              method readValueOrThrow

                                                                                                                                                                                                                                                                                              readValueOrThrow: () => ValueToken;

                                                                                                                                                                                                                                                                                                method readWord

                                                                                                                                                                                                                                                                                                readWord: () => IdentifierToken;
                                                                                                                                                                                                                                                                                                • Deprecated

                                                                                                                                                                                                                                                                                                method remaining

                                                                                                                                                                                                                                                                                                remaining: () => string;

                                                                                                                                                                                                                                                                                                  method rmatch

                                                                                                                                                                                                                                                                                                  rmatch: (pattern: string) => boolean;

                                                                                                                                                                                                                                                                                                    method skipBlank

                                                                                                                                                                                                                                                                                                    skipBlank: () => void;

                                                                                                                                                                                                                                                                                                      method snapshot

                                                                                                                                                                                                                                                                                                      snapshot: (begin?: number) => string;

                                                                                                                                                                                                                                                                                                        class UndefinedVariableError

                                                                                                                                                                                                                                                                                                        class UndefinedVariableError extends LiquidError {}

                                                                                                                                                                                                                                                                                                          constructor

                                                                                                                                                                                                                                                                                                          constructor(err: Error, token: Token);

                                                                                                                                                                                                                                                                                                            class Value

                                                                                                                                                                                                                                                                                                            class Value {}

                                                                                                                                                                                                                                                                                                              constructor

                                                                                                                                                                                                                                                                                                              constructor(str: string, liquid: Liquid);
                                                                                                                                                                                                                                                                                                              • Parameter str

                                                                                                                                                                                                                                                                                                                the value to be valuated, eg.: "foobar" | truncate: 3

                                                                                                                                                                                                                                                                                                              property filters

                                                                                                                                                                                                                                                                                                              readonly filters: Filter[];

                                                                                                                                                                                                                                                                                                                property initial

                                                                                                                                                                                                                                                                                                                readonly initial: Expression;

                                                                                                                                                                                                                                                                                                                  method value

                                                                                                                                                                                                                                                                                                                  value: (ctx: Context, lenient: boolean) => Generator<unknown, unknown, unknown>;

                                                                                                                                                                                                                                                                                                                    Interfaces

                                                                                                                                                                                                                                                                                                                    interface Emitter

                                                                                                                                                                                                                                                                                                                    interface Emitter {}

                                                                                                                                                                                                                                                                                                                      property buffer

                                                                                                                                                                                                                                                                                                                      buffer: string;
                                                                                                                                                                                                                                                                                                                      • Buffered string

                                                                                                                                                                                                                                                                                                                      method write

                                                                                                                                                                                                                                                                                                                      write: (html: any) => void;
                                                                                                                                                                                                                                                                                                                      • Write a html value into emitter

                                                                                                                                                                                                                                                                                                                        Parameter html

                                                                                                                                                                                                                                                                                                                        string, Drop or other primitive value

                                                                                                                                                                                                                                                                                                                      interface FilterImplOptions

                                                                                                                                                                                                                                                                                                                      interface FilterImplOptions {}

                                                                                                                                                                                                                                                                                                                        call signature

                                                                                                                                                                                                                                                                                                                        (this: FilterImpl, value: any, ...args: any[]): any;

                                                                                                                                                                                                                                                                                                                          interface Operators

                                                                                                                                                                                                                                                                                                                          interface Operators {}

                                                                                                                                                                                                                                                                                                                            index signature

                                                                                                                                                                                                                                                                                                                            [key: string]: (lhs: any, rhs: any, ctx: Context) => boolean;

                                                                                                                                                                                                                                                                                                                              interface TagImpl

                                                                                                                                                                                                                                                                                                                              interface TagImpl extends TagImplOptions {}

                                                                                                                                                                                                                                                                                                                                property liquid

                                                                                                                                                                                                                                                                                                                                liquid: Liquid;

                                                                                                                                                                                                                                                                                                                                  index signature

                                                                                                                                                                                                                                                                                                                                  [key: string]: any;

                                                                                                                                                                                                                                                                                                                                    interface TagImplOptions

                                                                                                                                                                                                                                                                                                                                    interface TagImplOptions {}

                                                                                                                                                                                                                                                                                                                                      property parse

                                                                                                                                                                                                                                                                                                                                      parse?: (
                                                                                                                                                                                                                                                                                                                                      this: TagImpl,
                                                                                                                                                                                                                                                                                                                                      token: TagToken,
                                                                                                                                                                                                                                                                                                                                      remainingTokens: TopLevelToken[]
                                                                                                                                                                                                                                                                                                                                      ) => void;

                                                                                                                                                                                                                                                                                                                                        property render

                                                                                                                                                                                                                                                                                                                                        render: (
                                                                                                                                                                                                                                                                                                                                        this: TagImpl,
                                                                                                                                                                                                                                                                                                                                        ctx: Context,
                                                                                                                                                                                                                                                                                                                                        emitter: Emitter,
                                                                                                                                                                                                                                                                                                                                        hash: HashValue
                                                                                                                                                                                                                                                                                                                                        ) =>
                                                                                                                                                                                                                                                                                                                                        | void
                                                                                                                                                                                                                                                                                                                                        | string
                                                                                                                                                                                                                                                                                                                                        | Promise<void | string>
                                                                                                                                                                                                                                                                                                                                        | Generator<unknown, void | string, unknown>;

                                                                                                                                                                                                                                                                                                                                          interface Template

                                                                                                                                                                                                                                                                                                                                          interface Template {}

                                                                                                                                                                                                                                                                                                                                            property token

                                                                                                                                                                                                                                                                                                                                            token: Token;

                                                                                                                                                                                                                                                                                                                                              method render

                                                                                                                                                                                                                                                                                                                                              render: (ctx: Context, emitter: Emitter) => any;

                                                                                                                                                                                                                                                                                                                                                interface Trie

                                                                                                                                                                                                                                                                                                                                                interface Trie {}

                                                                                                                                                                                                                                                                                                                                                  index signature

                                                                                                                                                                                                                                                                                                                                                  [key: string]: any;

                                                                                                                                                                                                                                                                                                                                                    Enums

                                                                                                                                                                                                                                                                                                                                                    enum TokenKind

                                                                                                                                                                                                                                                                                                                                                    enum TokenKind {
                                                                                                                                                                                                                                                                                                                                                    Number = 1,
                                                                                                                                                                                                                                                                                                                                                    Literal = 2,
                                                                                                                                                                                                                                                                                                                                                    Tag = 4,
                                                                                                                                                                                                                                                                                                                                                    Output = 8,
                                                                                                                                                                                                                                                                                                                                                    HTML = 16,
                                                                                                                                                                                                                                                                                                                                                    Filter = 32,
                                                                                                                                                                                                                                                                                                                                                    Hash = 64,
                                                                                                                                                                                                                                                                                                                                                    PropertyAccess = 128,
                                                                                                                                                                                                                                                                                                                                                    Word = 256,
                                                                                                                                                                                                                                                                                                                                                    Range = 512,
                                                                                                                                                                                                                                                                                                                                                    Quoted = 1024,
                                                                                                                                                                                                                                                                                                                                                    Operator = 2048,
                                                                                                                                                                                                                                                                                                                                                    Delimited = 12,
                                                                                                                                                                                                                                                                                                                                                    }

                                                                                                                                                                                                                                                                                                                                                      member Delimited

                                                                                                                                                                                                                                                                                                                                                      Delimited = 12

                                                                                                                                                                                                                                                                                                                                                        member Filter

                                                                                                                                                                                                                                                                                                                                                        Filter = 32

                                                                                                                                                                                                                                                                                                                                                          member Hash

                                                                                                                                                                                                                                                                                                                                                          Hash = 64

                                                                                                                                                                                                                                                                                                                                                            member HTML

                                                                                                                                                                                                                                                                                                                                                            HTML = 16

                                                                                                                                                                                                                                                                                                                                                              member Literal

                                                                                                                                                                                                                                                                                                                                                              Literal = 2

                                                                                                                                                                                                                                                                                                                                                                member Number

                                                                                                                                                                                                                                                                                                                                                                Number = 1

                                                                                                                                                                                                                                                                                                                                                                  member Operator

                                                                                                                                                                                                                                                                                                                                                                  Operator = 2048

                                                                                                                                                                                                                                                                                                                                                                    member Output

                                                                                                                                                                                                                                                                                                                                                                    Output = 8

                                                                                                                                                                                                                                                                                                                                                                      member PropertyAccess

                                                                                                                                                                                                                                                                                                                                                                      PropertyAccess = 128

                                                                                                                                                                                                                                                                                                                                                                        member Quoted

                                                                                                                                                                                                                                                                                                                                                                        Quoted = 1024

                                                                                                                                                                                                                                                                                                                                                                          member Range

                                                                                                                                                                                                                                                                                                                                                                          Range = 512

                                                                                                                                                                                                                                                                                                                                                                            member Tag

                                                                                                                                                                                                                                                                                                                                                                            Tag = 4

                                                                                                                                                                                                                                                                                                                                                                              member Word

                                                                                                                                                                                                                                                                                                                                                                              Word = 256

                                                                                                                                                                                                                                                                                                                                                                                Type Aliases

                                                                                                                                                                                                                                                                                                                                                                                type TopLevelToken

                                                                                                                                                                                                                                                                                                                                                                                type TopLevelToken = TagToken | OutputToken | HTMLToken;

                                                                                                                                                                                                                                                                                                                                                                                  Namespaces

                                                                                                                                                                                                                                                                                                                                                                                  namespace filters

                                                                                                                                                                                                                                                                                                                                                                                  module 'dist/builtin/filters/index.d.ts' {}

                                                                                                                                                                                                                                                                                                                                                                                    variable raw

                                                                                                                                                                                                                                                                                                                                                                                    const raw: <T>(val: T) => T;

                                                                                                                                                                                                                                                                                                                                                                                      function abs

                                                                                                                                                                                                                                                                                                                                                                                      abs: (x: number) => any;

                                                                                                                                                                                                                                                                                                                                                                                        function append

                                                                                                                                                                                                                                                                                                                                                                                        append: (v: string, arg: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                          function atLeast

                                                                                                                                                                                                                                                                                                                                                                                          atLeast: (...args: number[]) => any;

                                                                                                                                                                                                                                                                                                                                                                                            function atMost

                                                                                                                                                                                                                                                                                                                                                                                            atMost: (...args: number[]) => any;

                                                                                                                                                                                                                                                                                                                                                                                              function capitalize

                                                                                                                                                                                                                                                                                                                                                                                              capitalize: (str: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                function ceil

                                                                                                                                                                                                                                                                                                                                                                                                ceil: (x: number) => any;

                                                                                                                                                                                                                                                                                                                                                                                                  function compact

                                                                                                                                                                                                                                                                                                                                                                                                  compact: <T>(this: FilterImpl, arr: T[]) => any[];

                                                                                                                                                                                                                                                                                                                                                                                                    function concat

                                                                                                                                                                                                                                                                                                                                                                                                    concat: <T1, T2>(v: T1[], arg?: T2[]) => (T1 | T2)[];

                                                                                                                                                                                                                                                                                                                                                                                                      function date

                                                                                                                                                                                                                                                                                                                                                                                                      date: (this: FilterImpl, v: string | Date, arg: string) => string | Date;

                                                                                                                                                                                                                                                                                                                                                                                                        function Default

                                                                                                                                                                                                                                                                                                                                                                                                        Default: <T1 extends boolean, T2>(
                                                                                                                                                                                                                                                                                                                                                                                                        this: FilterImpl,
                                                                                                                                                                                                                                                                                                                                                                                                        value: T1,
                                                                                                                                                                                                                                                                                                                                                                                                        defaultValue: T2,
                                                                                                                                                                                                                                                                                                                                                                                                        ...args: Array<[string, any]>
                                                                                                                                                                                                                                                                                                                                                                                                        ) => T1 | T2;

                                                                                                                                                                                                                                                                                                                                                                                                          function dividedBy

                                                                                                                                                                                                                                                                                                                                                                                                          dividedBy: (dividend: number, divisor: number, integerArithmetic?: any) => any;

                                                                                                                                                                                                                                                                                                                                                                                                            function downcase

                                                                                                                                                                                                                                                                                                                                                                                                            downcase: (v: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                              function escape

                                                                                                                                                                                                                                                                                                                                                                                                              escape: (str: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                function escapeOnce

                                                                                                                                                                                                                                                                                                                                                                                                                escapeOnce: (str: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                  function first

                                                                                                                                                                                                                                                                                                                                                                                                                  first: (v: any) => any;

                                                                                                                                                                                                                                                                                                                                                                                                                    function floor

                                                                                                                                                                                                                                                                                                                                                                                                                    floor: (x: number) => any;

                                                                                                                                                                                                                                                                                                                                                                                                                      function join

                                                                                                                                                                                                                                                                                                                                                                                                                      join: (v: any[], arg: string) => any;

                                                                                                                                                                                                                                                                                                                                                                                                                        function json

                                                                                                                                                                                                                                                                                                                                                                                                                        json: (value: any) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                          function last

                                                                                                                                                                                                                                                                                                                                                                                                                          last: (v: any) => any;

                                                                                                                                                                                                                                                                                                                                                                                                                            function lstrip

                                                                                                                                                                                                                                                                                                                                                                                                                            lstrip: (v: string, chars?: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                              function map

                                                                                                                                                                                                                                                                                                                                                                                                                              map: (this: FilterImpl, arr: Scope[], property: string) => object[];

                                                                                                                                                                                                                                                                                                                                                                                                                                function minus

                                                                                                                                                                                                                                                                                                                                                                                                                                minus: (v: number, arg: number) => any;

                                                                                                                                                                                                                                                                                                                                                                                                                                  function modulo

                                                                                                                                                                                                                                                                                                                                                                                                                                  modulo: (v: number, arg: number) => any;

                                                                                                                                                                                                                                                                                                                                                                                                                                    function newlineToBr

                                                                                                                                                                                                                                                                                                                                                                                                                                    newlineToBr: (v: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                                      function plus

                                                                                                                                                                                                                                                                                                                                                                                                                                      plus: (v: number, arg: number) => number;

                                                                                                                                                                                                                                                                                                                                                                                                                                        function prepend

                                                                                                                                                                                                                                                                                                                                                                                                                                        prepend: (v: string, arg: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                                          function remove

                                                                                                                                                                                                                                                                                                                                                                                                                                          remove: (v: string, arg: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                                            function removeFirst

                                                                                                                                                                                                                                                                                                                                                                                                                                            removeFirst: (v: string, l: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                                              function replace

                                                                                                                                                                                                                                                                                                                                                                                                                                              replace: (v: string, pattern: string, replacement: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                function replaceFirst

                                                                                                                                                                                                                                                                                                                                                                                                                                                replaceFirst: (v: string, arg1: string, arg2: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                  function reverse

                                                                                                                                                                                                                                                                                                                                                                                                                                                  reverse: (v: any[]) => any;

                                                                                                                                                                                                                                                                                                                                                                                                                                                    function round

                                                                                                                                                                                                                                                                                                                                                                                                                                                    round: (v: number, arg?: number) => number;

                                                                                                                                                                                                                                                                                                                                                                                                                                                      function rstrip

                                                                                                                                                                                                                                                                                                                                                                                                                                                      rstrip: (str: string, chars?: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                        function size

                                                                                                                                                                                                                                                                                                                                                                                                                                                        size: (v: string | any[]) => number;

                                                                                                                                                                                                                                                                                                                                                                                                                                                          function slice

                                                                                                                                                                                                                                                                                                                                                                                                                                                          slice: <T>(v: T[] | string, begin: number, length?: number) => T[] | string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                            function sort

                                                                                                                                                                                                                                                                                                                                                                                                                                                            sort: <T>(this: FilterImpl, arr: T[], property?: string) => any[];

                                                                                                                                                                                                                                                                                                                                                                                                                                                              function sortNatural

                                                                                                                                                                                                                                                                                                                                                                                                                                                              sortNatural: <T>(input: T[], property?: string) => any[];

                                                                                                                                                                                                                                                                                                                                                                                                                                                                function split

                                                                                                                                                                                                                                                                                                                                                                                                                                                                split: (v: string, arg: string) => string[];

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  function strip

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  strip: (v: string, chars?: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    function stripHtml

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    stripHtml: (v: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      function stripNewlines

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      stripNewlines: (v: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        function times

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        times: (v: number, arg: number) => any;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          function truncate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          truncate: (v: string, l?: number, o?: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            function truncatewords

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            truncatewords: (v: string, l?: number, o?: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              function uniq

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              uniq: <T>(arr: T[]) => T[];

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                function upcase

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                upcase: (str: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  function urlDecode

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  urlDecode: (x: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    function urlEncode

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    urlEncode: (x: string) => string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      function where

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      where: <T extends object>(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      this: FilterImpl,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      arr: T[],
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      property: string,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      expected?: any
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ) => T[];

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        namespace tags

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        module 'dist/builtin/tags/index.d.ts' {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          variable tags

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          const tags: { [key: string]: TagImplOptions };

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            namespace TypeGuards

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            module 'dist/util/type-guards.d.ts' {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              function isDelimitedToken

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              isDelimitedToken: (val: any) => val is DelimitedToken;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                function isHTMLToken

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                isHTMLToken: (val: any) => val is HTMLToken;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  function isLiteralToken

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  isLiteralToken: (val: any) => val is LiteralToken;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    function isNumberToken

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    isNumberToken: (val: any) => val is NumberToken;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      function isOperatorToken

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      isOperatorToken: (val: any) => val is OperatorToken;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        function isOutputToken

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        isOutputToken: (val: any) => val is OutputToken;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          function isPropertyAccessToken

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          isPropertyAccessToken: (val: any) => val is PropertyAccessToken;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            function isQuotedToken

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            isQuotedToken: (val: any) => val is QuotedToken;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              function isRangeToken

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              isRangeToken: (val: any) => val is RangeToken;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                function isTagToken

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                isTagToken: (val: any) => val is TagToken;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  function isWordToken

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  isWordToken: (val: any) => val is IdentifierToken;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Package Files (36)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Dependencies (0)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    No dependencies.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Dev Dependencies (51)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Peer Dependencies (0)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    No peer dependencies.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Badge

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/liquidjs.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Markdown
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/liquidjs)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • HTML
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      <a href="https://www.jsdocs.io/package/liquidjs"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>