Skip to content

Commit a2efc4f

Browse files
Merge pull request #1008 from ssi02014/refac/utilities
refactor(utilities): adding a jsdoc and reverting an existing jsdoc location
2 parents 2a5c2f0 + 24e147e commit a2efc4f

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

lib/utilities.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ function invertObject(obj, override) {
3636
return result;
3737
}
3838

39-
/**
40-
* Check if a given tag is a custom component.
41-
*
42-
* @see {@link https://github.com/facebook/react/blob/v16.6.3/packages/react-dom/src/shared/isCustomComponent.js}
43-
*
44-
* @param {string} tagName - The name of the html tag.
45-
* @param {object} props - The props being passed to the element.
46-
* @returns - Whether tag is custom component.
47-
*/
48-
4939
var RESERVED_SVG_MATHML_ELEMENTS = new Set([
5040
'annotation-xml',
5141
'color-profile',
@@ -57,6 +47,15 @@ var RESERVED_SVG_MATHML_ELEMENTS = new Set([
5747
'missing-glyph'
5848
]);
5949

50+
/**
51+
* Check if a given tag is a custom component.
52+
*
53+
* @see {@link https://github.com/facebook/react/blob/v16.6.3/packages/react-dom/src/shared/isCustomComponent.js}
54+
*
55+
* @param {string} tagName - The name of the html tag.
56+
* @param {object} props - The props being passed to the element.
57+
* @returns {boolean} - Whether tag is custom component.
58+
*/
6059
function isCustomComponent(tagName, props) {
6160
if (tagName.indexOf('-') === -1) {
6261
return props && typeof props.is === 'string';
@@ -121,6 +120,12 @@ function canTextBeChildOfNode(node) {
121120
return !ELEMENTS_WITH_NO_TEXT_CHILDREN.has(node.name);
122121
}
123122

123+
/**
124+
* Returns the first argument as is.
125+
*
126+
* @param {any} arg - The argument to be returned.
127+
* @returns {any} The input argument `arg`.
128+
*/
124129
function returnFirstArg(arg) {
125130
return arg;
126131
}

0 commit comments

Comments
 (0)