Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

liquidjs

Package Overview
Dependencies
Maintainers
1
Versions
208
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

liquidjs - npm Package Compare versions

Comparing version 10.14.0 to 10.15.0

dist/fs/map-fs.d.ts

8

dist/context/context.d.ts
import { NormalizedFullOptions, RenderOptions } from '../liquid-options';
import { Scope } from './scope';
import { Limiter } from '../util';
type PropertyKey = string | number;

@@ -31,3 +32,7 @@ export declare class Context {

ownPropertyOnly: boolean;
constructor(env?: object, opts?: NormalizedFullOptions, renderOptions?: RenderOptions);
memoryLimit: Limiter;
renderLimit: Limiter;
constructor(env?: object, opts?: NormalizedFullOptions, renderOptions?: RenderOptions, { memoryLimit, renderLimit }?: {
[key: string]: Limiter;
});
getRegister(key: string): any;

@@ -52,2 +57,3 @@ setRegister(key: string, value: any): any;

bottom(): Scope;
spawn(scope?: {}): Context;
private findScope;

@@ -54,0 +60,0 @@ }

28

dist/filters/array.d.ts
import { FilterImpl } from '../template';
import { Scope } from '../context';
export declare const join: (v: any[], arg: string) => any;
export declare const last: (v: any) => any;
export declare const first: (v: any) => any;
export declare const reverse: (v: any[]) => any;
import type { Scope } from '../context';
export declare const join: (this: unknown, v: any[], arg: string) => any;
export declare const last: (this: unknown, v: any) => any;
export declare const first: (this: unknown, v: any) => any;
export declare const reverse: (this: unknown, v: any[]) => any;
export declare function sort<T>(this: FilterImpl, arr: T[], property?: string): IterableIterator<unknown>;
export declare function sort_natural<T>(input: T[], property?: string): any[];
export declare function sort_natural<T>(this: FilterImpl, input: T[], property?: string): any[];
export declare const size: (v: string | any[]) => number;

@@ -13,15 +13,15 @@ export declare function map(this: FilterImpl, arr: Scope[], property: string): IterableIterator<unknown>;

export declare function compact<T>(this: FilterImpl, arr: T[]): any[];
export declare function concat<T1, T2>(v: T1[], arg?: T2[]): (T1 | T2)[];
export declare function push<T>(v: T[], arg: T): T[];
export declare function unshift<T>(v: T[], arg: T): T[];
export declare function concat<T1, T2>(this: FilterImpl, v: T1[], arg?: T2[]): (T1 | T2)[];
export declare function push<T>(this: FilterImpl, v: T[], arg: T): T[];
export declare function unshift<T>(this: FilterImpl, v: T[], arg: T): T[];
export declare function pop<T>(v: T[]): T[];
export declare function shift<T>(v: T[]): T[];
export declare function slice<T>(v: T[] | string, begin: number, length?: number): T[] | string;
export declare function shift<T>(this: FilterImpl, v: T[]): T[];
export declare function slice<T>(this: FilterImpl, v: T[] | string, begin: number, length?: number): T[] | string;
export declare function where<T extends object>(this: FilterImpl, arr: T[], property: string, expected?: any): IterableIterator<unknown>;
export declare function where_exp<T extends object>(this: FilterImpl, arr: T[], itemName: string, exp: string): IterableIterator<unknown>;
export declare function group_by<T extends object>(arr: T[], property: string): IterableIterator<unknown>;
export declare function group_by<T extends object>(this: FilterImpl, arr: T[], property: string): IterableIterator<unknown>;
export declare function group_by_exp<T extends object>(this: FilterImpl, arr: T[], itemName: string, exp: string): IterableIterator<unknown>;
export declare function find<T extends object>(this: FilterImpl, arr: T[], property: string, expected: string): IterableIterator<unknown>;
export declare function find_exp<T extends object>(this: FilterImpl, arr: T[], itemName: string, exp: string): IterableIterator<unknown>;
export declare function uniq<T>(arr: T[]): T[];
export declare function sample<T>(v: T[] | string, count?: number): T | string | (T | string)[];
export declare function uniq<T>(this: FilterImpl, arr: T[]): T[];
export declare function sample<T>(this: FilterImpl, v: T[] | string, count?: number): T | string | (T | string)[];

@@ -1,5 +0,6 @@

export declare function escape(str: string): string;
export declare function xml_escape(str: string): string;
export declare function escape_once(str: string): string;
export declare function newline_to_br(v: string): string;
export declare function strip_html(v: string): string;
import { FilterImpl } from '../template';
export declare function escape(this: FilterImpl, str: string): string;
export declare function xml_escape(this: FilterImpl, str: string): string;
export declare function escape_once(this: FilterImpl, str: string): string;
export declare function newline_to_br(this: FilterImpl, v: string): string;
export declare function strip_html(this: FilterImpl, v: string): string;

@@ -1,11 +0,11 @@

export declare const abs: (x: number) => any;
export declare const at_least: (...args: number[]) => any;
export declare const at_most: (...args: number[]) => any;
export declare const ceil: (x: number) => any;
export declare const divided_by: (dividend: number, divisor: number, integerArithmetic?: any) => any;
export declare const floor: (x: number) => any;
export declare const minus: (v: number, arg: number) => any;
export declare const modulo: (v: number, arg: number) => any;
export declare const times: (v: number, arg: number) => any;
export declare const abs: (this: unknown, x: number) => any;
export declare const at_least: (this: unknown, ...args: number[]) => any;
export declare const at_most: (this: unknown, ...args: number[]) => any;
export declare const ceil: (this: unknown, x: number) => any;
export declare const divided_by: (this: unknown, dividend: number, divisor: number, integerArithmetic?: any) => any;
export declare const floor: (this: unknown, x: number) => any;
export declare const minus: (this: unknown, v: number, arg: number) => any;
export declare const modulo: (this: unknown, v: number, arg: number) => any;
export declare const times: (this: unknown, v: number, arg: number) => any;
export declare function round(v: number, arg?: number): number;
export declare function plus(v: number, arg: number): number;

@@ -6,22 +6,23 @@ /**

*/
export declare function append(v: string, arg: string): string;
export declare function prepend(v: string, arg: string): string;
export declare function lstrip(v: string, chars?: string): string;
export declare function downcase(v: string): string;
export declare function upcase(str: string): string;
export declare function remove(v: string, arg: string): string;
export declare function remove_first(v: string, l: string): string;
export declare function remove_last(v: string, l: string): string;
export declare function rstrip(str: string, chars?: string): string;
export declare function split(v: string, arg: string): string[];
export declare function strip(v: string, chars?: string): string;
export declare function strip_newlines(v: string): string;
export declare function capitalize(str: string): string;
export declare function replace(v: string, pattern: string, replacement: string): string;
export declare function replace_first(v: string, arg1: string, arg2: string): string;
export declare function replace_last(v: string, arg1: string, arg2: string): string;
export declare function truncate(v: string, l?: number, o?: string): string;
export declare function truncatewords(v: string, words?: number, o?: string): string;
export declare function normalize_whitespace(v: string): string;
export declare function number_of_words(input: string, mode?: 'cjk' | 'auto'): number;
export declare function array_to_sentence_string(array: unknown[], connector?: string): unknown;
import { FilterImpl } from '../template';
export declare function append(this: FilterImpl, v: string, arg: string): string;
export declare function prepend(this: FilterImpl, v: string, arg: string): string;
export declare function lstrip(this: FilterImpl, v: string, chars?: string): string;
export declare function downcase(this: FilterImpl, v: string): string;
export declare function upcase(this: FilterImpl, v: string): string;
export declare function remove(this: FilterImpl, v: string, arg: string): string;
export declare function remove_first(this: FilterImpl, v: string, l: string): string;
export declare function remove_last(this: FilterImpl, v: string, l: string): string;
export declare function rstrip(this: FilterImpl, str: string, chars?: string): string;
export declare function split(this: FilterImpl, v: string, arg: string): string[];
export declare function strip(this: FilterImpl, v: string, chars?: string): string;
export declare function strip_newlines(this: FilterImpl, v: string): string;
export declare function capitalize(this: FilterImpl, str: string): string;
export declare function replace(this: FilterImpl, v: string, pattern: string, replacement: string): string;
export declare function replace_first(this: FilterImpl, v: string, arg1: string, arg2: string): string;
export declare function replace_last(this: FilterImpl, v: string, arg1: string, arg2: string): string;
export declare function truncate(this: FilterImpl, v: string, l?: number, o?: string): string;
export declare function truncatewords(this: FilterImpl, v: string, words?: number, o?: string): string;
export declare function normalize_whitespace(this: FilterImpl, v: string): string;
export declare function number_of_words(this: FilterImpl, input: string, mode?: 'cjk' | 'auto'): number;
export declare function array_to_sentence_string(this: FilterImpl, array: unknown[], connector?: string): unknown;

