**feat(utils): add type utility functions and examples for runtime type management**
- Introduced `getNounTypes`, `getVerbTypes`, `getNounTypeMap`, and `getVerbTypeMap` utilities for managing noun and verb types at runtime. - Added comprehensive unit tests (`type-utils.test.ts`) to ensure correctness of type utility functions. - Created new example files (`type-utils-example.js`, `type-utils-example.ts`) to demonstrate the use of type utilities in JavaScript and TypeScript environments. - Updated `README.md` with detailed documentation and usage examples for the new type utilities. - Enhanced `index.ts` to export the new utility functions, making them accessible throughout the library. **Purpose**: Facilitate easy access, validation, and manipulation of noun and verb types in client applications, providing better runtime type management.
This commit is contained in:
parent
927dc94edb
commit
17bd7ab42d
6 changed files with 392 additions and 1 deletions
12
src/index.ts
12
src/index.ts
|
|
@ -378,7 +378,17 @@ export type {
|
|||
Currency,
|
||||
Measurement
|
||||
}
|
||||
export { NounType, VerbType }
|
||||
// Export type utility functions
|
||||
import { getNounTypes, getVerbTypes, getNounTypeMap, getVerbTypeMap } from './utils/typeUtils.js'
|
||||
|
||||
export {
|
||||
NounType,
|
||||
VerbType,
|
||||
getNounTypes,
|
||||
getVerbTypes,
|
||||
getNounTypeMap,
|
||||
getVerbTypeMap
|
||||
}
|
||||
|
||||
// Export MCP (Model Control Protocol) components
|
||||
import {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue