wiki-plugin-mech 0.1.29 → 0.1.30
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/client/mech.js +3 -1
- package/package.json +1 -1
package/client/mech.js
CHANGED
|
@@ -867,7 +867,9 @@
|
|
|
867
867
|
const rand = a => a[prob(a.length)]
|
|
868
868
|
const good = info => info.links && Object.keys(info.links).length < 10
|
|
869
869
|
const back = slug => neighborhood.filter(info => good(info) && slug in info.links)
|
|
870
|
-
const
|
|
870
|
+
// const uniq = (value, index, self) => self.indexOf(value) === index
|
|
871
|
+
const dedup = (value, index, self) => self.findIndex(info => info.slug == value.slug) === index
|
|
872
|
+
const newr = infos => infos.toSorted((a,b)=>b.date-a.date).filter(dedup).slice(0,3)
|
|
871
873
|
const domains = neighborhood
|
|
872
874
|
.map(info => info.domain)
|
|
873
875
|
.filter(uniq)
|