diff --git a/package-lock.json b/package-lock.json index 27ffa0e..82550e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3283,7 +3283,7 @@ "license": "MIT", "dependencies": { "@welshman/lib": "0.0.12", - "@welshman/net": "0.0.15", + "@welshman/net": "0.0.16", "@welshman/util": "0.0.23", "nostr-tools": "^2.7.0" }, @@ -3332,7 +3332,7 @@ }, "packages/net": { "name": "@welshman/net", - "version": "0.0.15", + "version": "0.0.16", "license": "MIT", "dependencies": { "@welshman/lib": "0.0.12", diff --git a/packages/dvm/package.json b/packages/dvm/package.json index a8fd92d..fb64ea8 100644 --- a/packages/dvm/package.json +++ b/packages/dvm/package.json @@ -32,7 +32,7 @@ }, "dependencies": { "@welshman/lib": "0.0.12", - "@welshman/net": "0.0.15", + "@welshman/net": "0.0.16", "@welshman/util": "0.0.23", "nostr-tools": "^2.7.0" } diff --git a/packages/lib/src/Tools.ts b/packages/lib/src/Tools.ts index 135b108..1966168 100644 --- a/packages/lib/src/Tools.ts +++ b/packages/lib/src/Tools.ts @@ -350,6 +350,9 @@ export const pushToMapKey = (m: Map, k: K, v: T) => { m.set(k, a) } +export const switcher = (k: string, m: Record) => + m[k] === undefined ? m.default : m[k] + // Random obscure stuff export const hexToBech32 = (prefix: string, url: string) => diff --git a/packages/net/package.json b/packages/net/package.json index e974b2a..e43242b 100644 --- a/packages/net/package.json +++ b/packages/net/package.json @@ -1,6 +1,6 @@ { "name": "@welshman/net", - "version": "0.0.15", + "version": "0.0.16", "author": "hodlbod", "license": "MIT", "description": "Utilities for connecting with nostr relays.",