Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DABH committed Jul 10, 2023
1 parent 6127ba8 commit 68aa928
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 111 deletions.
12 changes: 6 additions & 6 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const ObjectID = require('mongodb').ObjectID;
/**
* Prepares metadata to store into database.
* @param {*} meta Metadata
* @return {*}
* @returns {*}
*/
exports.prepareMetaData = meta=>{
exports.prepareMetaData = meta => {
return cloneMeta(meta);
};

Expand All @@ -35,18 +35,18 @@ function cloneMeta(node, opt_parents) {
return new Date(node.getTime());
} else if (node instanceof Error) {
// This is needed because Error's message, name and stack isn't accessible when cycling through properties
copy = {message: node.message, name: node.name, stack: node.stack};
copy = { message: node.message, name: node.name, stack: node.stack };
}
opt_parents = opt_parents || [];
opt_parents.push(node);
for (let key in node) {
for (const key in node) {
if (!Object.prototype.hasOwnProperty.call(node, key)) {
continue;
}
let value = node[key];
const value = node[key];
let newKey = key;
if (newKey.includes('.') || newKey.includes('$')) {
newKey = newKey.replace(/\./g, '[dot]').replace(/\$/g, '[$]');
newKey = newKey.replace(/\./g, '[dot]').replace(/\$/g, '[$]');
}
if (value instanceof Object) {
if (opt_parents.indexOf(value) === -1) {
Expand Down
Loading

0 comments on commit 68aa928

Please sign in to comment.