1
+ var domhandler = require ( 'domhandler' ) ;
1
2
var constants = require ( './constants' ) ;
2
- var domhandler = require ( 'domhandler/lib/node' ) ;
3
3
4
4
var CASE_SENSITIVE_TAG_NAMES = constants . CASE_SENSITIVE_TAG_NAMES ;
5
5
@@ -19,8 +19,8 @@ for (var i = 0, len = CASE_SENSITIVE_TAG_NAMES.length; i < len; i++) {
19
19
/**
20
20
* Gets case-sensitive tag name.
21
21
*
22
- * @param {string } tagName - Tag name in lowercase.
23
- * @return {string|undefined } - Case-sensitive tag name.
22
+ * @param {string } tagName - Tag name in lowercase.
23
+ * @returns {string|undefined } - Case-sensitive tag name.
24
24
*/
25
25
function getCaseSensitiveTagName ( tagName ) {
26
26
return caseSensitiveTagNamesMap [ tagName ] ;
@@ -29,8 +29,8 @@ function getCaseSensitiveTagName(tagName) {
29
29
/**
30
30
* Formats DOM attributes to a hash map.
31
31
*
32
- * @param {NamedNodeMap } attributes - List of attributes.
33
- * @return {object } - Map of attribute name to value.
32
+ * @param {NamedNodeMap } attributes - List of attributes.
33
+ * @returns {object } - Map of attribute name to value.
34
34
*/
35
35
function formatAttributes ( attributes ) {
36
36
var result = { } ;
@@ -47,8 +47,8 @@ function formatAttributes(attributes) {
47
47
* Corrects the tag name if it is case-sensitive (SVG).
48
48
* Otherwise, returns the lowercase tag name (HTML).
49
49
*
50
- * @param {string } tagName - Lowercase tag name.
51
- * @return {string } - Formatted tag name.
50
+ * @param {string } tagName - Lowercase tag name.
51
+ * @returns {string } - Formatted tag name.
52
52
*/
53
53
function formatTagName ( tagName ) {
54
54
tagName = tagName . toLowerCase ( ) ;
@@ -62,10 +62,10 @@ function formatTagName(tagName) {
62
62
/**
63
63
* Transforms DOM nodes to `domhandler` nodes.
64
64
*
65
- * @param {NodeList } nodes - DOM nodes.
66
- * @param {Element|null } [parent=null] - Parent node.
67
- * @param {string } [directive] - Directive.
68
- * @return {Array<Comment|Element|ProcessingInstruction|Text> }
65
+ * @param {NodeList } nodes - DOM nodes.
66
+ * @param {Element|null } [parent=null] - Parent node.
67
+ * @param {string } [directive] - Directive.
68
+ * @returns {Array<Comment|Element|ProcessingInstruction|Text> }
69
69
*/
70
70
function formatDOM ( nodes , parent , directive ) {
71
71
parent = parent || null ;
@@ -129,7 +129,5 @@ function formatDOM(nodes, parent, directive) {
129
129
return result ;
130
130
}
131
131
132
- module . exports = {
133
- formatAttributes : formatAttributes ,
134
- formatDOM : formatDOM
135
- } ;
132
+ exports . formatAttributes = formatAttributes ;
133
+ exports . formatDOM = formatDOM ;
0 commit comments