Http Kernel!

This commit is contained in:
garrettmills
2020-07-22 09:38:17 -05:00
parent 60bb9afa29
commit b9f2f844f3
25 changed files with 402 additions and 43 deletions

View File

@@ -205,6 +205,17 @@ class Collection<T> {
return new Collection(this._items.filter(func))
}
find<T2>(func: KeyFunction<T, T2>): number | undefined {
let found_index: number | undefined = undefined
this._items.some((item, index) => {
if ( func(item, index) ) {
found_index = index
return true
}
})
return found_index
}
when<T2>(bool: boolean, then: CollectionFunction<T, T2>): Collection<T> {
if ( bool ) then(this)
return this