scv-esm 1.112.0 → 1.113.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scv-esm",
3
- "version": "1.112.0",
3
+ "version": "1.113.0",
4
4
  "description": "SuttaCentral Voice ES Module",
5
5
  "main": "index.js",
6
6
  "module": "main.mjs",
@@ -98,8 +98,22 @@ export default class AuthorsV2 {
98
98
  dbg && console.log(msg, '[1]lang', info.name);
99
99
  return info;
100
100
  }
101
- let cmp = AuthorsV2.compare(info.author, a && a.author);
102
- dbg && console.log(msg, '[2]compare', info.name, cmp);
101
+
102
+ // compare by number of MN suttas translated
103
+ let sutta_mn1 = info?.stats?.['sutta/mn'] || 0;
104
+ let sutta_mn2 = a?.stats?.['sutta/mn'] || 0;
105
+ let cmp = sutta_mn1 - sutta_mn2;
106
+
107
+ if (cmp === 0) { // compare by number of suttas translated
108
+ let sutta1 = info?.stats?.sutta || 0;
109
+ let sutta2 = a?.stats?.sutta || 0;
110
+ cmp = sutta1 - sutta2;
111
+ }
112
+ dbg && console.log(msg, '[2]stats', {sutta1, sutta2, cmp});
113
+ if (cmp === 0) { // compare by author name
114
+ cmp = AuthorsV2.compare(info.author, a && a.author);
115
+ dbg && console.log(msg, '[3]author', info.name, cmp);
116
+ }
103
117
  if (cmp === 0) {
104
118
  return a;
105
119
  }
@@ -191,7 +205,7 @@ export default class AuthorsV2 {
191
205
  let sutta1 = info1.sutta ? 1 : 0;
192
206
  let sutta2 = info2.sutta ? 1 : 0;
193
207
  cmp = sutta1 - sutta2;
194
- dbg && console.log(msg, '[7]sutta', cmp);
208
+ dbg && console.log(msg, '[7]sutta', cmp, info1.sutta, info2.sutta);
195
209
  }
196
210
  if (!cmp) {
197
211
  let vinaya1 = info1.vinaya ? 1 : 0;
package/src/defines.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  export const DBG = {
2
2
  A72_SUTTA_AUTHOR: 0,
3
+ A72_LANG_AUTHOR: 0,
3
4
  A72_COMPARE: 0,
4
5
  S6F_CREATE_OPTS: 0,
5
6
  };