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 +1 -1
- package/src/authors-v2.mjs +17 -3
- package/src/defines.mjs +1 -0
package/package.json
CHANGED
package/src/authors-v2.mjs
CHANGED
|
@@ -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
|
-
|
|
102
|
-
|
|
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;
|