@byjohann/utils
Advanced tools
Comparing version 0.1.1 to 0.1.2
type MaybeArray<T> = T | T[]; | ||
/** | ||
* Converts `MaybeArray<T>` to `Array<T>` | ||
* Converts `MaybeArray<T>` to `Array<T>`. | ||
*/ | ||
@@ -17,10 +17,14 @@ declare function toArray<T>(array?: MaybeArray<T> | null | undefined): T[]; | ||
/** | ||
* Type-safe wrapper around `JSON.stringify` falling back to the original value | ||
* if it is not a string or an error is thrown. | ||
*/ | ||
declare function tryParseJson<T = unknown>(value: unknown): T; | ||
/** | ||
* Strictly typed `Object.keys` | ||
* Strictly typed `Object.keys`. | ||
*/ | ||
declare function objectKeys<T extends object>(obj: T): Array<`${keyof T & (string | number | boolean | null | undefined)}`>; | ||
/** | ||
* Strictly typed `Object.entries` | ||
* Strictly typed `Object.entries`. | ||
*/ | ||
@@ -27,0 +31,0 @@ declare function objectEntries<T extends object>(obj: T): Array<[keyof T, T[keyof T]]>; |
{ | ||
"name": "@byjohann/utils", | ||
"type": "module", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"packageManager": "pnpm@9.5.0", | ||
@@ -6,0 +6,0 @@ "description": "A collection of utilities for my projects", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8046
107