What problem does it solve?
Codebases accumulate inconsistent runtime type guards like typeof x === 'string' and ad-hoc emptiness checks like value.trim() !== '', making TypeScript code harder to read and maintain across app, server, IPC, and test layers.
Core Features & Use Cases
- Guard Mapping: Converts runtime
typeof comparisons for strings, numbers, booleans, functions, undefined, and objects into lodash-es predicates such as isString, isNumber, and isObjectLike.
- String Emptiness Normalization: Replaces
value.trim() === '' style checks with isEmpty(value.trim()) for consistent emptiness handling.
- Type-Level Safety: Explicitly preserves compile-time TypeScript
typeof usages like ReturnType<typeof fn> and z.infer<typeof Schema>.
- Use Case: While refactoring an Electron app's IPC handlers, you find dozens of
typeof payload === 'string' checks; apply this Skill to convert them to named lodash-es imports and verify with ripgrep and npm run type-check.
Quick Start
Refactor the runtime typeof and string emptiness checks in the src directory to use lodash-es predicates, then verify only type-level typeof remains.