@@ -61,2 +61,6 @@ import { LiquidCache } from './cache';

fs?: FS;
/** Render from in-memory `templates` mapping instead of file system. File system related options like `fs`, 'root', and `relativeReference` will be ignored when `templates` is specified. */
templates?: {
[key: string]: string;
};
/** the global scope passed down to all partial and layout templates, i.e. templates included by `include`, `layout` and `render` tags. */

@@ -72,2 +76,8 @@ globals?: object;

orderedFilterParameters?: boolean;
/** For DoS handling, limit total length of templates parsed in one `parse()` call. A typical PC can handle 1e8 (100M) characters without issues. */
parseLimit?: number;
/** For DoS handling, limit total time (in ms) for each `render()` call. */
renderLimit?: number;
/** For DoS handling, limit new objects creation, including array concat/join/strftime, etc. A typical PC can handle 1e9 (1G) memory without issue. */
memoryLimit?: number;
}

@@ -91,2 +101,8 @@ export interface RenderOptions {

ownPropertyOnly?: boolean;
/** For DoS handling, limit total renders of tag/HTML/output in one `render()` call. A typical PC can handle 1e5 renders of typical templates per second. */
templateLimit?: number;
/** For DoS handling, limit total time (in ms) for each `render()` call. */
renderLimit?: number;
/** For DoS handling, limit new objects creation, including array concat/join/strftime, etc. A typical PC can handle 1e9 (1G) memory without issue.. */
memoryLimit?: number;
}

@@ -132,2 +148,5 @@ export interface RenderFileOptions extends RenderOptions {

operators: Operators;
parseLimit: number;
renderLimit: number;
memoryLimit: number;
}

@@ -134,0 +153,0 @@ export declare const defaultOptions: NormalizedFullOptions;

@@ -11,2 +11,5 @@ /// <reference types="node" />

readonly renderer: Render;
/**
* @deprecated will be removed. In tags use `this.parser` instead
*/
readonly parser: Parser;

@@ -13,0 +16,0 @@ readonly filters: Record<string, FilterImplOptions>;

@@ -12,2 +12,3 @@ import { ParseStream } from './parse-stream';

private loader;
private parseLimit;
constructor(liquid: Liquid);

@@ -14,0 +15,0 @@ parse(html: string, filepath?: string): Template[];

import { Liquid, TagToken, TopLevelToken, Template, Context, Emitter, Tag } from '..';
import { Parser } from '../parser';
export default class extends Tag {
block: string;
templates: Template[];
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
render(ctx: Context, emitter: Emitter): Generator<any, void, unknown>;
private getBlockRender;
}
import { Liquid, Tag, Template, Context, TagToken, TopLevelToken } from '..';
import { Parser } from '../parser';
export default class extends Tag {
variable: string;
templates: Template[];
constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
render(ctx: Context): Generator<unknown, void, string>;
private readVariableName;
}
import { ValueToken, Liquid, Value, Emitter, TagToken, TopLevelToken, Context, Template, Tag } from '..';
import { Parser } from '../parser';
export default class extends Tag {

@@ -9,4 +10,4 @@ value: Value;

elseTemplates: Template[];
constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
}
import { Hash, ValueToken, Liquid, Tag, Emitter, TagToken, TopLevelToken, Context, Template } from '..';
import { Parser } from '../parser';
export default class extends Tag {

@@ -8,4 +9,4 @@ variable: string;

elseTemplates: Template[];
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
render(ctx: Context, emitter: Emitter): Generator<unknown, void | string, Template[]>;
}
import { Liquid, Tag, Value, Emitter, TagToken, TopLevelToken, Context, Template } from '..';
import { Parser } from '../parser';
export default class extends Tag {

@@ -7,5 +8,5 @@ branches: {

}[];
elseTemplates: Template[];
constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
elseTemplates: Template[] | undefined;
constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
render(ctx: Context, emitter: Emitter): Generator<unknown, void, string>;
}
import { TopLevelToken, Liquid, Tag, Emitter, TagToken, Context } from '..';
import { Parser } from '../parser';
export default class extends Tag {
private withVar?;
private hash;
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
}
import { Template, Liquid, Tag, Emitter, Hash, TagToken, TopLevelToken, Context } from '..';
import { ParsedFileName } from './render';
import { Parser } from '../parser';
export default class extends Tag {

@@ -7,4 +8,4 @@ args: Hash;

file?: ParsedFileName;
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
render(ctx: Context, emitter: Emitter): Generator<unknown, unknown, unknown>;
}
import { Template, Emitter, Liquid, TopLevelToken, TagToken, Context, Tag } from '..';
import { Parser } from '../parser';
export default class extends Tag {
templates: Template[];
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
}
import { TopLevelToken, Liquid, Token, Template, Tokenizer, Emitter, TagToken, Context, Tag } from '..';
import { Parser } from '../parser';
export type ParsedFileName = Template[] | Token | string | undefined;

