Skip to content

Commit

Permalink
refactor: add example in jsdoc
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
chessurisme and coderabbitai[bot] authored Jul 31, 2024
1 parent c08d9b9 commit 91c6461
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utilities/sanitize-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
* @param {string} type - The expected type of the `value`. Should be a string representing the type (e.g., "boolean", "string", "array", "object", "number", "HTMLElement", "bigint", "symbol", "function", or "null").
*
* @returns {*} The original `value` if all validations pass; otherwise, `null`.
*
* @example
* sanitizeValue('test', 'string') // returns 'test'
* sanitizeValue(123, 'number') // returns 123
* sanitizeValue(null, 'string') // returns null
*/
function sanitizeValue(value, type) {
let flag = false
Expand Down

0 comments on commit 91c6461

Please sign in to comment.