@hazae41/option
Advanced tools
Comparing version 1.0.17 to 1.0.18
export { None, NoneError, NoneInit } from './mods/option/none.js'; | ||
export { Option, OptionInit, Optional } from './mods/option/option.js'; | ||
export { NonOptional, Nullable, Option, OptionInit, Optional } from './mods/option/option.js'; | ||
export { Some, SomeInit } from './mods/option/some.js'; |
type Promiseable<T> = T | Promise<T>; | ||
export { Promiseable }; | ||
export type { Promiseable }; |
@@ -233,2 +233,2 @@ import { Err } from '@hazae41/result'; | ||
export { None, NoneError, NoneInit }; | ||
export { None, NoneError, type NoneInit }; |
@@ -5,3 +5,5 @@ import { Promiseable } from '../../libs/promises/promises.js'; | ||
type Optional<T> = T | undefined | null; | ||
type Nullable<T> = T | undefined | null; | ||
type Optional<T> = T | undefined; | ||
type NonOptional<T> = Exclude<T, undefined>; | ||
type OptionInit<T> = SomeInit<T> | NoneInit; | ||
@@ -12,12 +14,12 @@ type Option<T> = Some<T> | None; | ||
/** | ||
* Create an Option from a maybe undefined value | ||
* Create an Option from a nullable value | ||
* @param inner | ||
* @returns `Some<T>` if `T`, `None` if `undefined` | ||
*/ | ||
function wrap<T>(inner: Optional<T>): Option<T>; | ||
function map<T, U>(inner: Optional<T>, mapper: (inner: T) => Promiseable<U>): Promise<U | undefined>; | ||
function mapSync<T, U>(inner: Optional<T>, mapper: (inner: T) => U): U | undefined; | ||
function unwrap<T>(inner: Optional<T>): T; | ||
function wrap<T>(inner: Nullable<T>): Option<T>; | ||
function map<T, U>(inner: Nullable<T>, mapper: (inner: T) => Promiseable<U>): Promise<U | undefined>; | ||
function mapSync<T, U>(inner: Nullable<T>, mapper: (inner: T) => U): U | undefined; | ||
function unwrap<T>(inner: Nullable<T>): T; | ||
} | ||
export { Option, OptionInit, Optional }; | ||
export type { NonOptional, Nullable, Option, OptionInit, Optional }; |
@@ -233,2 +233,2 @@ import { Ok } from '@hazae41/result'; | ||
export { Some, SomeInit }; | ||
export { Some, type SomeInit }; |
{ | ||
"type": "module", | ||
"name": "@hazae41/option", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"description": "Rust-like Option for TypeScript", | ||
@@ -25,13 +25,13 @@ "homepage": "https://github.com/hazae41/option", | ||
"dependencies": { | ||
"@hazae41/result": "^1.0.45" | ||
"@hazae41/result": "^1.1.1" | ||
}, | ||
"devDependencies": { | ||
"@hazae41/phobos": "^1.0.10", | ||
"@rollup/plugin-typescript": "^11.1.1", | ||
"@types/node": "^20.3.1", | ||
"@rollup/plugin-typescript": "^11.1.3", | ||
"@types/node": "^20.5.7", | ||
"rimraf": "^5.0.1", | ||
"rollup": "^3.25.1", | ||
"rollup-plugin-dts": "^5.3.0", | ||
"rollup": "^3.28.1", | ||
"rollup-plugin-dts": "^6.0.0", | ||
"rollup-plugin-node-externals": "^6.1.1", | ||
"typescript": "^5.1.3" | ||
"typescript": "^5.2.2" | ||
}, | ||
@@ -38,0 +38,0 @@ "exports": { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
125874
1827
Updated@hazae41/result@^1.1.1