Socket
Socket
Sign inDemoInstall

defekt

Package Overview
Dependencies
Maintainers
5
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

defekt - npm Package Compare versions

Comparing version 7.0.2 to 7.0.3

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [7.0.3](https://github.com/thenativeweb/defekt/compare/7.0.2...7.0.3) (2021-03-25)
### Bug Fixes
* update examples in README ([#287](https://github.com/thenativeweb/defekt/issues/287)) ([3b2b1ae](https://github.com/thenativeweb/defekt/commit/3b2b1ae0f1f3e1fee0ea53d724f231500fe03528))
## [7.0.2](https://github.com/thenativeweb/defekt/compare/7.0.1...7.0.2) (2021-03-25)

@@ -2,0 +9,0 @@

2

package.json
{
"name": "defekt",
"version": "7.0.2",
"version": "7.0.3",
"description": "defekt is custom errors made simple.",

@@ -5,0 +5,0 @@ "contributors": [

@@ -191,4 +191,3 @@ # defekt

const configurationResult = await loadConfiguration();
const configuration = configurationResult.unwrapOrDefault({ port: 3000 });
const configuration = (await loadConfiguration()).unwrapOrDefault({ port: 3000 });

@@ -246,13 +245,11 @@ await startServer(configuration.port);

const tokenResult = validateToken('a token');
const token = validateToken('a token').unwrapOrDefault({ sub: 'anonymous' });
const token = tokenResult.unwrapOrDefault({ sub: 'anonymous' });
// Or, if you can't handle the possible errors appropriately and
// instead want to throw the error, possibly crashing your application:
const token = tokenResult.unwrapOrThrow();
const token = validateToken('a token').unwrapOrThrow();
// If you want to handle errors by returning a conditional default
// value, you can use `unwrapOrElse` to supply a handler:
const token = tokenResult.unwrapOrElse(
const token = validateToken('a token').unwrapOrElse(
(ex) => {

@@ -259,0 +256,0 @@ switch (ex.code) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc