We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c6ac66 commit 1c101d5Copy full SHA for 1c101d5
dom.js
@@ -1,9 +1,10 @@
1
import { dashToCamelCase } from './strings.js'
2
3
// Rely on the new moveBefore method to move nodes if it's available https://developer.mozilla.org/en-US/docs/Web/API/Element/moveBefore
4
-const MOVE_BEFORE_METHOD = Element?.prototype?.moveBefore
5
- ? 'moveBefore'
6
- : 'insertBefore'
+const MOVE_BEFORE_METHOD =
+ typeof Element !== 'undefined' && Element.prototype.moveBefore
+ ? 'moveBefore'
7
+ : 'insertBefore'
8
9
/**
10
* Get all the element attributes as object
0 commit comments