Skip to content

For alpha 16#45

Merged
baxyz merged 16 commits intomainfrom
for-alpha-16
Apr 19, 2026
Merged

For alpha 16#45
baxyz merged 16 commits intomainfrom
for-alpha-16

Conversation

@baxyz
Copy link
Copy Markdown
Contributor

@baxyz baxyz commented Apr 18, 2026

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 added 10 commits April 18, 2026 18:58
refactor(date): ♻️ replace safeDate with ensureDate in format functions
refactor(date): ♻️ update isSameDay, isSameMonth, and isSameYear to use ensureDate
test(date): ✅ add tests for isSameMonth and isSameYear with DateLike inputs
chore(date): 🔧 remove safeDate helper and related tests
- add isTemporalDuration, isTemporalInstant, isTemporalPlainDate
- add isTemporalPlainDateTime, isTemporalZonedDateTime checks
- update vitest config for harmony-temporal support
- addDays, addMonths, addYears functions
- startOf, endOf functions for date truncation
- comprehensive tests for all new functions
- implement isWithinRange, clampDate, and overlaps functions
- add eachDay and eachMonth functions for date iteration
- include comprehensive tests for all new functionalities
- implement formatDuration for human-readable duration strings
- add timeAgo for relative time formatting
- include tests for both new helpers
- implement listTimezones, getTimezoneOffset, and formatInTimezone
- add tests for timezone functionality
- implement isLeapYear and daysInMonth functions
- add isWeekend and isBusinessDay functions
- create tests for date validation and weekend logic
- implement toSeconds and toMillis functions
- add fromSeconds and fromMillis functions
- enhance tests for timestamp utilities
- add benchmarks for performance evaluation
- handle sparse arrays
- handle large and NaN chunk sizes
- deduplicate NaN values
- handle __proto__ and constructor as string values
- handle null and undefined values
- handle -0 and +0
Copilot AI review requested due to automatic review settings April 18, 2026 21:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares the codebase for the next alpha release by expanding the date and type helper sets, adding extensive edge-case tests (including security-focused cases), and updating website metadata generation to reference the relocated native alternatives data.

Changes:

  • Add a comprehensive set of new helpers/date utilities (DateLike normalization, ranges, sequences, formatting, timezone helpers, etc.) with unit/property/bench coverage.
  • Add Temporal type guards (isTemporal*) and enable Temporal in tests.
  • Harden deepClone against prototype-pollution keys and expand “security edge case” tests across helpers; move native-alternatives.json to docs/ and update build/docs references.

Reviewed changes

