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

@hazae41/option

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hazae41/option - npm Package Compare versions

Comparing version 1.0.12 to 1.0.13

6

dist/types/index.d.ts

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

export { None, NoneError } from './mods/option/none.js';
export { Option, Optional } from './mods/option/option.js';
export { Some } from './mods/option/some.js';
export { None, NoneError, NoneInit } from './mods/option/none.js';
export { NonOptional, Option, OptionInit, Optional } from './mods/option/option.js';
export { Some, SomeInit } from './mods/option/some.js';

@@ -8,2 +8,4 @@ import { Err } from '@hazae41/result';

}
interface NoneInit {
}
declare class None {

@@ -20,2 +22,3 @@ readonly inner: undefined;

static new(): None;
static from(init: NoneInit): None;
/**

@@ -232,2 +235,2 @@ * Type guard for `Some`

export { None, NoneError };
export { None, NoneError, NoneInit };
import { Promiseable } from '../../libs/promises/promises.js';
import { None } from './none.js';
import { Some } from './some.js';
import { NoneInit, None } from './none.js';
import { SomeInit, Some } from './some.js';
type Optional<T> = T | undefined;
type NonOptional<T> = T & ({} | null);
type OptionInit<T> = SomeInit<T> | NoneInit;
type Option<T> = Some<T> | None;
declare namespace Option {
function from<T>(init: OptionInit<T>): Option<T>;
/**

@@ -13,3 +16,3 @@ * Create an Option from a maybe undefined value

*/
function from<T>(inner: Optional<T>): Option<T>;
function wrap<T>(inner: Optional<T>): Option<NonOptional<T>>;
function map<T, U>(inner: Optional<T>, mapper: (inner: T) => Promiseable<U>): Promise<U | undefined>;

@@ -19,2 +22,2 @@ function mapSync<T, U>(inner: Optional<T>, mapper: (inner: T) => U): U | undefined;

export { Option, Optional };
export { NonOptional, Option, OptionInit, Optional };

@@ -5,2 +5,5 @@ import { Ok } from '@hazae41/result';

interface SomeInit<T> {
inner: T;
}
declare class Some<T> {

@@ -19,2 +22,3 @@ readonly inner: T;

static new<T>(inner: T): Some<T>;
static from<T>(init: SomeInit<T>): Some<T>;
/**

@@ -231,2 +235,2 @@ * Type guard for `Some`

export { Some };
export { Some, SomeInit };
{
"type": "module",
"name": "@hazae41/option",
"version": "1.0.12",
"version": "1.0.13",
"description": "Rust-like Option for TypeScript",

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

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

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