Skip to content

Commit 1ca1cc8

Browse files
authored
Merge branch 'master' into support-node-26
2 parents 70108fa + 2165086 commit 1ca1cc8

9 files changed

Lines changed: 228 additions & 170 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66

77
- Supporting Node 26.
88

9+
### v27.2.4
10+
11+
- Fixed performance regression since v24.0.0:
12+
- Removed unnecessary processing of output schema examples;
13+
- Those used to be processed when the first API request occurred on endpoint;
14+
- Examples are only required for Documentation generator, not for runtime validation.
15+
16+
### v27.2.3
17+
18+
- Optimizing the performance of traverses:
19+
- Replaced O(n) `Array::shift()` and `::unshift()` operations with O(1) index-based iteration;
20+
- The expected boost is from 1.8x to 20x depending on queue size;
21+
- Scope: generators (Integration and Documentation), startup (diagnostics, routing).
22+
923
### v27.2.2
1024

1125
- `@express-zod-api/zod-plugin` version bumped to `^4.1.0`.

express-zod-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "express-zod-api",
3-
"version": "27.2.2",
3+
"version": "27.2.4",
44
"description": "A Typescript framework to help you get an API server up and running with I/O schema validation and custom middlewares in minutes.",
55
"license": "MIT",
66
"repository": {

express-zod-api/src/endpoint.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ export class Endpoint<
156156

157157
/** @internal */
158158
public override get outputSchema(): OUT {
159-
this.#ensureOutputExamples();
160159
return this.#def.outputSchema;
161160
}
162161

express-zod-api/src/logger-helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Ansis, blue, green, hex, red, cyanBright } from "ansis";
1+
import { type Ansis, blue, green, hex, red, cyanBright } from "ansis";
22
import * as R from "ramda";
33
import { isObject } from "./common-helpers";
44

express-zod-api/src/logical-container.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ export type LogicalContainer<T> =
99
| LogicalAnd<T | LogicalOr<T>>
1010
| T;
1111

12-
const isLogicalOr = <T>(subject: LogicalContainer<T>) =>
12+
/** @internal */
13+
export const isLogicalOr = <T>(subject: LogicalContainer<T>) =>
1314
isObject(subject) && "or" in subject;
1415

15-
const isLogicalAnd = <T>(subject: LogicalContainer<T>) =>
16+
/** @internal */
17+
export const isLogicalAnd = <T>(subject: LogicalContainer<T>) =>
1618
isObject(subject) && "and" in subject;
1719

18-
const isSimple = <T>(entry: LogicalContainer<T>): entry is T =>
20+
/** @internal */
21+
export const isSimple = <T>(entry: LogicalContainer<T>): entry is T =>
1922
!isLogicalAnd(entry) && !isLogicalOr(entry);
2023

2124
type Combination<T> = T[];

express-zod-api/tests/__snapshots__/builtin-logger.spec.ts.snap

Lines changed: 0 additions & 140 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const customMock = vi.fn();
2+
3+
const blue = vi.fn();
4+
const green = vi.fn();
5+
const hex = vi.fn(() => customMock);
6+
const red = vi.fn();
7+
const cyanBright = vi.fn();
8+
9+
vi.mock("ansis", () => ({
10+
default: {
11+
isSupported: vi.fn().mockReturnValue(true),
12+
},
13+
blue,
14+
green,
15+
hex,
16+
red,
17+
cyanBright,
18+
}));
19+
20+
export {
21+
blue as blueMock,
22+
green as greenMock,
23+
red as redMock,
24+
cyanBright as cyanMock,
25+
customMock,
26+
};

0 commit comments

Comments
 (0)