@@ -7,3 +8,3 @@ export default class extends Tag {

private hash;
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;

@@ -17,3 +18,3 @@ }

*/
export declare function parseFilePath(tokenizer: Tokenizer, liquid: Liquid): ParsedFileName;
export declare function parseFilePath(tokenizer: Tokenizer, liquid: Liquid, parser: Parser): ParsedFileName;
export declare function renderFilePath(file: ParsedFileName, ctx: Context, liquid: Liquid): IterableIterator<unknown>;
import { ValueToken, Liquid, Tag, Emitter, Hash, TagToken, TopLevelToken, Context, Template } from '..';
import { Parser } from '../parser';
export default class extends Tag {

@@ -7,4 +8,4 @@ variable: string;

collection: ValueToken;
constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
}
import { Liquid, Tag, Value, TopLevelToken, Template, Emitter, Context, TagToken } from '..';
import { Parser } from '../parser';
export default class extends Tag {

@@ -9,4 +10,4 @@ branches: {

elseTemplates: Template[];
constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
render(ctx: Context, emitter: Emitter): Generator<unknown, unknown, unknown>;
}
import { TemplateImpl } from './template-impl';
import type { Emitter } from '../emitters/emitter';
import type { Tokenizer } from '../parser';
import type { Parser, Tokenizer } from '../parser';
import type { Context } from '../context/context';

@@ -17,3 +17,3 @@ import type { TopLevelToken, TagToken } from '../tokens';

export interface TagClass {
new (token: TagToken, tokens: TopLevelToken[], liquid: Liquid): Tag;
new (token: TagToken, tokens: TopLevelToken[], liquid: Liquid, parser: Parser): Tag;
}
export declare function assert<T>(predicate: T | null | undefined, message?: string | (() => string)): void;
export declare function assertEmpty<T>(predicate: T | null | undefined, message?: string): void;

@@ -12,1 +12,2 @@ export * from './error';

export * from './timezone-date';
export * from './limiter';

@@ -34,3 +34,3 @@ export declare const toString: () => string;

export declare function caseInsensitiveCompare(a: any, b: any): 0 | 1 | -1;
export declare function argumentsToValue<F extends (...args: any) => any>(fn: F): (...args: Parameters<F>) => any;
export declare function argumentsToValue<F extends (...args: any) => any, T>(fn: F): (this: T, ...args: Parameters<F>) => any;
export declare function escapeRegExp(text: string): string;
{
"name": "liquidjs",
"version": "10.14.0",
"version": "10.15.0",
"description": "A simple, expressive and safe Shopify / Github Pages compatible template engine in pure JavaScript.",

@@ -5,0 +5,0 @@ "main": "dist/liquid.node.cjs.js",

@@ -95,2 +95,3 @@ # liquidjs

<td align="center" valign="top" width="14.28%"><a href="https://customer.io/"><img src="https://avatars.githubusercontent.com/u/1152079?v=4?s=100" width="100px;" alt="Customer IO"/><br /><sub><b>Customer IO</b></sub></a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/15fathoms"><img src="https://avatars.githubusercontent.com/u/79156039?v=4?s=100" width="100px;" alt="Emmanuel Cartelli"/><br /><sub><b>Emmanuel Cartelli</b></sub></a><br /></td>
</tr>

@@ -97,0 +98,0 @@ </tbody>

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc