-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dom: Add types to miscellaneous files (#30774)
- Loading branch information
1 parent
6eeb0dd
commit dd4cc1b
Showing
7 changed files
with
30 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { assertIsDefined } from '../utils/assert-is-defined'; | ||
|
||
/** | ||
* Wraps the given node with a new node with the given tag name. | ||
* | ||
* @param {Element} newNode The node to insert. | ||
* @param {Element} referenceNode The node to wrap. | ||
*/ | ||
export default function wrap( newNode, referenceNode ) { | ||
assertIsDefined( referenceNode.parentNode, 'referenceNode.parentNode' ); | ||
referenceNode.parentNode.insertBefore( newNode, referenceNode ); | ||
newNode.appendChild( referenceNode ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters