bajo 2.6.1 → 2.7.0
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 +4 -3
- package/extend/bajo/intl/en-US.json +2 -1
- package/extend/bajo/intl/id.json +2 -1
- package/package.json +1 -1
- package/wiki/CHANGES.md +9 -0
package/class/bajo.js
CHANGED
|
@@ -225,8 +225,7 @@ class Bajo extends Plugin {
|
|
|
225
225
|
* @returns {Object[]} The collection
|
|
226
226
|
*/
|
|
227
227
|
buildCollections = async (options = {}) => {
|
|
228
|
-
let { ns, handler, dupChecks = [], container, useDefaultName } = options
|
|
229
|
-
useDefaultName = useDefaultName ?? true
|
|
228
|
+
let { ns, handler, dupChecks = [], container, useDefaultName = true, noDefault = true } = options
|
|
230
229
|
if (!ns) ns = this.ns
|
|
231
230
|
const cfg = this.app[ns].getConfig()
|
|
232
231
|
let items = get(cfg, container, [])
|
|
@@ -269,6 +268,8 @@ class Bajo extends Plugin {
|
|
|
269
268
|
}
|
|
270
269
|
}
|
|
271
270
|
|
|
271
|
+
if (!noDefault && !items.find(item => item.name === 'default')) this.app[ns].fatal('missing%s%s', 'default', container)
|
|
272
|
+
|
|
272
273
|
/**
|
|
273
274
|
* Run after collection is built
|
|
274
275
|
*
|
|
@@ -548,7 +549,7 @@ class Bajo extends Plugin {
|
|
|
548
549
|
* @returns {function} Class method
|
|
549
550
|
*/
|
|
550
551
|
getMethod = (name = '', thrown = true) => {
|
|
551
|
-
const { ns, path } = this.breakNsPath(name)
|
|
552
|
+
const { ns, path } = this.breakNsPath(name, thrown)
|
|
552
553
|
const method = get(this.app, `${ns}.${path}`)
|
|
553
554
|
if (method && isFunction(method)) return method
|
|
554
555
|
if (thrown) throw this.error('cantFindMethod%s', name)
|
|
@@ -180,5 +180,6 @@
|
|
|
180
180
|
"method": "Method",
|
|
181
181
|
"exist%s%s": "%s|upperFirst '%s' exists already",
|
|
182
182
|
"fieldError%s%s": "'%s': %s|lowerFirst",
|
|
183
|
-
"reservedName%s%s": "%s|upperFirst name '%s' is a reserved name. Please rename to something else"
|
|
183
|
+
"reservedName%s%s": "%s|upperFirst name '%s' is a reserved name. Please rename to something else",
|
|
184
|
+
"missing%s%s": "Missing '%s' %s"
|
|
184
185
|
}
|
package/extend/bajo/intl/id.json
CHANGED
|
@@ -180,5 +180,6 @@
|
|
|
180
180
|
"method": "Metode",
|
|
181
181
|
"exist%s%s": "%s|upperFirst '%s' sudah ada",
|
|
182
182
|
"fieldError%s%s": "'%s': %s|lowerFirst",
|
|
183
|
-
"reservedName%s%s": "Nama %s|lowerFirst '%s' adalah nama tang di reserve. Silahkan gunakan nama lainnya"
|
|
183
|
+
"reservedName%s%s": "Nama %s|lowerFirst '%s' adalah nama tang di reserve. Silahkan gunakan nama lainnya",
|
|
184
|
+
"missing%s%s": "%s|upperFirst '%s' tidak ditemukan"
|
|
184
185
|
}
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-03-02
|
|
4
|
+
|
|
5
|
+
- [2.7.0] Add ```useDefaultName``` parameter to ```buildCollection()```
|
|
6
|
+
- [2.7.0] Add some translations
|
|
7
|
+
|
|
8
|
+
## 2026-02-26
|
|
9
|
+
|
|
10
|
+
- [2.6.2] Bug fix on ```getMethod()```
|
|
11
|
+
|
|
3
12
|
## 2026-02-23
|
|
4
13
|
|
|
5
14
|
- [2.6.1] Bug fix on ```readConfig()```
|