@putkoff/abstract-utilities 0.1.173 → 0.1.175

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.
@@ -1,7 +1,5 @@
1
1
  /**
2
- * Safely walk `window` or `document` to grab nested props without blowing up in Node.
3
- *
4
- * @param rootName "window" or "document"
5
- * @param path sequence of property names, e.g. ["location","host"] or ["baseURI"]
2
+ * Safely walk `globalThis` (or window/document) by a chain of property names.
3
+ * Returns `undefined` if any step is missing.
6
4
  */
7
- export declare function safeGlobalProp<R extends string, K extends keyof Window & keyof Document = any>(rootName: "window" | "document", ...path: string[]): any;
5
+ export declare function safeGlobalProp<T = any>(...path: string[]): T | undefined;
@@ -11,11 +11,7 @@ export declare function getSafeLocalStorage(): Storage | undefined;
11
11
  */
12
12
  export declare function callStorage<K extends keyof Storage>(method: K, ...args: Parameters<Storage[K]>): ReturnType<Storage[K]> | undefined;
13
13
  /**
14
- * Safely call localStorage / sessionStorage / any Storage API.
15
- *
16
- * @param storageName "localStorage" or "sessionStorage"
17
- * @param method one of the Storage methods, e.g. "getItem", "setItem", etc.
18
- * @param args arguments to pass along (e.g. key, value)
19
- * @returns whatever the underlying method returns, or undefined if unavailable/fails
14
+ * Safely call storage methods (`localStorage` or `sessionStorage`) without blowing up.
15
+ * Returns `undefined` on any error.
20
16
  */
21
- export declare function safeStorage<S extends "localStorage" | "sessionStorage", M extends keyof Storage>(storageName: S, method: M, ...args: Parameters<Storage[M]>): ReturnType<Storage[M]> | undefined;
17
+ export declare function safeStorage<S extends "localStorage" | "sessionStorage", K extends keyof Storage>(storageName: S, method: K, ...args: Parameters<Storage[K]>): ReturnType<Storage[K]> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putkoff/abstract-utilities",
3
- "version": "0.1.173",
3
+ "version": "0.1.175",
4
4
  "type": "module",
5
5
  "description": "A reusable React Login component with JWT authentication",
6
6
  "main": "dist/cjs/index.js",