nostr-social-graph
Advanced tools
Comparing version 1.0.8 to 1.0.9
var B = Object.defineProperty; | ||
var g = (c, t, e) => t in c ? B(c, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[t] = e; | ||
var h = (c, t, e) => g(c, typeof t != "symbol" ? t + "" : t, e); | ||
var g = (f, t, e) => t in f ? B(f, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : f[t] = e; | ||
var h = (f, t, e) => g(f, typeof t != "symbol" ? t + "" : t, e); | ||
class w { | ||
@@ -108,3 +108,3 @@ constructor(t) { | ||
handleMuteList(t, e, s) { | ||
var n, d, f, a; | ||
var n, d, c, a; | ||
const o = this.muteListCreatedAt.get(e); | ||
@@ -126,3 +126,3 @@ if (o && s <= o) | ||
for (const l of i) | ||
this.mutedByUser.has(e) || this.mutedByUser.set(e, /* @__PURE__ */ new Set()), (f = this.mutedByUser.get(e)) == null || f.add(l), this.userMutedBy.has(l) || this.userMutedBy.set(l, /* @__PURE__ */ new Set()), (a = this.userMutedBy.get(l)) == null || a.add(e); | ||
this.mutedByUser.has(e) || this.mutedByUser.set(e, /* @__PURE__ */ new Set()), (c = this.mutedByUser.get(e)) == null || c.add(l), this.userMutedBy.has(l) || this.userMutedBy.set(l, /* @__PURE__ */ new Set()), (a = this.userMutedBy.get(l)) == null || a.add(e); | ||
} | ||
@@ -238,12 +238,16 @@ isFollowing(t, e) { | ||
deserialize(t, e) { | ||
var o; | ||
var o, i; | ||
const s = (o = t[0]) == null ? void 0 : o[0]; | ||
for (const [i, r, n] of t) { | ||
for (const d of r) | ||
this.privateAddFollower(d, i); | ||
this.followListCreatedAt.set(i, n ?? 0); | ||
for (const [r, n, d] of t) { | ||
for (const c of n) | ||
this.privateAddFollower(c, r); | ||
this.followListCreatedAt.set(r, d ?? 0); | ||
} | ||
if (e) | ||
for (const [i, r, n] of e) | ||
this.mutedByUser.set(i, new Set(r)), this.muteListCreatedAt.set(i, n ?? 0); | ||
for (const [r, n, d] of e) { | ||
this.mutedByUser.set(r, new Set(n)); | ||
for (const c of n) | ||
this.userMutedBy.has(c) || this.userMutedBy.set(c, /* @__PURE__ */ new Set()), (i = this.userMutedBy.get(c)) == null || i.add(r); | ||
this.muteListCreatedAt.set(r, d ?? 0); | ||
} | ||
s !== this.root && this.recalculateFollowDistances(); | ||
@@ -281,7 +285,7 @@ } | ||
if (!n || d && n < d) { | ||
const f = i.get(r) || /* @__PURE__ */ new Set(), a = o.get(r) || /* @__PURE__ */ new Set(); | ||
for (const l of f) | ||
const c = i.get(r) || /* @__PURE__ */ new Set(), a = o.get(r) || /* @__PURE__ */ new Set(); | ||
for (const l of c) | ||
a.has(l) || (o.has(r) || o.set(r, /* @__PURE__ */ new Set()), o.get(r).add(l)); | ||
for (const l of a) | ||
f.has(l) || o.get(r).delete(l); | ||
c.has(l) || o.get(r).delete(l); | ||
e.set(r, d ?? 0); | ||
@@ -288,0 +292,0 @@ } |
@@ -1,1 +0,1 @@ | ||
(function(c,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(c=typeof globalThis<"u"?globalThis:c||self,d(c["nostr-social-graph"]={}))})(this,function(c){"use strict";var U=Object.defineProperty;var m=(c,d,a)=>d in c?U(c,d,{enumerable:!0,configurable:!0,writable:!0,value:a}):c[d]=a;var f=(c,d,a)=>m(c,typeof d!="symbol"?d+"":d,a);class d{constructor(t){f(this,"strToUniqueId",new Map);f(this,"uniqueIdToStr",new Map);f(this,"currentUniqueId",0);if(t)for(const[e,s]of t)this.strToUniqueId.set(e,s),this.uniqueIdToStr.set(s,e),this.currentUniqueId=Math.max(this.currentUniqueId,s+1)}id(t){const e=this.strToUniqueId.get(t);if(e!==void 0)return e;const s=this.currentUniqueId++;return this.strToUniqueId.set(t,s),this.uniqueIdToStr.set(s,t),s}str(t){const e=this.uniqueIdToStr.get(t);if(!e)throw new Error("pub: invalid id "+t);return e}has(t){return this.strToUniqueId.has(t)}serialize(){return Array.from(this.strToUniqueId.entries())}*[Symbol.iterator](){yield*this.uniqueIdToStr.entries()}}const a=/^[0-9a-fA-F]{64}$/;class B{constructor(t,e){f(this,"root");f(this,"followDistanceByUser",new Map);f(this,"usersByFollowDistance",new Map);f(this,"followedByUser",new Map);f(this,"followersByUser",new Map);f(this,"followListCreatedAt",new Map);f(this,"mutedByUser",new Map);f(this,"userMutedBy",new Map);f(this,"muteListCreatedAt",new Map);f(this,"ids",new d);this.ids=new d(e&&e.uniqueIds),this.root=this.id(t),this.followDistanceByUser.set(this.root,0),this.usersByFollowDistance.set(0,new Set([this.root])),e&&this.deserialize(e.followLists)}id(t){return this.ids.id(t)}str(t){return this.ids.str(t)}getRoot(){return this.str(this.root)}setRoot(t){const e=this.id(t);e!==this.root&&(this.root=e,this.recalculateFollowDistances())}recalculateFollowDistances(){this.followDistanceByUser.clear(),this.usersByFollowDistance.clear(),this.followDistanceByUser.set(this.root,0),this.usersByFollowDistance.set(0,new Set([this.root]));const t=[this.root];for(;t.length>0;){const e=t.shift(),s=this.followDistanceByUser.get(e),o=this.followedByUser.get(e)||new Set;for(const i of o)if(!this.followDistanceByUser.has(i)){const r=s+1;this.followDistanceByUser.set(i,r),this.usersByFollowDistance.has(r)||this.usersByFollowDistance.set(r,new Set),this.usersByFollowDistance.get(r).add(i),t.push(i)}}}handleEvent(t){const e=(Array.isArray(t)?t:[t]).filter(s=>[3,1e4].includes(s.kind));for(const s of e){const o=s.created_at;if(o>Math.floor(Date.now()/1e3)+10*60){console.debug("event.created_at more than 10 minutes in the future",s);continue}const i=this.id(s.pubkey);s.kind===3?this.handleFollowList(s,i,o):s.kind===1e4&&this.handleMuteList(s,i,o)}}handleFollowList(t,e,s){const o=this.followListCreatedAt.get(e);if(o&&s<=o)return;this.followListCreatedAt.set(e,s);const i=new Set;for(const n of t.tags)if(n[0]==="p"){if(!a.test(n[1]))continue;const h=this.id(n[1]);h!==e&&i.add(h)}const r=this.followedByUser.get(e)||new Set;for(const n of r)i.has(n)||this.privateRemoveFollower(n,e);for(const n of i)this.privateAddFollower(n,e)}handleMuteList(t,e,s){var n,h,u,w;const o=this.muteListCreatedAt.get(e);if(o&&s<=o)return;this.muteListCreatedAt.set(e,s);const i=new Set;for(const l of t.tags)if(l[0]==="p"){if(!a.test(l[1]))continue;const y=this.id(l[1]);y!==e&&i.add(y)}const r=this.mutedByUser.get(e)||new Set;for(const l of r)i.has(l)||((n=this.mutedByUser.get(e))==null||n.delete(l),(h=this.userMutedBy.get(l))==null||h.delete(e));for(const l of i)this.mutedByUser.has(e)||this.mutedByUser.set(e,new Set),(u=this.mutedByUser.get(e))==null||u.add(l),this.userMutedBy.has(l)||this.userMutedBy.set(l,new Set),(w=this.userMutedBy.get(l))==null||w.add(e)}isFollowing(t,e){var i;const s=this.id(e),o=this.id(t);return!!((i=this.followedByUser.get(o))!=null&&i.has(s))}getFollowDistance(t){const e=this.followDistanceByUser.get(this.id(t));return e===void 0?1e3:e}addUserByFollowDistance(t,e){var s,o;this.usersByFollowDistance.has(t)||this.usersByFollowDistance.set(t,new Set),(s=this.usersByFollowDistance.get(t))==null||s.add(e);for(const i of this.usersByFollowDistance.keys())i>t&&((o=this.usersByFollowDistance.get(i))==null||o.delete(e))}privateAddFollower(t,e){var s,o;if(typeof t!="number"||typeof e!="number")throw new Error("Invalid user id");if(this.followersByUser.has(t)||this.followersByUser.set(t,new Set),(s=this.followersByUser.get(t))==null||s.add(e),this.followedByUser.has(e)||this.followedByUser.set(e,new Set),t!==this.root){let i;if(e===this.root)i=1,this.addUserByFollowDistance(i,t),this.followDistanceByUser.set(t,i);else{const r=this.followDistanceByUser.get(t),n=this.followDistanceByUser.get(e);i=n&&n+1,(r===void 0||i&&i<r)&&(this.followDistanceByUser.set(t,i),this.addUserByFollowDistance(i,t))}}(o=this.followedByUser.get(e))==null||o.add(t)}addFollower(t,e){this.privateAddFollower(this.id(e),this.id(t))}removeFollower(t,e){this.privateRemoveFollower(this.id(e),this.id(t))}privateRemoveFollower(t,e){var o,i;if((o=this.followersByUser.get(t))==null||o.delete(e),(i=this.followedByUser.get(e))==null||i.delete(t),t===this.root)return;let s=1/0;for(const r of this.followersByUser.get(t)||[]){const n=this.followDistanceByUser.get(r);n!==void 0&&n+1<s&&(s=n+1)}s===1/0?this.followDistanceByUser.delete(t):this.followDistanceByUser.set(t,s)}followerCount(t){var s;const e=this.id(t);return((s=this.followersByUser.get(e))==null?void 0:s.size)??0}followedByFriendsCount(t){var o;let e=0;const s=this.id(t);for(const i of this.followersByUser.get(s)??[])(o=this.followedByUser.get(this.root))!=null&&o.has(i)&&e++;return e}size(){let t=0,e=0;const s={};for(const o of this.followedByUser.values())t+=o.size;for(const o of this.mutedByUser.values())e+=o.size;for(const[o,i]of this.usersByFollowDistance.entries())s[o]=i.size;return{users:this.followDistanceByUser.size,follows:t,mutes:e,sizeByDistance:s}}followedByFriends(t){var o;const e=this.id(t),s=new Set;for(const i of this.followersByUser.get(e)??[])(o=this.followedByUser.get(this.root))!=null&&o.has(i)&&s.add(this.str(i));return s}getFollowedByUser(t,e=!1){const s=this.id(t),o=new Set;for(const i of this.followedByUser.get(s)||[])o.add(this.str(i));return e&&o.add(t),o}getFollowersByUser(t){const e=this.id(t),s=new Set;for(const o of this.followersByUser.get(e)||[])s.add(this.str(o));return s}serialize(t){const e=[],s=[];for(const[o,i]of this.followedByUser){const r=this.followListCreatedAt.get(o);if(!r)continue;if(e.push([o,[...i.values()],r]),t&&e.length>=t)return{followLists:e,uniqueIds:this.ids.serialize()};const n=this.muteListCreatedAt.get(o),h=this.mutedByUser.get(o);n&&h&&s.push([o,[...h.values()],n])}return{followLists:e,uniqueIds:this.ids.serialize(),muteLists:s}}deserialize(t,e){var o;const s=(o=t[0])==null?void 0:o[0];for(const[i,r,n]of t){for(const h of r)this.privateAddFollower(h,i);this.followListCreatedAt.set(i,n??0)}if(e)for(const[i,r,n]of e)this.mutedByUser.set(i,new Set(r)),this.muteListCreatedAt.set(i,n??0);s!==this.root&&this.recalculateFollowDistances()}getUsersByFollowDistance(t){const e=this.usersByFollowDistance.get(t)||new Set,s=new Set;for(const o of e)s.add(this.str(o));return s}getFollowListCreatedAt(t){return this.followListCreatedAt.get(this.id(t))}merge(t){console.log("size before merge",this.size()),console.time("merge graph");for(const e of t)this.mergeUserLists(e,this.followListCreatedAt,t.followListCreatedAt,this.followedByUser,t.followedByUser),this.mergeUserLists(e,this.muteListCreatedAt,t.muteListCreatedAt,this.mutedByUser,t.mutedByUser);this.recalculateFollowDistances(),console.timeEnd("merge graph"),console.log("size after merge",this.size())}mergeUserLists(t,e,s,o,i){const r=this.id(t),n=e.get(r),h=s.get(r);if(!n||h&&n<h){const u=i.get(r)||new Set,w=o.get(r)||new Set;for(const l of u)w.has(l)||(o.has(r)||o.set(r,new Set),o.get(r).add(l));for(const l of w)u.has(l)||o.get(r).delete(l);e.set(r,h??0)}}*userIterator(t){const e=Array.from(this.usersByFollowDistance.keys()).sort((s,o)=>s-o);for(const s of e){if(t!==void 0&&s>t)break;const o=this.usersByFollowDistance.get(s)||new Set;for(const i of o)yield this.str(i)}}[Symbol.iterator](){return this.userIterator()}getMutedByUser(t){const e=this.id(t),s=new Set;for(const o of this.mutedByUser.get(e)||[])s.add(this.str(o));return s}getUserMutedBy(t){const e=this.id(t),s=new Set;for(const o of this.userMutedBy.get(e)||[])s.add(this.str(o));return s}}c.SocialGraph=B,c.UniqueIds=d,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})}); | ||
(function(c,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(c=typeof globalThis<"u"?globalThis:c||self,h(c["nostr-social-graph"]={}))})(this,function(c){"use strict";var U=Object.defineProperty;var m=(c,h,a)=>h in c?U(c,h,{enumerable:!0,configurable:!0,writable:!0,value:a}):c[h]=a;var f=(c,h,a)=>m(c,typeof h!="symbol"?h+"":h,a);class h{constructor(t){f(this,"strToUniqueId",new Map);f(this,"uniqueIdToStr",new Map);f(this,"currentUniqueId",0);if(t)for(const[e,s]of t)this.strToUniqueId.set(e,s),this.uniqueIdToStr.set(s,e),this.currentUniqueId=Math.max(this.currentUniqueId,s+1)}id(t){const e=this.strToUniqueId.get(t);if(e!==void 0)return e;const s=this.currentUniqueId++;return this.strToUniqueId.set(t,s),this.uniqueIdToStr.set(s,t),s}str(t){const e=this.uniqueIdToStr.get(t);if(!e)throw new Error("pub: invalid id "+t);return e}has(t){return this.strToUniqueId.has(t)}serialize(){return Array.from(this.strToUniqueId.entries())}*[Symbol.iterator](){yield*this.uniqueIdToStr.entries()}}const a=/^[0-9a-fA-F]{64}$/;class B{constructor(t,e){f(this,"root");f(this,"followDistanceByUser",new Map);f(this,"usersByFollowDistance",new Map);f(this,"followedByUser",new Map);f(this,"followersByUser",new Map);f(this,"followListCreatedAt",new Map);f(this,"mutedByUser",new Map);f(this,"userMutedBy",new Map);f(this,"muteListCreatedAt",new Map);f(this,"ids",new h);this.ids=new h(e&&e.uniqueIds),this.root=this.id(t),this.followDistanceByUser.set(this.root,0),this.usersByFollowDistance.set(0,new Set([this.root])),e&&this.deserialize(e.followLists)}id(t){return this.ids.id(t)}str(t){return this.ids.str(t)}getRoot(){return this.str(this.root)}setRoot(t){const e=this.id(t);e!==this.root&&(this.root=e,this.recalculateFollowDistances())}recalculateFollowDistances(){this.followDistanceByUser.clear(),this.usersByFollowDistance.clear(),this.followDistanceByUser.set(this.root,0),this.usersByFollowDistance.set(0,new Set([this.root]));const t=[this.root];for(;t.length>0;){const e=t.shift(),s=this.followDistanceByUser.get(e),o=this.followedByUser.get(e)||new Set;for(const i of o)if(!this.followDistanceByUser.has(i)){const r=s+1;this.followDistanceByUser.set(i,r),this.usersByFollowDistance.has(r)||this.usersByFollowDistance.set(r,new Set),this.usersByFollowDistance.get(r).add(i),t.push(i)}}}handleEvent(t){const e=(Array.isArray(t)?t:[t]).filter(s=>[3,1e4].includes(s.kind));for(const s of e){const o=s.created_at;if(o>Math.floor(Date.now()/1e3)+10*60){console.debug("event.created_at more than 10 minutes in the future",s);continue}const i=this.id(s.pubkey);s.kind===3?this.handleFollowList(s,i,o):s.kind===1e4&&this.handleMuteList(s,i,o)}}handleFollowList(t,e,s){const o=this.followListCreatedAt.get(e);if(o&&s<=o)return;this.followListCreatedAt.set(e,s);const i=new Set;for(const n of t.tags)if(n[0]==="p"){if(!a.test(n[1]))continue;const d=this.id(n[1]);d!==e&&i.add(d)}const r=this.followedByUser.get(e)||new Set;for(const n of r)i.has(n)||this.privateRemoveFollower(n,e);for(const n of i)this.privateAddFollower(n,e)}handleMuteList(t,e,s){var n,d,u,w;const o=this.muteListCreatedAt.get(e);if(o&&s<=o)return;this.muteListCreatedAt.set(e,s);const i=new Set;for(const l of t.tags)if(l[0]==="p"){if(!a.test(l[1]))continue;const y=this.id(l[1]);y!==e&&i.add(y)}const r=this.mutedByUser.get(e)||new Set;for(const l of r)i.has(l)||((n=this.mutedByUser.get(e))==null||n.delete(l),(d=this.userMutedBy.get(l))==null||d.delete(e));for(const l of i)this.mutedByUser.has(e)||this.mutedByUser.set(e,new Set),(u=this.mutedByUser.get(e))==null||u.add(l),this.userMutedBy.has(l)||this.userMutedBy.set(l,new Set),(w=this.userMutedBy.get(l))==null||w.add(e)}isFollowing(t,e){var i;const s=this.id(e),o=this.id(t);return!!((i=this.followedByUser.get(o))!=null&&i.has(s))}getFollowDistance(t){const e=this.followDistanceByUser.get(this.id(t));return e===void 0?1e3:e}addUserByFollowDistance(t,e){var s,o;this.usersByFollowDistance.has(t)||this.usersByFollowDistance.set(t,new Set),(s=this.usersByFollowDistance.get(t))==null||s.add(e);for(const i of this.usersByFollowDistance.keys())i>t&&((o=this.usersByFollowDistance.get(i))==null||o.delete(e))}privateAddFollower(t,e){var s,o;if(typeof t!="number"||typeof e!="number")throw new Error("Invalid user id");if(this.followersByUser.has(t)||this.followersByUser.set(t,new Set),(s=this.followersByUser.get(t))==null||s.add(e),this.followedByUser.has(e)||this.followedByUser.set(e,new Set),t!==this.root){let i;if(e===this.root)i=1,this.addUserByFollowDistance(i,t),this.followDistanceByUser.set(t,i);else{const r=this.followDistanceByUser.get(t),n=this.followDistanceByUser.get(e);i=n&&n+1,(r===void 0||i&&i<r)&&(this.followDistanceByUser.set(t,i),this.addUserByFollowDistance(i,t))}}(o=this.followedByUser.get(e))==null||o.add(t)}addFollower(t,e){this.privateAddFollower(this.id(e),this.id(t))}removeFollower(t,e){this.privateRemoveFollower(this.id(e),this.id(t))}privateRemoveFollower(t,e){var o,i;if((o=this.followersByUser.get(t))==null||o.delete(e),(i=this.followedByUser.get(e))==null||i.delete(t),t===this.root)return;let s=1/0;for(const r of this.followersByUser.get(t)||[]){const n=this.followDistanceByUser.get(r);n!==void 0&&n+1<s&&(s=n+1)}s===1/0?this.followDistanceByUser.delete(t):this.followDistanceByUser.set(t,s)}followerCount(t){var s;const e=this.id(t);return((s=this.followersByUser.get(e))==null?void 0:s.size)??0}followedByFriendsCount(t){var o;let e=0;const s=this.id(t);for(const i of this.followersByUser.get(s)??[])(o=this.followedByUser.get(this.root))!=null&&o.has(i)&&e++;return e}size(){let t=0,e=0;const s={};for(const o of this.followedByUser.values())t+=o.size;for(const o of this.mutedByUser.values())e+=o.size;for(const[o,i]of this.usersByFollowDistance.entries())s[o]=i.size;return{users:this.followDistanceByUser.size,follows:t,mutes:e,sizeByDistance:s}}followedByFriends(t){var o;const e=this.id(t),s=new Set;for(const i of this.followersByUser.get(e)??[])(o=this.followedByUser.get(this.root))!=null&&o.has(i)&&s.add(this.str(i));return s}getFollowedByUser(t,e=!1){const s=this.id(t),o=new Set;for(const i of this.followedByUser.get(s)||[])o.add(this.str(i));return e&&o.add(t),o}getFollowersByUser(t){const e=this.id(t),s=new Set;for(const o of this.followersByUser.get(e)||[])s.add(this.str(o));return s}serialize(t){const e=[],s=[];for(const[o,i]of this.followedByUser){const r=this.followListCreatedAt.get(o);if(!r)continue;if(e.push([o,[...i.values()],r]),t&&e.length>=t)return{followLists:e,uniqueIds:this.ids.serialize()};const n=this.muteListCreatedAt.get(o),d=this.mutedByUser.get(o);n&&d&&s.push([o,[...d.values()],n])}return{followLists:e,uniqueIds:this.ids.serialize(),muteLists:s}}deserialize(t,e){var o,i;const s=(o=t[0])==null?void 0:o[0];for(const[r,n,d]of t){for(const u of n)this.privateAddFollower(u,r);this.followListCreatedAt.set(r,d??0)}if(e)for(const[r,n,d]of e){this.mutedByUser.set(r,new Set(n));for(const u of n)this.userMutedBy.has(u)||this.userMutedBy.set(u,new Set),(i=this.userMutedBy.get(u))==null||i.add(r);this.muteListCreatedAt.set(r,d??0)}s!==this.root&&this.recalculateFollowDistances()}getUsersByFollowDistance(t){const e=this.usersByFollowDistance.get(t)||new Set,s=new Set;for(const o of e)s.add(this.str(o));return s}getFollowListCreatedAt(t){return this.followListCreatedAt.get(this.id(t))}merge(t){console.log("size before merge",this.size()),console.time("merge graph");for(const e of t)this.mergeUserLists(e,this.followListCreatedAt,t.followListCreatedAt,this.followedByUser,t.followedByUser),this.mergeUserLists(e,this.muteListCreatedAt,t.muteListCreatedAt,this.mutedByUser,t.mutedByUser);this.recalculateFollowDistances(),console.timeEnd("merge graph"),console.log("size after merge",this.size())}mergeUserLists(t,e,s,o,i){const r=this.id(t),n=e.get(r),d=s.get(r);if(!n||d&&n<d){const u=i.get(r)||new Set,w=o.get(r)||new Set;for(const l of u)w.has(l)||(o.has(r)||o.set(r,new Set),o.get(r).add(l));for(const l of w)u.has(l)||o.get(r).delete(l);e.set(r,d??0)}}*userIterator(t){const e=Array.from(this.usersByFollowDistance.keys()).sort((s,o)=>s-o);for(const s of e){if(t!==void 0&&s>t)break;const o=this.usersByFollowDistance.get(s)||new Set;for(const i of o)yield this.str(i)}}[Symbol.iterator](){return this.userIterator()}getMutedByUser(t){const e=this.id(t),s=new Set;for(const o of this.mutedByUser.get(e)||[])s.add(this.str(o));return s}getUserMutedBy(t){const e=this.id(t),s=new Set;for(const o of this.userMutedBy.get(e)||[])s.add(this.str(o));return s}}c.SocialGraph=B,c.UniqueIds=h,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})}); |
{ | ||
"name": "nostr-social-graph", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "packageManager": "yarn@1.22.22", |
@@ -371,2 +371,8 @@ import { SerializedUniqueIds, UniqueIds } from './UniqueIds'; | ||
this.mutedByUser.set(muter, new Set(mutedUsers)) | ||
for (const mutedUser of mutedUsers) { | ||
if (!this.userMutedBy.has(mutedUser)) { | ||
this.userMutedBy.set(mutedUser, new Set()) | ||
} | ||
this.userMutedBy.get(mutedUser)?.add(muter) | ||
} | ||
this.muteListCreatedAt.set(muter, createdAt ?? 0) | ||
@@ -373,0 +379,0 @@ } |
Sorry, the diff of this file is not supported yet
7896324
924