Skip to content

Commit

Permalink
docs(index): improve JSDoc in index.d.ts and index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Jul 9, 2019
1 parent 230de70 commit 00a4aad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 4 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ export interface HTMLReactParserOptions {
}

/**
* Convert HTML string to React elements.
* Converts HTML string to React elements.
*
* @param - Raw string of HTML to parse.
* @param options - Options to use when converting to react.
* @returns ReactElement on successful parse or string when `html` cannot be
* parsed as HTML
* @param html - The HTML string to parse to React.
* @param options - The parser options.
* @return - When parsed with HTML string, returns React elements; otherwise, returns string or empty array.
*/
declare function HTMLReactParser(
html: string,
Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ var htmlToDOM = require('html-dom-parser');
var domParserOptions = { decodeEntities: true, lowerCaseAttributeNames: false };

/**
* Convert HTML string to React elements.
* Converts HTML string to React elements.
*
* @param {String} html - The HTML string.
* @param {Object} [options] - The additional options.
* @param {String} html - The HTML string to parse to React.
* @param {Object} [options] - The parser options.
* @param {Function} [options.replace] - The replace method.
* @return {ReactElement|Array}
* @return {ReactElement|Array|String} - When parsed with HTML string, returns React elements; otherwise, returns string or empty array.
*/
function HTMLReactParser(html, options) {
if (typeof html !== 'string') {
Expand Down

0 comments on commit 00a4aad

Please sign in to comment.