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.

Add option to decide behavior

See original GitHub issue

You can throw anything in JS, but it’s a bad practice. I’d like to have it fail rather than silently accept anything. Though, it’s not a good default, so should be opt-in.

Actually, there’s 3 possible behaviors:

  1. Always return an object. (wanted default)
  2. Passthrough non-object values. (current default)
  3. Throw on non-object input.

I’d like 1 to be the default behavior, for consistency, but add an option to be able to opt into 2 (which is the current behavior) or 3 (which would be the strict behavior). This should be a single option.

Another benefit of 1 is that the TypeScript types can be better. We can guarantee it’s an object and we can also guarantee that the name, message, and stack properties exist.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jcald1commented, Mar 17, 2020

@semmel , you can install util in package.json for the browser.

1reaction
semmelcommented, Sep 23, 2019

Requiring the Node.js built-in util package for util.inspect means that serialize-error no longer works in a browser?

Otherwise I would be polite to add a build step to generate some distribution files for the browser using a util shim?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Provide Choices, Improve Behavior: Sometimes Intervention ...
Explore what makes choice making so beneficial for student behavior and development with how-to guidance, video examples, and a free choice ...
Read more >
IEP Process: Special Considerations and Behavior
You will need to add a behavioral goal if behaviors are Tier 2, including Specially Designed Instruction. Option 2: A Functional Behavior ......
Read more >
Choice Making
Instructors and parents can use various options of choice to encourage individual performance. For example, if a student has a chance to choose...
Read more >
Behavior Intervention Plan (BIP): The Complete Guide to ...
A BIP is a blueprint for changing behavior. In a formal setting, it guides treatment and ensures that everyone responds to behaviors consistently....
Read more >
Module 4: Defining the Behavior and Setting Goals
For instance, if your overall goal is to run for 60 minutes, do not make your behavioral definition to be 1 behavior =...
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