HEX
Server: nginx/1.24.0
System: Linux nowruzgan 6.8.0-57-generic #59-Ubuntu SMP PREEMPT_DYNAMIC Sat Mar 15 17:40:59 UTC 2025 x86_64
User: babak (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/dev/nowruzgan/rest/node_modules/rttc/lib/dehydrate.js
/**
 * Module dependencies
 */

var rebuildSanitized = require('./helpers/sanitize');


/**
 * Dehydrate/sanitize a value recursively:
 *   • stringifying functions, dates, regexps, and errors, as well
 *   • taking care of circular references
 *   • normalizing -Infinity, Infinity, and NaN (to 0)
 *   • stripping undefined (and potentially null) keys and values. If `allowNull` is set, `null` values will not be stripped from the encoded string.
 *
 * @param  {===} value
 * @param  {Boolean} allowNull  [defaults to false]
 * @param  {Boolean} dontStringifyFunctions  [defaults to false]
 * @return {String}
 */
module.exports = function dehydrate (value, allowNull, dontStringifyFunctions) {
  return rebuildSanitized(value, allowNull, dontStringifyFunctions);
};