bajo 2.11.0 → 2.11.1

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/class/bajo.js CHANGED
@@ -301,15 +301,14 @@ class Bajo extends Plugin {
301
301
  scope = item
302
302
  item = args.shift()
303
303
  }
304
- const bajo = scope.app.bajo
305
304
  if (isString(item)) {
306
- if (item.startsWith('applet:') && bajo.app.applets.length > 0) {
305
+ if (item.startsWith('applet:') && this.app.applets.length > 0) {
307
306
  const [, ns, path] = item.split(':')
308
- const applet = find(bajo.app.applets, a => (a.ns === ns || a.alias === ns))
309
- if (applet && scope.app.bajoCli) result = await scope.app.bajoCli.runApplet(applet, path, ...args)
307
+ const applet = find(this.app.applets, a => (a.ns === ns || a.alias === ns))
308
+ if (applet && this.app.bajoCli) result = await this.app.bajoCli.runApplet(applet, path, ...args)
310
309
  } else {
311
310
  const [ns, method, ...params] = item.split(':')
312
- const fn = bajo.getMethod(`${ns}:${method}`)
311
+ const fn = this.getMethod(`${ns}:${method}`)
313
312
  if (fn) {
314
313
  if (params.length > 0) args.unshift(...params)
315
314
  result = await fn(...args)
@@ -454,7 +453,7 @@ class Bajo extends Plugin {
454
453
  * @returns {string} Formatted value
455
454
  */
456
455
  format = (value, type, options = {}) => {
457
- const { defaultsDeep } = this.app.lib.aneka
456
+ const { defaultsDeep, isSet } = this.app.lib.aneka
458
457
  const { format } = this.config.intl
459
458
  const { emptyValue = format.emptyValue } = options
460
459
  const lang = options.lang ?? this.config.lang
@@ -496,6 +495,7 @@ class Bajo extends Plugin {
496
495
  }
497
496
  if (['array'].includes(type)) return value.join(', ')
498
497
  if (['object'].includes(type)) return JSON.stringify(value)
498
+ if (['boolean'].includes(type) && isSet(value)) return value ? this.t('true', { lang }) : this.t('false', { lang })
499
499
  return value
500
500
  }
501
501
 
@@ -800,15 +800,17 @@ class Bajo extends Plugin {
800
800
  * @param {string} [options.lastSeparator=and] - Text to use as the last separator
801
801
  * @returns {string}
802
802
  */
803
- join = (array, options) => {
804
- const { isSet } = this.app.lib.aneka
805
- const translate = val => {
806
- return this.t(val).toLowerCase()
803
+ join = (array, options = {}) => {
804
+ let separator = ', '
805
+ let lastSeparator = 'and'
806
+ let lang
807
+ if (isString(options)) separator = options
808
+ else ({ separator, lastSeparator, lang } = options)
809
+ const translate = (val) => {
810
+ return this.t(val, { lang }).toLowerCase()
807
811
  }
808
812
  if (array.length === 0) return translate('none')
809
813
  if (array.length === 1) return array[0]
810
- if (isSet(options) && !isPlainObject(options)) return array.join(options)
811
- let { separator = ', ', lastSeparator = 'and' } = options ?? {}
812
814
  lastSeparator = translate(lastSeparator)
813
815
  const last = (array.pop() ?? '').trim()
814
816
  return array.map(a => (a + '').trim()).join(separator) + ` ${lastSeparator} ${last}`
@@ -182,5 +182,7 @@
182
182
  "fieldError%s%s": "'%s': %s|lowerFirst",
183
183
  "reservedName%s%s": "%s|upperFirst name '%s' is a reserved name. Please rename to something else",
184
184
  "missing%s%s": "Missing '%s' %s",
185
- "processing...": "Processing..."
185
+ "processing...": "Processing...",
186
+ "true": "True",
187
+ "false": "False"
186
188
  }
@@ -182,5 +182,7 @@
182
182
  "fieldError%s%s": "'%s': %s|lowerFirst",
183
183
  "reservedName%s%s": "Nama %s|lowerFirst '%s' adalah nama tang di reserve. Silahkan gunakan nama lainnya",
184
184
  "missing%s%s": "%s|upperFirst '%s' tidak ditemukan",
185
- "processing...": "Memroses..."
185
+ "processing...": "Memroses...",
186
+ "true": "Benar",
187
+ "false": "Salah"
186
188
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo",
3
- "version": "2.11.0",
3
+ "version": "2.11.1",
4
4
  "description": "The ultimate framework for whipping up massive apps in no time",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-04-11
4
+
5
+ - [2.11.1] Bug fix in ```join()```
6
+ - [2.11.1] Bug fix in ```format()```
7
+
3
8
  ## 2026-04-07
4
9
 
5
10
  - [2.11.0] Change ```dispose()``` to be an async function