uni-types 1.2.0 → 1.3.0

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.
Files changed (2) hide show
  1. package/README.md +112 -1
  2. package/package.json +4 -3
package/README.md CHANGED
@@ -18,7 +18,7 @@ A comprehensive collection of type helpers for TypeScript development
18
18
 
19
19
  ## Features
20
20
 
21
- - 🎯 **100+ Type Utilities** - Comprehensive type helpers for every use case
21
+ - 🎯 **250+ Type Utilities** - Comprehensive type helpers for every use case
22
22
  - 🔒 **Type Safe** - Full TypeScript support with strict type checking
23
23
  - 📦 **Zero Dependencies** - Lightweight and tree-shakeable
24
24
  - 🚀 **TypeScript 5.x** - Built with the latest TypeScript features
@@ -257,6 +257,117 @@ type Result = If<true, 'success', 'error'> // 'success'
257
257
  | `Cached<T>` | Cache type computation |
258
258
  | `Memoized<T>` | Memoize type computation |
259
259
 
260
+ ### Advanced Type Patterns *(v1.3.0)*
261
+
262
+ | Type | Description |
263
+ |------|-------------|
264
+ | `Match<T, Patterns>` | Type-level pattern matching |
265
+ | `Recurse<T, Limit>` | Type-level recursion with depth limit |
266
+ | `Depth<T>` | Get maximum depth of nested type |
267
+ | `TypeFilter<T, P>` | Filter tuple by predicate |
268
+ | `TypeFind<T, P>` | Find first matching element |
269
+ | `TypeIncludes<T, E>` | Check if tuple includes element |
270
+ | `TypeEvery<T, P>` | Check if all elements match |
271
+ | `TypeSome<T, P>` | Check if any element matches |
272
+
273
+ ### Type-Level Collections *(v1.3.0)*
274
+
275
+ | Type | Description |
276
+ |------|-------------|
277
+ | `TypeSet<T>` | Type-level Set representation |
278
+ | `SetAdd<S, T>` | Add element to type set |
279
+ | `SetRemove<S, T>` | Remove element from type set |
280
+ | `SetUnion<A, B>` | Union of two type sets |
281
+ | `SetIntersection<A, B>` | Intersection of two type sets |
282
+ | `SetDifference<A, B>` | Difference of two type sets |
283
+ | `TypeMap<K, V>` | Type-level Map representation |
284
+ | `MapGet<M, K>` | Get value from type map |
285
+ | `MapSet<M, K, V>` | Set value in type map |
286
+ | `ListFilter<T, P>` | Filter list elements |
287
+ | `ListReverse<T>` | Reverse a list |
288
+ | `ListConcat<A, B>` | Concatenate two lists |
289
+ | `ListTake<T, N>` | Take first N elements |
290
+ | `ListChunk<T, N>` | Chunk list into sublists |
291
+
292
+ ### Type Assertions & Constraints *(v1.3.0)*
293
+
294
+ | Type | Description |
295
+ |------|-------------|
296
+ | `AssertEqual<T, Expected>` | Assert types are equal |
297
+ | `AssertExtends<T, U>` | Assert T extends U |
298
+ | `RequireKeys<T, K>` | Require specific keys |
299
+ | `RequireAtLeastOne<T, K>` | Require at least one key |
300
+ | `RequireExactlyOne<T, K>` | Require exactly one key |
301
+ | `RequireAllOrNone<T, K>` | Require all or none keys |
302
+ | `HasProperty<T, K>` | Ensure object has property |
303
+ | `RequireArray<T>` | Ensure type is array |
304
+ | `RequireFunction<T>` | Ensure type is function |
305
+
306
+ ### String Operations *(v1.3.0)*
307
+
308
+ | Type | Description |
309
+ |------|-------------|
310
+ | `Split<S, D>` | Split string by delimiter |
311
+ | `Join<T, S>` | Join string array with separator |
312
+ | `KebabCase<S>` | Convert to kebab-case |
313
+ | `PascalCase<S>` | Convert to PascalCase |
314
+ | `ConstantCase<S>` | Convert to CONSTANT_CASE |
315
+ | `IsEmail<S>` | Check if string is email |
316
+ | `IsUUID<S>` | Check if string is UUID |
317
+ | `IsURL<S>` | Check if string is URL |
318
+ | `ReverseString<S>` | Reverse a string |
319
+
320
+ ### Promise & Async Utilities *(v1.3.0)*
321
+
322
+ | Type | Description |
323
+ |------|-------------|
324
+ | `PromiseValue<T>` | Extract value from Promise (deep) |
325
+ | `IsPromise<T>` | Check if type is Promise |
326
+ | `UnwrapPromise<T>` | Unwrap or return original |
327
+ | `AsyncReturnType<T>` | Return type of async function |
328
+ | `MakeAsync<T>` | Make function async |
329
+ | `PromiseAll<T>` | Await all promises |
330
+ | `AsyncResult<T, E>` | Rust-style Result type |
331
+ | `Deferred<T>` | Deferred promise type |
332
+
333
+ ### Object Operations *(v1.3.0)*
334
+
335
+ | Type | Description |
336
+ |------|-------------|
337
+ | `ObjectMap<T, F>` | Map over object values |
338
+ | `ObjectFilter<T, P>` | Filter object properties |
339
+ | `ObjectPickByType<T, U>` | Pick by value type |
340
+ | `ObjectInvert<T>` | Invert object (swap keys/values) |
341
+ | `DeepMerge<A, B>` | Deep merge objects |
342
+ | `ObjectPath<T, P>` | Get value at path |
343
+ | `PathExists<T, P>` | Check if path exists |
344
+ | `KeysOfType<T, U>` | Get keys of specific type |
345
+
346
+ ### JSON Schema *(v1.3.0)*
347
+
348
+ | Type | Description |
349
+ |------|-------------|
350
+ | `JsonSchemaType<T>` | Map TS types to JSON Schema types |
351
+ | `JsonSchema<T>` | Full JSON Schema type |
352
+ | `OpenAPISchema<T>` | OpenAPI 3.0 Schema |
353
+ | `OpenAPIResponse<T>` | OpenAPI Response |
354
+ | `OpenAPIRequestBody<T>` | OpenAPI Request Body |
355
+ | `OpenAPIParameter<Name, T, In>` | OpenAPI Parameter |
356
+ | `OpenAPIDocument<Title, Version, Paths>` | OpenAPI Document |
357
+
358
+ ### Extended Ecosystem *(v1.3.0)*
359
+
360
+ | Type | Description |
361
+ |------|-------------|
362
+ | `NextPageProps<T>` | Next.js page props |
363
+ | `ServerComponentProps<T>` | Next.js server component props |
364
+ | `NuxtPageMeta<T>` | Nuxt page meta |
365
+ | `NuxtComposable<T>` | Nuxt composable type |
366
+ | `SolidSignal<T>` | SolidJS signal type |
367
+ | `SolidResource<T>` | SolidJS resource type |
368
+ | `SvelteStore<T>` | Svelte store type |
369
+ | `SvelteAction<Element, Params>` | Svelte action type |
370
+
260
371
  ## Examples
261
372
 
262
373
  ```typescript
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "uni-types",
3
3
  "description": "Universal TypeScript type utilities - A comprehensive collection of type helpers for TypeScript development",
4
4
  "type": "module",
5
- "version": "1.2.0",
5
+ "version": "1.3.0",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.mjs",
8
8
  "types": "dist/index.d.mts",
@@ -30,13 +30,14 @@
30
30
  "@eslint-sets/eslint-config": "^6.3.1",
31
31
  "@guolao/vue-monaco-editor": "^1.6.0",
32
32
  "@types/node": "^22.19.17",
33
+ "@types/react": "^19.2.14",
33
34
  "@vitest/coverage-v8": "4.1.4",
34
35
  "eslint": "^9.39.4",
35
36
  "monaco-editor": "^0.55.1",
36
- "prettier": "^3.8.2",
37
+ "prettier": "^3.8.3",
37
38
  "prettier-config-common": "^1.5.0",
38
39
  "publint": "^0.3.18",
39
- "tsdown": "^0.21.7",
40
+ "tsdown": "^0.21.9",
40
41
  "typescript": "^5.9.3",
41
42
  "vite": "^8.0.8",
42
43
  "vitepress": "^1.6.4",