waibu 2.11.1 → 2.11.3

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
@@ -242,8 +242,12 @@ async function factory (pkgName) {
242
242
  * @param {string} text
243
243
  * @returns {string}
244
244
  */
245
- escape = (text = '') => {
246
- if (typeof text !== 'string') return text
245
+ escape = (text) => {
246
+ const { isSet } = this.app.lib.aneka
247
+ const { isArray, isPlainObject, cloneDeep } = this.app.lib._
248
+ if (!isSet(text)) return ''
249
+ if (isArray(text) || isPlainObject(text)) text = JSON.stringify(cloneDeep(text))
250
+ else text = text + ''
247
251
  const { forOwn } = this.app.lib._
248
252
  forOwn(this.escapeChars, (v, k) => {
249
253
  text = text.replaceAll(k, v)
@@ -64,6 +64,7 @@ export async function notFound (err, req, reply) {
64
64
  reply.code(404)
65
65
  const resp = await interceptor.call(this, 'notFoundHandler', err, req, reply)
66
66
  if (resp) return resp
67
+ if (err.noContent) return ''
67
68
  const payload = {
68
69
  text: req.t('notFound%s%s', req.t('route'), req.url),
69
70
  title: req.t('pageNotFound')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu",
3
- "version": "2.11.1",
3
+ "version": "2.11.3",
4
4
  "description": "Web Framework for Bajo",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-05-03
4
+
5
+ - [2.11.2] Bug fix in ```handle-not-found.js```
6
+ - [2.11.3] Bug fix in ```escape()```
7
+
3
8
  ## 2026-04-19
4
9
 
5
10
  - [2.11.1] Bug fix in ```getSetting()```