@hazae41/box
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -16,4 +16,4 @@ import { Result } from '@hazae41/result'; | ||
declare class Box<T extends Disposable> { | ||
#private; | ||
readonly inner: T; | ||
moved: boolean; | ||
/** | ||
@@ -24,3 +24,2 @@ * Object that uniquely owns a type T and can dispose it | ||
[Symbol.dispose](): void; | ||
get moved(): boolean; | ||
/** | ||
@@ -60,2 +59,9 @@ * Just get the inner value | ||
/** | ||
* Move if not already moved | ||
* Useful if you want to take ownership only if available | ||
* @example using box2 = box.moveIfNotMoved() | ||
* @returns Box<T> | ||
*/ | ||
moveIfNotMoved(): Box<T>; | ||
/** | ||
* Create a new Box that's already moved, and keep this one as is | ||
@@ -62,0 +68,0 @@ * @returns Box<T> |
{ | ||
"type": "module", | ||
"name": "@hazae41/box", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Rust-like Box for TypeScript", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/hazae41/box", |
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
20936
303