Skip to content

Commit 00a4aad

Browse files
docs(index): improve JSDoc in index.d.ts and index.js
1 parent 230de70 commit 00a4aad

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

index.d.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ export interface HTMLReactParserOptions {
1515
}
1616

1717
/**
18-
* Convert HTML string to React elements.
18+
* Converts HTML string to React elements.
1919
*
20-
* @param - Raw string of HTML to parse.
21-
* @param options - Options to use when converting to react.
22-
* @returns ReactElement on successful parse or string when `html` cannot be
23-
* parsed as HTML
20+
* @param html - The HTML string to parse to React.
21+
* @param options - The parser options.
22+
* @return - When parsed with HTML string, returns React elements; otherwise, returns string or empty array.
2423
*/
2524
declare function HTMLReactParser(
2625
html: string,

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ var htmlToDOM = require('html-dom-parser');
55
var domParserOptions = { decodeEntities: true, lowerCaseAttributeNames: false };
66

77
/**
8-
* Convert HTML string to React elements.
8+
* Converts HTML string to React elements.
99
*
10-
* @param {String} html - The HTML string.
11-
* @param {Object} [options] - The additional options.
10+
* @param {String} html - The HTML string to parse to React.
11+
* @param {Object} [options] - The parser options.
1212
* @param {Function} [options.replace] - The replace method.
13-
* @return {ReactElement|Array}
13+
* @return {ReactElement|Array|String} - When parsed with HTML string, returns React elements; otherwise, returns string or empty array.
1414
*/
1515
function HTMLReactParser(html, options) {
1616
if (typeof html !== 'string') {

0 commit comments

Comments
 (0)