utilium 1.2.6 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cache.d.ts CHANGED
@@ -38,7 +38,7 @@ export declare class Resource<ID> {
38
38
  /** The resource ID */
39
39
  readonly id: ID;
40
40
  /** The full size of the resource */
41
- readonly size: number;
41
+ size: number;
42
42
  protected readonly options: Options;
43
43
  /** Regions used to reduce unneeded allocations. Think of sparse arrays. */
44
44
  readonly regions: Region[];
package/dist/objects.d.ts CHANGED
@@ -23,10 +23,11 @@ export declare function resolveConstructors(object: object): string[];
23
23
  * Allows you to convert an object with specific member types into a Map that will give you the correct type for the correct member
24
24
  */
25
25
  export interface ConstMap<T extends Partial<Record<keyof any, any>>, K extends keyof any = keyof T, V = T[keyof T]> extends Map<K, V> {
26
- get<_K extends keyof T>(key: _K): T[_K];
26
+ get<TK extends keyof T>(key: TK): T[TK];
27
27
  get(key: K): V;
28
- set<_K extends keyof T>(key: _K, value: T[_K]): this;
28
+ set<TK extends keyof T>(key: TK, value: T[TK]): this;
29
29
  set(key: K, value: V): this;
30
+ has(key: keyof T | K): boolean;
30
31
  }
31
32
  export declare function map<const T extends Partial<Record<any, any>>>(items: T): Map<keyof T, T[keyof T]>;
32
33
  export declare function getByString(object: Record<string, any>, path: string, separator?: RegExp): Record<string, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utilium",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "Typescript utilities",
5
5
  "funding": {
6
6
  "type": "individual",
package/src/cache.ts CHANGED
@@ -49,7 +49,7 @@ export class Resource<ID> {
49
49
  /** The resource ID */
50
50
  public readonly id: ID,
51
51
  /** The full size of the resource */
52
- public readonly size: number,
52
+ public size: number,
53
53
  protected readonly options: Options,
54
54
  resources?: Map<ID, Resource<ID> | undefined>
55
55
  ) {
package/src/objects.ts CHANGED
@@ -65,10 +65,11 @@ export function resolveConstructors(object: object): string[] {
65
65
  * Allows you to convert an object with specific member types into a Map that will give you the correct type for the correct member
66
66
  */
67
67
  export interface ConstMap<T extends Partial<Record<keyof any, any>>, K extends keyof any = keyof T, V = T[keyof T]> extends Map<K, V> {
68
- get<_K extends keyof T>(key: _K): T[_K];
68
+ get<TK extends keyof T>(key: TK): T[TK];
69
69
  get(key: K): V;
70
- set<_K extends keyof T>(key: _K, value: T[_K]): this;
70
+ set<TK extends keyof T>(key: TK, value: T[TK]): this;
71
71
  set(key: K, value: V): this;
72
+ has(key: keyof T | K): boolean;
72
73
  }
73
74
 
74
75
  export function map<const T extends Partial<Record<any, any>>>(items: T): Map<keyof T, T[keyof T]> {