From 6d2436e0fe55f0ce5d77f48ef1db69750e361458 Mon Sep 17 00:00:00 2001 From: Ronnie Date: Mon, 9 Sep 2024 14:36:48 +0200 Subject: [PATCH] Also check for persistTags string length --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 3900249..27dcb42 100755 --- a/src/index.ts +++ b/src/index.ts @@ -72,7 +72,7 @@ export default class SwupHeadPlugin extends Plugin { if (typeof persistTags === 'function') { return persistTags(el); } - if (typeof persistTags === 'string') { + if (typeof persistTags === 'string' && persistTags.length > 0) { return el.matches(persistTags); } return Boolean(persistTags);