Skip to content

Commit

Permalink
fix: ensure undefined values are filtered from id
Browse files Browse the repository at this point in the history
  • Loading branch information
thebuilder committed Nov 3, 2020
1 parent 794fe0c commit 9312d1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/observers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

1 comment on commit 9312d1d

@vercel
Copy link

@vercel vercel bot commented on 9312d1d Nov 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.