bajo-common-db 2.2.0 → 2.2.2
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/extend/bajo/intl/en-US.json +2 -0
- package/extend/bajo/intl/id.json +2 -0
- package/index.js +11 -0
- package/package.json +1 -1
- package/wiki/CHANGES.md +9 -1
package/extend/bajo/intl/id.json
CHANGED
package/index.js
CHANGED
|
@@ -19,6 +19,17 @@ async function factory (pkgName) {
|
|
|
19
19
|
title: 'Common Database'
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
getCountryByMmsi = (mmsi, returnRec = false) => {
|
|
24
|
+
if (!this.app.dobo) return
|
|
25
|
+
// this won't use Dobo's model interface, it scans directly on memdb storage instead
|
|
26
|
+
const head = parseInt(mmsi.slice(0, 3))
|
|
27
|
+
const instance = this.app.dobo.getModel('CdbCountry', true)
|
|
28
|
+
if (!instance) return
|
|
29
|
+
const country = instance.driver.storage.CdbCountry.find(item => (item.mmsi ?? []).includes(head))
|
|
30
|
+
if (returnRec) return country
|
|
31
|
+
return country ? country._id : undefined
|
|
32
|
+
}
|
|
22
33
|
}
|
|
23
34
|
|
|
24
35
|
return BajoCommonDb
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-01-19
|
|
4
|
+
|
|
5
|
+
- [2.2.2] Add some missing translations
|
|
6
|
+
|
|
7
|
+
## 2026-01-15
|
|
8
|
+
|
|
9
|
+
- [2.2.1] Add method ```getCountryByMmsi()```
|
|
10
|
+
|
|
3
11
|
## 2025-12-21
|
|
4
12
|
|
|
5
|
-
- Rename field ```mids``` to ```mmsi``` in ```CdbCountry```
|
|
13
|
+
- [2.2.0] Rename field ```mids``` to ```mmsi``` in ```CdbCountry```
|
|
6
14
|
|
|
7
15
|
## 2025-12-10
|
|
8
16
|
|