From 7a52ddeba2a68388b544f529d2d92104420f77b0 Mon Sep 17 00:00:00 2001 From: Shipwreckt Date: Fri, 31 Oct 2025 20:02:14 +0000 Subject: Changed from static to 11ty! --- node_modules/http-equiv-refresh/index.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 node_modules/http-equiv-refresh/index.js (limited to 'node_modules/http-equiv-refresh/index.js') diff --git a/node_modules/http-equiv-refresh/index.js b/node_modules/http-equiv-refresh/index.js new file mode 100644 index 0000000..47f3f94 --- /dev/null +++ b/node_modules/http-equiv-refresh/index.js @@ -0,0 +1,24 @@ +const PATTERN = /^\s*(\d+)(?:\s*;(?:\s*url\s*=)?\s*(?:["']\s*(.*?)\s*['"]|(.*?)))?\s*$/i; + + + +export default content => +{ + content = PATTERN.exec(content); + + let timeout, url; + + if (content !== null) + { + timeout = parseInt(content[1], 10); + + url = content[2] || content[3] || null; // first matching group + } + else + { + timeout = null; + url = null; + } + + return { timeout, url }; +}; -- cgit v1.2.3