summaryrefslogtreecommitdiff
path: root/src/db.js
diff options
context:
space:
mode:
authorJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2024-03-07 21:44:48 +0000
committerJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2024-03-07 21:44:48 +0000
commit5c0d0697feea60601c9b8c4e624c526a451f872f (patch)
treedb8d4cf2c30d3f8f6da1f42e2d1e2746994befe8 /src/db.js
parent9f44e87b092e9149c47466e4578f794fe4376524 (diff)
More stuff
Diffstat (limited to 'src/db.js')
-rw-r--r--src/db.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/db.js b/src/db.js
index 145b144..95a9917 100644
--- a/src/db.js
+++ b/src/db.js
@@ -16,7 +16,7 @@ export function subscribe(number, name) {
* @param {string} number
*/
export function isSubscribed(number) {
- return subscriptions.some(s => s.number == number);
+ return subscriptions.some(s => s.number === number);
}
export function getSubscriptions() {
@@ -26,4 +26,11 @@ export function getSubscriptions() {
clone.push({ ...subscription });
}
return clone;
+}
+
+/**
+ * @param {string} number
+ */
+export function getSubscriptionFromNumber(number) {
+ return subscriptions.find(sub => sub.number === number);
} \ No newline at end of file