question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: maskValuesOfKeys option mutates object properties!

See original GitHub issue

To Reproduce

import { Logger } from "tslog";

const logger = new Logger();

const password = "123";
const someObj = {
    password: "123"
};

logger.info(someObj);
logger.info(password);

console.log(password === "123"); // true
console.log(someObj.password === "123"); // false

Additional context v2.11.1

Node.js Version v14.15.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
deman4ikcommented, Nov 24, 2020

@deman4ik Can you please let me know if it wors as expected? Thank you.

Yes it works! Thank you.

1reaction
terehovcommented, Nov 23, 2020

Oh, I think I got your problem. I’m in the middle of a bigger release anyway, going to fix it as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mutating Objects: What Can Go Wrong? - commercetools tech
We all know that mutating objects can lead to unwanted side effects, and can introduce hard to trace bugs, and make code hard...
Read more >
Why Mutation Can Be Scary - A List Apart
To mutate means to change in form or nature. Something that's mutable can be changed, while something that's immutable cannot be changed.
Read more >
Washing your code: avoid mutation - Artem Sapegin
Here we're mutating the original puppy object by changing its age property. Mutations are often problematic. Consider this function:.
Read more >
How to Avoid Object Mutation in JavaScript | by Jake Mills
Three Quick Ways to Avoid Mutating Objects in JavaScript ... to use this method to copy all the properties from one object to...
Read more >
tslog - Extensible TypeScript Logger for Node.js and Browser ...
Extensible TypeScript Logger for Node.js and Browser: Dependency free, Fully customizable, Pretty errors, stack traces, and JSON output to attachable ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found