Bug
The runtime function deepStrictObjectKeys recurses into Date objects, producing keys like "createdAt.toISOString", "createdAt.getTime", etc. The type-level DeepStrictObjectKeys correctly treats Date as a leaf (via the ValueType check), so this is a type/runtime mismatch.
Reproduction
const obj = { createdAt: new Date() };
const keys = deepStrictObjectKeys(obj);
// Type says: ("createdAt")[]
// Runtime produces: ["createdAt", "createdAt.toISOString", "createdAt.getTime", ...]
Root Cause
src/functions/DeepStrictObjectKeys.ts line 68:
if (typeof value === 'object' && value !== null) {
const children = deepStrictObjectKeys(value).map((el) => `${key}.${el}`);
response.push(...children);
}
typeof new Date() === 'object' is true, so Date is recursed into. The type-level counterpart uses ValueType (which includes Date) to stop recursion, but the runtime function has no equivalent guard.
Suggested Fix
Add && !(value instanceof Date) to the condition:
if (typeof value === 'object' && value !== null && !(value instanceof Date)) {
Bug
The runtime function
deepStrictObjectKeysrecurses intoDateobjects, producing keys like"createdAt.toISOString","createdAt.getTime", etc. The type-levelDeepStrictObjectKeyscorrectly treatsDateas a leaf (via theValueTypecheck), so this is a type/runtime mismatch.Reproduction
Root Cause
src/functions/DeepStrictObjectKeys.tsline 68:typeof new Date() === 'object'istrue, so Date is recursed into. The type-level counterpart usesValueType(which includesDate) to stop recursion, but the runtime function has no equivalent guard.Suggested Fix
Add
&& !(value instanceof Date)to the condition: