bump package version to 3.0.3
[squeep-logger-json-console] / lib / json-replacers.js
index 14ac3343ac348e7803eeac458b8386a1a18f266b..0ccea720bd7e77ff7ca8702fa74e2cecb2a941e8 100644 (file)
@@ -8,9 +8,9 @@ const http = require('node:http');
 
 /**
  * Convert any Error to a plain Object.
- * @param {String} _key
- * @param {*} value
- * @returns {Object}
+ * @param {string} _key key, unused
+ * @param {*} value value to possibly replace
+ * @returns {object} value or replaced value
  */
 function replacerError(_key, value) {
   if (value instanceof Error) {
@@ -24,9 +24,9 @@ function replacerError(_key, value) {
 
 /**
  * Convert any BigInt type to a String.
- * @param {String} _key
- * @param {*} value
- * @returns {String}
+ * @param {string} _key key, unused
+ * @param {*} value value to possibly replace
+ * @returns {string} value or replaced value
  */
 function replacerBigInt(_key, value) {
   if (typeof value === 'bigint') {
@@ -41,9 +41,9 @@ function replacerBigInt(_key, value) {
  * Also sanitizes any Authorization header.  We do this here rather than
  * in sanitization stage so that we do not have to rely on a set path to
  * this object.
- * @param {String} _key
- * @param {*} value
- * @returns {Object}
+ * @param {string} _key key, unused
+ * @param {*} value value to possibly replace
+ * @returns {object} value or replaved value
  */
 function replacerHttpIncomingMessage(_key, value) {
   if (value instanceof http.IncomingMessage) {
@@ -75,9 +75,9 @@ function replacerHttpIncomingMessage(_key, value) {
 
 /**
  * Convert any ServerResponse or OutgoingMessage to a subset Object.
- * @param {String} _key
- * @param {*} value
- * @returns {Object}
+ * @param {string} _key key, unused
+ * @param {*} value value to possibly replace
+ * @returns {object} value or replaced value
  */
 function replacerHttpServerResponse(_key, value) {
   if (value instanceof http.OutgoingMessage || value instanceof http.ServerResponse) {