Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hazae41/result

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hazae41/result - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

dist/cjs/mods/result/err.cjs

4

dist/types/index.d.ts

@@ -1,3 +0,3 @@

export { Ok } from './mods/result/data.js';
export { Err } from './mods/result/error.js';
export { Err, ErrInner } from './mods/result/err.js';
export { Ok, OkInner } from './mods/result/ok.js';
export { Result, Wrapper } from './mods/result/result.js';
import { Promiseable } from '../../libs/promises/promises.js';
import { Ok } from './data.js';
import { Err } from './error.js';
import { Err } from './err.js';
import { Ok } from './ok.js';

@@ -5,0 +5,0 @@ interface Wrapper<D> {

{
"type": "module",
"name": "@hazae41/result",
"version": "1.0.2",
"version": "1.0.3",
"description": "Rust-like Result for TypeScript",

@@ -6,0 +6,0 @@ "homepage": "https://github.com/hazae41/result",

@@ -18,3 +18,3 @@ # Result

- `wrap()`/`unwrap()`/`rewrap()` conversion (async/sync)
- `ok()`/`err()` optional chaining (`?.`)
- `ok()`/`err()` for converting to Option from `@hazae41/option` (with optional chaining `?.`)
- `isOk()`/`isErr()` type guards

@@ -137,7 +137,7 @@ - `map()`/`tryMap()` mapping (async/sync)

Use `ok()` and `err()` to get the inner value or undefined
Use `ok()` and `err()` to get an Option, and use `inner` to get the inner value if `Some`, or `undefined` if `None`
```typescript
function maybeSlice(result: Result<string>): string | undefined {
return result.ok()?.slice(0, 5)
return result.ok().inner?.slice(0, 5)
}

@@ -144,0 +144,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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