change some
to status
in wrap
This commit is contained in:
@ -119,7 +119,7 @@ class RfwfsDirectory<T extends Entry> {
|
|||||||
if (read_write_access(this.entry.permissions)) {
|
if (read_write_access(this.entry.permissions)) {
|
||||||
const pop_find = directory_search(this.directory, file_name)
|
const pop_find = directory_search(this.directory, file_name)
|
||||||
if (pop_find) {
|
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.Ok, pop_find.result)
|
||||||
}
|
}
|
||||||
return wrap_entry(ReadStatus.NotFound)
|
return wrap_entry(ReadStatus.NotFound)
|
||||||
|
@ -6,14 +6,14 @@ type WrapBSearch<T extends Entry> = WrapResult<T, number>
|
|||||||
type WrapResultNone<T> = WrapResult<Option.None, T>
|
type WrapResultNone<T> = WrapResult<Option.None, T>
|
||||||
|
|
||||||
interface WrapResult<T, U> {
|
interface WrapResult<T, U> {
|
||||||
/** The resulting value if `U` is a success */
|
/** The resulting value if `U` is a success status */
|
||||||
readonly result: T,
|
readonly result: T,
|
||||||
/** Represents some arbitrary extra value, usually a success status */
|
/** Represents some arbitrary extra value, usually a status */
|
||||||
readonly some: U
|
readonly status: U,
|
||||||
}
|
}
|
||||||
|
|
||||||
function wrap<T, U>(result: T, some: U): WrapResult<T, 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> {
|
function wrap_bsearch<T extends Entry>(index: number, result: T): WrapBSearch<T> {
|
||||||
|
Reference in New Issue
Block a user