From 48fbe59cab1f966cc8de6dad58fb3f2a85d3ac1c Mon Sep 17 00:00:00 2001 From: dskvr Date: Fri, 13 Sep 2024 06:16:52 +0200 Subject: [PATCH] check that fn is fn before functioning --- package.json | 2 +- src/classes/Trawler.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d551da1..6f617ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nostrwatch/nostrawl", - "version": "0.0.3", + "version": "0.0.4", "description": "A nostr library for continously retrieving events from nostr relays based on a set of filters.", "main": "src/index.js", "license": "MIT", diff --git a/src/classes/Trawler.js b/src/classes/Trawler.js index 5e6aaeb..b0957ab 100644 --- a/src/classes/Trawler.js +++ b/src/classes/Trawler.js @@ -79,8 +79,8 @@ class NTTrawler { path: this.options.cache.path, compression: true }); - this?.options?.after_cacheOpen(this.cache) - //console.log('cache opened') + if(this?.options && this.options instanceof Function) + this?.options?.after_cacheOpen(this.cache) } async trawl(chunk, $job){