Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Latest commit

 

History

History
300 lines (168 loc) · 6.9 KB

_cache_.cache.md

File metadata and controls

300 lines (168 loc) · 6.9 KB

nookipediaGlobals"cache"Cache

Class: Cache <Type>

This is a simple class that extends off of the Map class, it uses a string similarity algorithm to try and find an object, rather than just using the exact given string to retrieve.

Type parameters

Type

Hierarchy

  • Map‹string, Type›

    Cache

Index

Constructors

Properties

Methods

Constructors

constructor

+ new Cache(): Cache

Defined in src/cache.ts:9

Initializes a new Cache instance.

Returns: Cache

Properties

Readonly [Symbol.toStringTag]

[Symbol.toStringTag]: string

Inherited from Cache.[Symbol.toStringTag]

Defined in node_modules/.pnpm/registry.npmjs.org/typescript/3.9.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:130


Readonly size

size: number

Inherited from Cache.size

Defined in node_modules/.pnpm/registry.npmjs.org/typescript/3.9.2/node_modules/typescript/lib/lib.es2015.collection.d.ts:28


Static Map

Map: MapConstructor

Defined in node_modules/.pnpm/registry.npmjs.org/typescript/3.9.2/node_modules/typescript/lib/lib.es2015.collection.d.ts:36

Methods

[Symbol.iterator]

[Symbol.iterator](): IterableIterator‹[string, Type]›

Inherited from Cache.[Symbol.iterator]

Defined in node_modules/.pnpm/registry.npmjs.org/typescript/3.9.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts:121

Returns an iterable of entries in the map.

Returns: IterableIterator‹[string, Type]›


clear

clear(): void

Inherited from Cache.clear

Defined in node_modules/.pnpm/registry.npmjs.org/typescript/3.9.2/node_modules/typescript/lib/lib.es2015.collection.d.ts:22

Returns: void


delete

delete(key: string): boolean

Inherited from Cache.delete

Defined in node_modules/.pnpm/registry.npmjs.org/typescript/3.9.2/node_modules/typescript/lib/lib.es2015.collection.d.ts:23

Parameters:

Name Type
key string

Returns: boolean


entries

entries(): IterableIterator‹[string, Type]›

Inherited from Cache.entries

Defined in node_modules/.pnpm/registry.npmjs.org/typescript/3.9.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts:126

Returns an iterable of key, value pairs for every entry in the map.

Returns: IterableIterator‹[string, Type]›


find

find(name: string): Type | null

Defined in src/cache.ts:42

Tries to find the given name in the map and returns its entry as the generic type, if an entry can't be found null is returned.

Parameters:

Name Type Description
name string The entry to look for.

Returns: Type | null

The entry for the given name if it exists, otherwise, null.


forEach

forEach(callbackfn: function, thisArg?: any): void

Inherited from Cache.forEach

Defined in node_modules/.pnpm/registry.npmjs.org/typescript/3.9.2/node_modules/typescript/lib/lib.es2015.collection.d.ts:24

Parameters:

callbackfn: function

▸ (value: Type, key: string, map: Map‹string, Type›): void

Parameters:

Name Type
value Type
key string
map Map‹string, Type›

Optional thisArg: any

Returns: void


get

get(key: string): Type | undefined

Inherited from Cache.get

Defined in node_modules/.pnpm/registry.npmjs.org/typescript/3.9.2/node_modules/typescript/lib/lib.es2015.collection.d.ts:25

Parameters:

Name Type
key string

Returns: Type | undefined


has

has(name: string): boolean

Overrides void

Defined in src/cache.ts:32

Determines if the given name exists within this map.

Parameters:

Name Type Description
name string The string to look for.

Returns: boolean

Represents if the given string has an entry in this map.


keys

keys(): IterableIterator‹string›

Inherited from Cache.keys

Defined in node_modules/.pnpm/registry.npmjs.org/typescript/3.9.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts:131

Returns an iterable of keys in the map

Returns: IterableIterator‹string›


matches

matches(name: string): string[]

Defined in src/cache.ts:23

Searches through the Map's data and executes a string similarity method to try and find an entry.

Parameters:

Name Type Description
name string The name of the entry to find.

Returns: string[]

An array of possible matches.


set

set(key: string, value: Type): this

Inherited from Cache.set

Defined in node_modules/.pnpm/registry.npmjs.org/typescript/3.9.2/node_modules/typescript/lib/lib.es2015.collection.d.ts:27

Parameters:

Name Type
key string
value Type

Returns: this


values

values(): IterableIterator‹Type›

Inherited from Cache.values

Defined in node_modules/.pnpm/registry.npmjs.org/typescript/3.9.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts:136

Returns an iterable of values in the map

Returns: IterableIterator‹Type›