liquidless
Advanced tools
Comparing version 1.0.9 to 1.1.0
import { Filters } from './filters'; | ||
declare type RenderOptions = { | ||
filters?: Filters; | ||
delimiters?: string[]; | ||
}; | ||
export declare function renderTemplate(template: string | object, props: object, options?: RenderOptions): string | object | never; | ||
export {}; |
@@ -12,3 +12,6 @@ "use strict"; | ||
const flatProps = (0, flat_1.default)(props); | ||
return template.replaceAll(/{{(.+?)}}/g, (a, match) => { | ||
let delimiters = ['{{', '}}']; | ||
if (options?.delimiters) | ||
delimiters = options.delimiters; | ||
return template.replaceAll(new RegExp(`\\${delimiters[0]}(.+?)${delimiters[1]}`, 'g'), (a, match) => { | ||
const [variable, ...filters] = match.split('|'); | ||
@@ -15,0 +18,0 @@ const combinedFilters = { ...filters_1.defaultFilters, ...options?.filters }; |
{ | ||
"name": "liquidless", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"description": "Shopify's Liquid template engine, but less powerful", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6207
83