projects
/
squeep-authentication-module
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update devDependencies, fix lint issues
[squeep-authentication-module]
/
lib
/
common.js
diff --git
a/lib/common.js
b/lib/common.js
index 1c19aeb9dbde3172858ee3dcea9a00ceb1a8004e..120c87045613e008988ed39f3db651aa09e2544c 100644
(file)
--- a/
lib/common.js
+++ b/
lib/common.js
@@
-5,8
+5,8
@@
const { common } = require('@squeep/api-dingus');
/**
* Recursively freeze an object.
/**
* Recursively freeze an object.
- * @param {
Object} o
- * @returns {
Object}
+ * @param {
object} o object to freeze
+ * @returns {
object} frozen object
*/
const freezeDeep = (o) => {
Object.freeze(o);
*/
const freezeDeep = (o) => {
Object.freeze(o);
@@
-22,9
+22,9
@@
const freezeDeep = (o) => {
/**
* Return a new object duplicating `o`, without the properties specified.
/**
* Return a new object duplicating `o`, without the properties specified.
- * @param {
Object} o
- * @param {
String[]} props
- * @returns {
Object}
+ * @param {
object} o source object
+ * @param {
string[]} props list of property names to omit
+ * @returns {
object} pruned object
*/
const omit = (o, props) => {
return Object.fromEntries(Object.entries(o).filter(([k]) => !props.includes(k)));
*/
const omit = (o, props) => {
return Object.fromEntries(Object.entries(o).filter(([k]) => !props.includes(k)));
@@
-32,9
+32,10
@@
const omit = (o, props) => {
/**
* Helper to log mystery-box statistics.
/**
* Helper to log mystery-box statistics.
- * @param {ConsoleLike} logger
- * @param {String} scope
- * @returns {Function}
+ * @param {object} logger logger
+ * @param {Function} logger.debug log debug
+ * @param {string} scope scope
+ * @returns {Function} stats log decorator
*/
const mysteryBoxLogger = (logger, scope) => {
return (s) => {
*/
const mysteryBoxLogger = (logger, scope) => {
return (s) => {
@@
-48,8
+49,8
@@
const mysteryBoxLogger = (logger, scope) => {
/**
* Hide sensitive part of an Authorization header.
/**
* Hide sensitive part of an Authorization header.
- * @param {
String} authHeader
- * @returns {
String}
+ * @param {
string} authHeader header value
+ * @returns {
string} scrubbed header value
*/
const obscureAuthorizationHeader = (authHeader) => {
if (!authHeader) {
*/
const obscureAuthorizationHeader = (authHeader) => {
if (!authHeader) {
@@
-65,4
+66,4
@@
module.exports = Object.assign(Object.create(common), {
mysteryBoxLogger,
obscureAuthorizationHeader,
omit,
mysteryBoxLogger,
obscureAuthorizationHeader,
omit,
-});
\ No newline at end of file
+});