From 9312d1d8b0c20e226dc31d0878c9dfca75ed5737 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Tue, 3 Nov 2020 10:31:13 +0100 Subject: [PATCH] fix: ensure undefined values are filtered from id --- src/observers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/observers.ts b/src/observers.ts index f38fe49f..2a297e2b 100644 --- a/src/observers.ts +++ b/src/observers.ts @@ -32,8 +32,8 @@ function getRootId(root?: Element | null) { */ export function optionsToId(options: IntersectionObserverInit) { return Object.keys(options) - .filter(Boolean) .sort() + .filter((key) => options[key] !== undefined) .map((key) => { return `${key}_${ key === 'root' ? getRootId(options.root) : options[key]