change some to status in wrap

This commit is contained in:
2025-03-20 19:39:10 -04:00
parent 7714a08517
commit 0483e2a0df
2 changed files with 5 additions and 5 deletions

View File

@ -119,7 +119,7 @@ class RfwfsDirectory<T extends Entry> {
if (read_write_access(this.entry.permissions)) {
const pop_find = directory_search(this.directory, file_name)
if (pop_find) {
this.directory.splice(pop_find.some, 1)
this.directory.splice(pop_find.status, 1)
return wrap_entry(ReadStatus.Ok, pop_find.result)
}
return wrap_entry(ReadStatus.NotFound)

View File

@ -6,14 +6,14 @@ type WrapBSearch<T extends Entry> = WrapResult<T, number>
type WrapResultNone<T> = WrapResult<Option.None, T>
interface WrapResult<T, U> {
/** The resulting value if `U` is a success */
/** The resulting value if `U` is a success status */
readonly result: T,
/** Represents some arbitrary extra value, usually a success status */
readonly some: U
/** Represents some arbitrary extra value, usually a status */
readonly status: U,
}
function wrap<T, U>(result: T, some: U): WrapResult<T, U> {
return { result: result, some: some }
return { result: result, status: some }
}
function wrap_bsearch<T extends Entry>(index: number, result: T): WrapBSearch<T> {