@webshrine/stdtyp
Advanced tools
Comparing version 0.0.0-alpha.4 to 0.0.0-alpha.5
{ | ||
"name": "@webshrine/stdtyp", | ||
"type": "module", | ||
"version": "0.0.0-alpha.4", | ||
"version": "0.0.0-alpha.5", | ||
"private": false, | ||
@@ -33,5 +33,5 @@ "repository": { | ||
"devDependencies": { | ||
"@types/node": "^22.9.0", | ||
"@types/node": "^22.10.1", | ||
"eslint": "^9.15.0" | ||
} | ||
} |
/** | ||
* Any array alias, | ||
* focused to be used in generic types in environment with "any-phobic" eslint rules | ||
* @example ```ts | ||
* @example | ||
* function iterate<T extends AnyArray>(items: T) { ... } | ||
* ``` | ||
*/ | ||
@@ -17,5 +16,4 @@ export type AnyArray = any[] | ||
* focused to be used in generic types in environment with "any-phobic" eslint rules | ||
* @example ```ts | ||
* @example | ||
* function process<T extends AnyRecord>(data: T) { ... } | ||
* ``` | ||
*/ | ||
@@ -43,6 +41,5 @@ export type AnyObject = Record<PropertyKey, any> | ||
* @see CompareFn | ||
* @example ```ts | ||
* @example | ||
* function compare(a: number, b: number): CompareResultValue { ... } | ||
* const sorted = [3,1,2].sort(compare) | ||
* ``` | ||
*/ | ||
@@ -49,0 +46,0 @@ export type CompareResultValue = -1 | 0 | 1 |
@@ -17,3 +17,3 @@ import type { FnNullary } from '.' | ||
* Allows string to be acceptable with T literals types without loosing these literal | ||
* @example ```ts | ||
* @example | ||
* type SomeLiterals = 'a' | 'b' | 'c' | ||
@@ -23,3 +23,2 @@ * type MaybeSomeLiterals = MaybeLiteral<SomeLiterals> | ||
* const literal2: MaybeSomeLiterals = 'other literal' // still ok and IDE can suggest source literals | ||
* ``` | ||
*/ | ||
@@ -26,0 +25,0 @@ export type MaybeLiteral<T extends PropertyKey> = T | (string & {}) |
15592
406