• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IgorBabkin / ts-ioc-container / 20035658635

08 Dec 2025 04:43PM UTC coverage: 94.368% (+0.007%) from 94.361%
20035658635

push

github

IgorBabkin
refactor(lib): reorganize utils and metadata into modular structure

Breaking down monolithic files for better maintainability:

**Utils reorganization:**
- Split utils.ts into specialized modules:
  - utils/fp.ts - Functional programming utilities (pipe with type transformations)
  - utils/basic.ts - Basic types and type guards (constructor, Is utilities)
  - utils/array.ts - Array utilities (fillEmptyIndexes, Filter)
  - utils/proxy.ts - Proxy utilities (lazyProxy, toLazyIf)
  - utils/promise.ts - Promise utilities (promisify)

**Metadata reorganization:**
- Split metadata.ts into domain-specific modules:
  - metadata/class.ts - Class metadata utilities
  - metadata/parameter.ts - Parameter metadata utilities
  - metadata/method.ts - Method metadata utilities

**Pipe function enhancement:**
- Enhanced MapFn type to support input/output type transformations (MapFn<A, B>)
- Added 10 overloads for explicit type transformations (A→B, A→B→C, etc.)
- Added fallback overload for same-type transformations
- Comprehensive tests for type transformations

**Tests:**
- Added comprehensive pipe function tests (10 test cases)
- Updated test imports to match new structure
- All 182 tests passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

132 of 155 branches covered (85.16%)

Branch coverage included in aggregate %.

70 of 71 new or added lines in 20 files covered. (98.59%)

622 of 644 relevant lines covered (96.58%)

82.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

72.73
/lib/utils/basic.ts
1
export type constructor<T> = new (...args: any[]) => T;
2

3
export interface InstanceOfClass<T = unknown> {
4
  new (...args: unknown[]): T;
5
}
6

7
export interface Instance<T = unknown> {
8
  new (...args: unknown[]): T;
9
}
10

11
export const Is = {
44✔
12
  nullish: <T>(value: T | undefined | null): value is null | undefined => value === undefined || value === null,
59✔
NEW
13
  object: (target: unknown): target is object => target !== null && typeof target === 'object',
×
14
  instance: (target: unknown): target is InstanceOfClass => Object.prototype.hasOwnProperty.call(target, 'constructor'),
27✔
15
  constructor: (target: unknown): target is constructor<unknown> => typeof target === 'function' && !!target.prototype,
341✔
16
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc