diff --git a/src/rt/rfwfs/main.ts b/src/rt/rfwfs/main.ts index 55bd1e0..9846e60 100644 --- a/src/rt/rfwfs/main.ts +++ b/src/rt/rfwfs/main.ts @@ -26,7 +26,7 @@ interface EntryFile extends Entry { interface EntryCollection extends EntryCollectionInner { pop: (file_name: string) => T | undefined, - get: (file_name: string) => T | undefined + find: (file_name: string) => T | undefined push: (entry: E) => boolean, sort: () => void, } @@ -51,7 +51,7 @@ function push(self: EntryCollection, entry: Entry) { return false } -function get(self: EntryCollection, file_name: string) { +function find(self: EntryCollection, file_name: string) { const file_search = entry_search(self.collection, file_name) return file_search ? file_search.result : undefined } @@ -89,8 +89,8 @@ rfwfs.new_collection = function(collection: T[]): EntryCollecti const collection_trait = { collection: collection } as EntryCollection collection_trait.sort = function() { return sort(this) } collection_trait.push = function(entry) { return push(this, entry) } - collection_trait.get = function(file_name) { return get(this, file_name) } collection_trait.pop = function(file_name) { return pop(this, file_name) } + collection_trait.find = function(file_name) { return find(this, file_name) } return collection_trait }