getTyped to cleanup this.get('...') (#4334)
* getTyped to cleanup this.get('...')
* shorten
* Adjust
This commit is contained in:
@@ -64,6 +64,10 @@ export class Json extends Map<string, any> implements Codec {
|
||||
return compareMap(this, other);
|
||||
}
|
||||
|
||||
public getT <T> (key: string): T {
|
||||
return this.get(key) as unknown as T;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Unimplemented, will throw
|
||||
*/
|
||||
|
||||
@@ -137,6 +137,10 @@ export class Struct<
|
||||
return Object.keys(this.#Types);
|
||||
}
|
||||
|
||||
public getT <T> (key: string): T {
|
||||
return this.get(key) as unknown as T;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Checks if the value is an empty value
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user