Skip to content

Commit 4a4a165

Browse files
committed
refactor: minimize cleanup and cover special schema keys
1 parent bc06905 commit 4a4a165

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/core/src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function calculateListItemIndex(
7575
let isFirst: boolean;
7676

7777
// Determine starting index from the block just before the chain
78-
const lastInChain = chain.at(-1) ?? { node, pos };
78+
const lastInChain = chain[chain.length - 1];
7979
const lastInfo = getBlockInfoFromNode(lastInChain.node, lastInChain.pos);
8080
if (!lastInfo.hasContent) {
8181
throw new Error("impossible");

‎packages/xl-ai/src/streamTool/jsonSchema.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ describe("createStreamToolsArraySchema definitions", () => {
2323
properties: {
2424
value: { type: "string", enum: ["one", "two"] },
2525
constructor: { type: "string" } satisfies JSONSchema7Definition,
26+
valueOf: { type: "number" } satisfies JSONSchema7Definition,
27+
toString: { type: "boolean" } satisfies JSONSchema7Definition,
2628
enabled: true,
2729
forbidden: false,
2830
},
@@ -33,6 +35,8 @@ describe("createStreamToolsArraySchema definitions", () => {
3335
properties: {
3436
forbidden: false,
3537
constructor: { type: "string" } satisfies JSONSchema7Definition,
38+
toString: { type: "boolean" } satisfies JSONSchema7Definition,
39+
valueOf: { type: "number" } satisfies JSONSchema7Definition,
3640
enabled: true,
3741
value: { enum: ["one", "two"], type: "string" },
3842
},

0 commit comments

Comments
 (0)