Skip to content

Commit

Permalink
Fix Config views, release 0.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Mary authored and Arnaud Mary committed Apr 8, 2024
1 parent a2ec497 commit 0d1b3db
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "igo-dust",
"version": "0.3.4",
"version": "0.3.5",
"description": "Javascript template engine",
"main": "index.js",
"devDependencies": {
Expand Down
4 changes: 3 additions & 1 deletion src/Cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class Cache {
const buffer = new Parser().parse(src);
compiled = new Compiler().compile(buffer);

this.put(filePath, compiled);
if (config.cache && compiled) {
this.put(filePath, compiled);
}
return compiled;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Config {
this.cache = !!settings['view cache'];
}
if (settings.views !== undefined) {
this.views = !!settings.views;
this.views = settings.views;
}
['htmlencode', 'htmltrim', 'cache'].forEach((key) => {
if (settings[key] !== undefined) {
Expand Down

0 comments on commit 0d1b3db

Please sign in to comment.