Skip to content

Document sort, fix length(null), bump to 0.6.5#10

Merged
Sander-Toonen merged 4 commits into
mainfrom
docs/sort-function
Jun 2, 2026
Merged

Document sort, fix length(null), bump to 0.6.5#10
Sander-Toonen merged 4 commits into
mainfrom
docs/sort-function

Conversation

@Sander-Toonen

Copy link
Copy Markdown
Contributor

Bundles the work done on docs/sort-function.

Changes

  • Document the sort array function (1637568) — docs for the sort built-in.
  • Fix length(null) to return 0 (1752fba) — the unary length operator stringified null to "null" (→ 4); it now treats null as an explicit empty value. Includes a regression test.
  • Bump @pro-fa/expreszo to 0.6.5 (bd97ceb) — releases the length(null) fix.
  • Fix all Dependabot vulnerabilities (6f28a77) — vitest ^4.1.0 (+ matching @vitest/*), qs pinned to ^6.15.2, vite pinned to ^6.0.1 so yarn 1 can link the vitest 4 tree, and "node" added to the core tsconfig types.

Note on overlap with main

main already received the vitest CI fix directly (commit 65ee645), so the vitest/vite/tsconfig changes here overlap with what's already on main and may surface a yarn.lock/package.json conflict on merge — both sides want the same versions, so it resolves trivially (run yarn install after). This branch additionally adds the explicit qs resolutions pin, which main does not yet have.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings June 2, 2026 09:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Bundles three small unrelated changes: documents the existing sort array function in the language-service docs and quick-reference, fixes a length(null) bug where the unary length operator stringified null ("null".length === 4) and returned 4 instead of 0, and bumps the workspace's test toolchain (vitest 3 → 4, with matching @vitest/* packages), pins qs and vite via root resolutions, adds "node" to the core tsconfig types, and bumps @pro-fa/expreszo to 0.6.5.

Changes:

  • Add sort entry to BUILTIN_FUNCTION_DOCS and to docs/quick-reference.md.
  • Make length(null) return 0 (treats null as an explicit empty value) with a regression test.
  • Upgrade vitest stack to ^4.1.0, pin qs ^6.15.2 and vite ^6.0.1 in root resolutions, add node to packages/expreszo/tsconfig.json types, and bump version to 0.6.5.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/expreszo/src/operators/unary/logical.ts length now returns 0 for null instead of falling through to String(null).length.
packages/expreszo/test/functions/functions-string.ts Adds regression test for length(null) === 0.
packages/expreszo/src/registry/builtin/function-docs.ts Adds sort doc entry consumed by the language service.
docs/quick-reference.md Adds sort row to the array functions table.
packages/expreszo/package.json Bumps version to 0.6.5 and vitest devDeps to ^4.1.0.
packages/expreszo-mcp-server/package.json Bumps vitest devDeps to ^4.1.0.
packages/expreszo-datetime/package.json Bumps vitest devDeps to ^4.1.0.
package.json Bumps root vitest to ^4.1.0 and pins qs/vite in resolutions.
packages/expreszo/tsconfig.json Adds "node" to compiler types.
yarn.lock Regenerated to reflect vitest 4 dep graph and qs/vite pins.

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

Sander Toonen and others added 4 commits June 2, 2026 11:19
`sort` was implemented, registered, and tested, but had no entry in the
language-service docs registry and was missing from the quick reference.

- Add a `sort` entry to `BUILTIN_FUNCTION_DOCS` so IDE/playground hover and
  completions show its description and `a` / `f` (optional comparator) params.
- Add a `sort` row to the Array Functions table in `docs/quick-reference.md`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The unary `length` operator special-cased `undefined` and arrays, then
fell through to `String(s).length`. For `null` that became
`String(null)` -> "null" -> 4. Treat `null` as an explicit empty value
with length 0, keeping `undefined` propagating as `undefined`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Releases the `length(null)` fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two open advisories on the default branch:

- GHSA-5xrq-8626-4rwp (critical): vitest UI server arbitrary file
  read/execute, fixed in 4.1.0. Bump `vitest`, `@vitest/coverage-v8`,
  and `@vitest/ui` from ^3.2.4 to ^4.1.0 across all four manifests
  (resolves to 4.1.8).
- GHSA-q8mj-m7cp-5q26 (moderate): `qs.stringify` DoS, fixed in 6.15.2.
  Pin the transitive `qs` (via express/body-parser in the mcp-server)
  through a yarn `resolutions` entry, matching the existing
  `ip-address` pin.

vitest 4 now declares `vite` as a direct dependency (^6 || ^7 || ^8),
which led yarn 1 to resolve a second vite major and fail linking with
"could not find a copy of vite to link". Pin `vite` to ^6.0.1 in
`resolutions` so the whole tree shares the single hoisted vite 6.4.2
(in range for vitest and what the build already used).

vitest 4's `vitest/globals` no longer transitively pulls in @types/node,
so the core package's `types: ["vitest/globals"]` broke type-checking of
test files (`import assert from 'assert'`). Add "node", matching the
datetime and mcp-server tsconfigs which already list it.

Lint, type-check, and the full test suite (2215 + 104 + 12) pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Sander-Toonen Sander-Toonen merged commit 1d4a6bd into main Jun 2, 2026
8 checks passed
@Sander-Toonen Sander-Toonen deleted the docs/sort-function branch June 2, 2026 09:28
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