bajo-template 2.5.3 → 2.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -25,7 +25,7 @@ async function factory (pkgName) {
25
25
  },
26
26
  loopDetectorDur: '1m',
27
27
  cache: {
28
- maxAgeDur: '1s'
28
+ ttlDur: '1s'
29
29
  }
30
30
  }
31
31
  this.loopDetector = {}
@@ -270,7 +270,7 @@ async function factory (pkgName) {
270
270
  let subNs
271
271
  const isAbsolute = path.isAbsolute(tpl)
272
272
  if (!isAbsolute) subNs = breakNsPath(tpl).subNs
273
- const canCache = (isAbsolute || subNs === 'template') && this.config.cache !== false && cache && this.app.bajo.config.env !== 'dev'
273
+ const canCache = (isAbsolute || subNs === 'template') && this.config.cache !== false && cache
274
274
  if (canCache) {
275
275
  const item = await cache.get({ key })
276
276
  if (item) return item
@@ -279,7 +279,7 @@ async function factory (pkgName) {
279
279
  let text = await this._render(tpl, locals, opts)
280
280
  if (opts.postProcessor) text = await opts.postProcessor({ text, locals, opts })
281
281
  if (subNs) await runHook(`${this.ns}:afterRender${upperFirst(subNs)}`, { tpl, locals, opts, text })
282
- if (canCache) await cache.set({ key, value: text, ttl: opts.cacheMaxAge ?? this.config.cache.maxAgeDur })
282
+ if (canCache) await cache.set({ key, value: text, ttl: opts.ttlDur ?? this.config.cache.ttlDur })
283
283
  return text
284
284
  }
285
285
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo-template",
3
- "version": "2.5.3",
3
+ "version": "2.5.4",
4
4
  "description": "Template Renderer for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -3,6 +3,7 @@
3
3
  ## 2026-03-25
4
4
 
5
5
  - [2.5.3] Bug fix in cache handling for template function
6
+ - [2.5.4] Change ```maxAgeDur``` to ```ttlDur``` to align with bajoCache's terminology
6
7
 
7
8
  ## 2026-03-14
8
9