Copilot reviewed 101 out of 101 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
vitest.config.ts Passes Node flag intended to enable Temporal during test runs.
scripts/build/build-website-metadata.ts Reads native alternatives metadata from docs/native-alternatives.json.
helpers/url/withoutTrailingSlash.test.ts Adds “security edge case” tests.
helpers/url/withLeadingSlash.test.ts Adds “security edge case” tests.
helpers/url/relativeURLToAbsolute.test.ts Adds “security edge case” tests around dangerous-looking schemes/paths.
helpers/url/onlyPath.test.ts Adds “security edge case” tests.
helpers/url/extractPureURI.test.ts Adds “security edge case” tests.
helpers/url/cleanPath.test.ts Adds “security edge case” tests.
helpers/type/isTemporalZonedDateTime.ts Adds a Temporal ZonedDateTime type guard.
helpers/type/isTemporalZonedDateTime.test.ts Unit tests for isTemporalZonedDateTime.
helpers/type/isTemporalZonedDateTime.spec.ts Contract/property-style tests for isTemporalZonedDateTime.
helpers/type/isTemporalPlainTime.ts Adds a Temporal PlainTime type guard.
helpers/type/isTemporalPlainTime.test.ts Unit tests for isTemporalPlainTime.
helpers/type/isTemporalPlainTime.spec.ts Contract/property-style tests for isTemporalPlainTime.
helpers/type/isTemporalPlainDateTime.ts Adds a Temporal PlainDateTime type guard.
helpers/type/isTemporalPlainDateTime.test.ts Unit tests for isTemporalPlainDateTime.
helpers/type/isTemporalPlainDateTime.spec.ts Contract/property-style tests for isTemporalPlainDateTime.
helpers/type/isTemporalPlainDate.ts Adds a Temporal PlainDate type guard.
helpers/type/isTemporalPlainDate.test.ts Unit tests for isTemporalPlainDate.
helpers/type/isTemporalPlainDate.spec.ts Contract/property-style tests for isTemporalPlainDate.
helpers/type/isTemporalInstant.ts Adds a Temporal Instant type guard.
helpers/type/isTemporalInstant.test.ts Unit tests for isTemporalInstant.
helpers/type/isTemporalInstant.spec.ts Contract/property-style tests for isTemporalInstant.
helpers/type/isTemporalDuration.ts Adds a Temporal Duration type guard.
helpers/type/isTemporalDuration.test.ts Unit tests for isTemporalDuration.
helpers/type/isTemporalDuration.spec.ts Contract/property-style tests for isTemporalDuration.
helpers/type/isPlainObject.test.ts Adds “security edge case” tests (Proxy, proto, etc.).
helpers/string/titleCase.test.ts Adds “security edge case” tests (XSS-like strings, long inputs, null bytes).
helpers/string/snakeCase.test.ts Adds “security edge case” tests.
helpers/string/pascalCase.test.ts Adds “security edge case” tests.
helpers/string/kebabCase.test.ts Adds “security edge case” tests.
helpers/string/camelCase.test.ts Adds “security edge case” tests.
helpers/object/deepCompare.test.ts Adds “security edge case” tests (proto keys, deep nesting).
helpers/object/deepClone.ts Skips cloning unsafe keys to mitigate prototype pollution.
helpers/object/deepClone.test.ts Adds security-focused tests ensuring unsafe keys aren’t transported.
helpers/date/weekday.ts Adds WeekDays, isWeekend, isBusinessDay.
helpers/date/weekday.test.ts Unit tests for weekday helpers.
helpers/date/weekday.spec.ts Property/contract tests for weekday helpers.
helpers/date/validate.ts Adds isValidDateString.
helpers/date/validate.test.ts Unit tests for date-string validation.
helpers/date/validate.spec.ts Property/contract tests for date-string validation.
helpers/date/types.ts Introduces DateLike + EpochMilliseconds structural type.
helpers/date/timezone.ts Adds timezone helpers (listTimezones, getTimezoneOffset, formatInTimezone).
helpers/date/timezone.spec.ts Property/contract tests for timezone helpers.
helpers/date/timezone.bench.ts Benchmarks for timezone helpers.
helpers/date/timestamp.ts Expands timestamp utilities; adds seconds/millis conversion helpers.
helpers/date/timestamp.test.ts Unit tests for new timestamp helpers (incl. negative timestamps).
helpers/date/timestamp.spec.ts Property/contract tests for timestamp helpers.
helpers/date/timestamp.bench.ts Benchmarks for timestamp helpers.
helpers/date/timeAgo.ts Adds timeAgo using Intl.RelativeTimeFormat.
helpers/date/timeAgo.test.ts Unit tests for timeAgo.
helpers/date/timeAgo.spec.ts Property/contract tests for timeAgo.
helpers/date/startOf.ts Adds startOf/endOf truncation helpers.
helpers/date/startOf.test.ts Unit tests for startOf/endOf.
helpers/date/startOf.spec.ts Property/contract tests for startOf/endOf.
helpers/date/sequence.ts Adds eachDay/eachMonth range expansion helpers.
helpers/date/sequence.test.ts Unit tests for sequence helpers.
helpers/date/sequence.spec.ts Property/contract tests for sequence helpers.
helpers/date/safeDate.ts Deprecates wrappers and forwards to ensureDate.
helpers/date/safeDate.test.ts Removes old safeDate unit tests.
helpers/date/safeDate.spec.ts Removes old safeDate property tests.
helpers/date/safeDate.example.ts Removes old safeDate examples.
helpers/date/range.ts Adds range helpers (isWithinRange, clampDate, overlaps).
helpers/date/range.spec.ts Property/contract tests for range helpers.
helpers/date/range.bench.ts Benchmarks for range/sequence helpers.
helpers/date/is.ts Extends “is same *” helpers to accept DateLike; adds month/year variants.
helpers/date/is.spec.ts Updates tests for new isSameMonth/isSameYear + DateLike inputs.
helpers/date/index.ts Exports the expanded date surface.
helpers/date/formatDuration.ts Adds compact duration formatting helper.
helpers/date/formatDuration.test.ts Unit tests for formatDuration.
helpers/date/formatDuration.spec.ts Property/contract tests for formatDuration.
helpers/date/format.ts Switches date formatting helpers to use ensureDate + DateLike.
helpers/date/format.bench.ts Benchmarks for date formatting helpers.
helpers/date/ensureDate.ts Adds core DateLike→Date normalization (ensureDate).
helpers/date/ensureDate.spec.ts Property/contract tests for ensureDate.
helpers/date/ensureDate.bench.ts Benchmarks for ensureDate.
helpers/date/difference.ts Adds generalized difference(); deprecates daysDifference.
helpers/date/difference.test.ts Adds unit tests for difference().
helpers/date/difference.spec.ts Adds property/contract tests for difference().
helpers/date/compare.ts Extends date comparison to DateLike and adds month/year precision.
helpers/date/compare.test.ts Updates tests for new compare behavior and precisions.
helpers/date/compare.spec.ts Updates property/contract tests for new precisions and DateLike inputs.
helpers/date/compare.bench.ts Benchmarks compare/difference/isSame* helpers.
helpers/date/calendar.ts Adds calendar helpers (isLeapYear, daysInMonth).
helpers/date/calendar.test.ts Unit tests for calendar helpers.
helpers/date/calendar.spec.ts Property/contract tests for calendar helpers.
helpers/date/calendar.bench.ts Benchmarks for calendar/weekday/validate helpers.
helpers/date/add.ts Adds addDays/addMonths/addYears.
helpers/date/add.test.ts Unit tests for add helpers.
helpers/date/add.spec.ts Property/contract tests for add helpers.
helpers/date/add.bench.ts Benchmarks for add + startOf/endOf.
helpers/array/unique.test.ts Adds “security edge case” tests.
helpers/array/deepEquals.test.ts Adds “security edge case” tests (sparse arrays, NaN, deep nesting).
helpers/array/chunk.test.ts Adds “security edge case” tests.
docs/native-alternatives.json Adds native alternatives section for date/Temporal-related APIs.
CONTRIBUTING.md Updates guidance to check docs/native-alternatives.json.
AGENTS.md Documents docs/native-alternatives.json location in repo layout.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread helpers/date/compare.ts Outdated
Comment thread helpers/object/deepClone.ts
Comment thread helpers/date/timeAgo.test.ts Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 18, 2026

✅ PR Validation Passed

All checks passed and coverage target reached!


📋 Pipeline Status

Job Status
🔢 Version passing
🏗️ Build passing
🧪 Tests passing
📝 Lint passing
📘 TypeCheck passing
🔐 Security Audit passing
🧾 Conventional Commits passing
🔗 Coherency passing

📊 Code Coverage

Overall Coverage: 100.0% — Target reached! 🎯

Metric Progress Coverage
Lines ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100%
Branches ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100%
Functions ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100%
Statements ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100%

🧬 Mutation Testing

⚠️ Mutation Testing: score could not be determined


🌐 Runtime Compatibility

Runtime Compatibility: 3/3 — All runtimes passed!

Runtime Status
🟩 Node.js 24 (LTS) v24.14.1
🦕 Deno 2.7.12
🍞 Bun 1.3.12

🔄 Runtime compatibility is informational only and does not block the PR


⏱️ Benchmarks

Benchmarks: 0 suites — completed

⏱️ Benchmarks are informational only and do not block the PR


ℹ️ About this report
  • 🎯 Coverage Target: 100% for all metrics
  • 🧬 Mutation Testing: powered by Stryker (non-blocking)
  • ⏱️ Benchmarks: powered by Vitest Bench (non-blocking)
  • 🔄 This comment updates automatically with each push
  • 📈 Coverage is measured using Vitest + v8

🤖 Generated by @helpers4 CI • 2026-04-19

baxyz added 4 commits April 18, 2026 21:53
- compare(): return false when both inputs are invalid (not true)
- deepClone(): use Object.prototype.hasOwnProperty.call() for null-prototype objects
- timeAgo test: fix misleading test description
- Narrow sequence.spec.ts property-based date range from 10y to 2y
  to prevent eachDay tests timing out in CI (11.5s → 0.5s)
- Fix mutation score grep patterns to match Stryker v9 clear-text
  table format (All files row instead of non-existent patterns)
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 107 out of 107 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread helpers/date/index.ts Outdated
Comment thread helpers/date/sequence.spec.ts Outdated
Comment thread helpers/date/types.ts
Comment thread helpers/date/validate.ts
- change import paths from './types' to './types.model'
- remove unused index.ts and types.ts files
- add new types.model.ts and Maybe.model.ts files
- update tests to reflect changes in date helpers
@baxyz baxyz merged commit b71cc99 into main Apr 19, 2026
15 checks passed
@baxyz baxyz deleted the for-alpha-16 branch April 19, 2026 17:06
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.

2 participants