Skip to content

Path to V3#101

Open
baxyz wants to merge 15 commits into
mainfrom
v3
Open

Path to V3#101
baxyz wants to merge 15 commits into
mainfrom
v3

Conversation

@baxyz

@baxyz baxyz commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Description

Please include a summary of what this PR does and why it's needed.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring
  • Test improvement

Related Issues

Closes #(issue number)

How Has This Been Tested?

Describe the tests you ran and how to reproduce them:

  • Test A
  • Test B

Checklist

  • My code follows the code style of this project
  • I have updated the documentation accordingly
  • I have added tests for my changes
  • All new and existing tests passed locally
  • My commits follow the conventional commit format

Screenshots (if applicable)

Add screenshots for UI changes.

Additional Context

Add any other context about the PR here.

baxyz and others added 5 commits June 23, 2026 21:56
Deleted `isEmpty` and all associated tests/examples from the `type`
category. The per-category replacements (`array/isEmpty`, `string/isEmpty`,
`object/isEmpty`) have been available since 2.0.0 and carry the same JSDoc.

Breaking change for v3.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deleted `safeDate` and `dateToISOString` (both in `date/safeDate.ts`)
along with their test file. Replacements available since v1.9.0:
- `safeDate` → `ensureDate`
- `dateToISOString` → `toISO8601` (date/format)

Breaking change for v3.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removed the `daysDifference` function from `difference.ts`, deleted its
dedicated example file, and stripped all daysDifference describe blocks
from `.test.ts` and `.spec.ts`. The replacement `difference` (available
since 2.0.0) covers the same use-case with a richer API (unit, sign).

Breaking change for v3.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removed the `deepClone` re-export alias from `cloneDeep.ts`. Replacement
`cloneDeep` has been the canonical name since the symbol was deprecated
(marked `@deprecated` since v1.9.0).

Breaking change for v3.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removed the `deepMerge` re-export alias from `mergeDeep.ts`. Replacement
`mergeDeep` has been the canonical name since the symbol was deprecated
(marked `@deprecated` since v1.9.0).

Breaking change for v3.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
baxyz and others added 4 commits June 27, 2026 13:47
Created `helpers/_shared/_unsafeKeys.ts` as the single source of truth for
the prototype-pollution guard keys. All consumers (`array/countBy`,
`object/map|cloneDeep|mergeDeep|groupBy|set|invert|_types`) now import from
`'../_shared/_unsafeKeys.js'`; the file is inlined into each category bundle
at compile time so there is no runtime cross-package dependency.

Deleted the two duplicated copies `array/_unsafeKeys.ts` and
`object/_unsafeKeys.ts`. The build script now explicitly skips any directory
whose name starts with `_` to prevent accidental packaging of internal
shared directories.

Breaking change for v3.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Moved all 141 runtime type-guard files (`is*`) from `helpers/type/` to the
new `helpers/guard/` category. The compile-time utility types (`DeepPartial`,
`DeepWritable`, `Maybe`) remain in `helpers/type/`, which now has a focused
purpose.

- New package: `@helpers4/guard` (was `@helpers4/type` for runtime guards)
- `helpers/guard/config.json` created
- `helpers/type/config.json` updated to reflect compile-time-only purpose

Breaking change for v3: consumers of runtime guards must update their
import from `@helpers4/type` to `@helpers4/guard`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The `helpers/type/` category is now exclusively compile-time TypeScript
utility types — zero runtime footprint, always imported with `import type`.

Existing types kept:
- `DeepPartial`, `DeepWritable`, `Maybe`

Promoted from internal `object/_types.ts` (standalone, no cross-package dep):
- `UnionToIntersection<U>` — collapses A | B | C → A & B & C
- `DeepGet<T, Path>` — value type at a path within T
- `DeepSet<T, Path, V>` — produces T with value at Path replaced by V
  (`ParsePath` stays internal to object/ — too path-specific)

New utility types added:
- `Brand<T, B>` — nominal typing via phantom tag
- `Prettify<T>` — flattens intersections for IDE readability
- `Nullable<T>` / `Nullish<T>` — `T | null` / `T | null | undefined`
- `ValueOf<T>` — union of all value types of an object type
- `KeysOfType<T, V>` — keys whose values extend V
- `PickByValue<T, V>` / `OmitByValue<T, V>` — filter by value type
- `RequiredKeys<T>` / `OptionalKeys<T>` — required/optional key sets

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The inner callbacks of `truthyPromiseOrThrow`, `falsyPromiseOrThrow`, and
`meaningPromiseOrThrow` previously typed `data` as `unknown` and returned
it with `as T` — an unsound cast invisible at the call site.

Fix: type `data` as `T` directly in the returned closure (matching the
outer overload signature). No cast needed; TypeScript infers the return
correctly. The now-redundant `as T` / `as any[]` / `as object` annotations
and their `eslint-disable` suppressions are removed.

`meaningPromiseOrThrow` additionally extracts the predicate into a private
`isMeaningless(value: unknown): boolean` helper, eliminating all remaining
casts in the function body. Only `functional/no-throw-statement` comments
remain — they suppress a rule about `throw` style, not a type issue.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
baxyz and others added 6 commits June 27, 2026 13:55
helpers/_shared/ is an internal utility folder — not a publishable category
and has no config.json by design.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- simplify repository purpose and stack
- refine key commands and rules
- remove critical restrictions and organization context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant