Skip to content

Commit 91cf636

Browse files
committed
fix: non strict comparison
1 parent 1af8d1e commit 91cf636

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/blockCache/sqlite.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe("createSqliteBlockCache", () => {
2323
await expect(blockCache.init()).resolves.not.toThrow();
2424
});
2525

26-
it("should initialize if using invalid table name", async () => {
26+
it("should initialize if using invalid table name", () => {
2727
expect(() => {
2828
createSqliteBlockCache({
2929
db,

src/blockCache/sqlite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface Row {
1919
export function createSqliteBlockCache(opts: Options): BlockCache {
2020
let db: Sqlite.Database | null = null;
2121

22-
if (opts.tableName != null && opts.tableName.match(/[^a-zA-Z0-9_]/)) {
22+
if (opts.tableName !== undefined && opts.tableName.match(/[^a-zA-Z0-9_]/)) {
2323
throw new Error(
2424
`Table name ${opts.tableName} contains invalid characters. Only alphanumeric and underscore characters are allowed.`
2525
);

0 commit comments

Comments
 (0)