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.
Files changed (2) hide show
  1. package/client/mech.js +3 -1
  2. 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 newr = infos => infos.toSorted((a,b)=>b.date-a.date).slice(0,3)
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wiki-plugin-mech",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "Federated Wiki - Mechanism Scripting Plugin",
5
5
  "keywords": [
6
6
  "mech",