Document sort, fix length(null), bump to 0.6.5#10
Conversation
There was a problem hiding this comment.
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
sortentry toBUILTIN_FUNCTION_DOCSand todocs/quick-reference.md. - Make
length(null)return0(treatsnullas an explicit empty value) with a regression test. - Upgrade vitest stack to
^4.1.0, pinqs ^6.15.2andvite ^6.0.1in rootresolutions, addnodetopackages/expreszo/tsconfig.jsontypes, and bump version to0.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.
`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>
6f28a77 to
9954653
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Bundles the work done on
docs/sort-function.Changes
sortarray function (1637568) — docs for thesortbuilt-in.length(null)to return 0 (1752fba) — the unarylengthoperator stringifiednullto"null"(→ 4); it now treatsnullas an explicit empty value. Includes a regression test.@pro-fa/expreszoto 0.6.5 (bd97ceb) — releases thelength(null)fix.6f28a77) — vitest^4.1.0(+ matching@vitest/*),qspinned to^6.15.2,vitepinned to^6.0.1so yarn 1 can link the vitest 4 tree, and"node"added to the core tsconfigtypes.Note on overlap with main
mainalready received the vitest CI fix directly (commit65ee645), so the vitest/vite/tsconfig changes here overlap with what's already onmainand may surface ayarn.lock/package.jsonconflict on merge — both sides want the same versions, so it resolves trivially (runyarn installafter). This branch additionally adds the explicitqsresolutions pin, whichmaindoes not yet have.🤖 Generated with Claude Code