Comparing version 0.2.5 to 0.3.0
@@ -299,4 +299,7 @@ "use strict"; | ||
const renderBlockContentFn = data.fn; // if block helper | ||
return new handlebars_1.default.SafeString(helperFunction({ hash: data.hash, globals, renderBlockContent: renderBlockContentFn }, ...passedArgs)); | ||
const compileAndRenderTemplateDecorator = (template, input) => { | ||
return handlebars_1.default.compile(template)(input !== null && input !== void 0 ? input : {}); | ||
}; | ||
return new handlebars_1.default.SafeString(helperFunction({ hash: data.hash, globals, renderBlockContent: renderBlockContentFn, renderTemplate: compileAndRenderTemplateDecorator }, ...passedArgs)); | ||
}; | ||
} |
{ | ||
"name": "symply", | ||
"version": "0.2.5", | ||
"version": "0.3.0", | ||
"description": "A simple static site generator.", | ||
@@ -23,2 +23,3 @@ "author": "Oleg Legun <oleg.legun@gmail.com>", | ||
"lint": "npx eslint . --ext .js,.jsx,.ts,.tsx", | ||
"cloc": "cloc --exclude-dir=node_modules,dist --exclude-ext=json .", | ||
"test": "npm run compile && tape test/**/*.js | tap-spec" | ||
@@ -25,0 +26,0 @@ }, |
@@ -23,2 +23,8 @@ interface SymplyConfiguration extends Partial<Symply.SystemConfiguration> { | ||
renderBlockContent?: () => string | ||
/** | ||
* Compile input template string and render result content | ||
* @example | ||
* compile('{{> myPartial}}') | ||
**/ | ||
renderTemplate: (template: string, input?: Record<string, unknown>) => string | ||
} | ||
@@ -25,0 +31,0 @@ |
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
176996
1197