Skip to content

Commit 6f49885

Browse files
committed
sqlite: fix doc-kit crash and fill in DEP0210 pr-url
lib/sqlite.js used object-spread (`...sqlite`) to re-export the internal binding, which crashed tools/doc's api-links generator: it walks module.exports's ObjectExpression properties expecting a `value` on each one, and a SpreadElement has no such property (TypeError: Cannot read properties of undefined (reading 'type')). This broke the "Build from tarball" CI job. Destructure the binding's exports into bare identifiers instead, matching the pattern already used in lib/crypto.js for its deprecated Hash/Hmac exports. Also fill in the DEP0210 changes entry's pr-url, now that the pull request exists. Assisted-by: claude-code:claude-sonnet-5 Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
1 parent f4036c3 commit 6f49885

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

‎doc/api/deprecations.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4806,6 +4806,7 @@ async function example() {
48064806
<!-- YAML
48074807
changes:
48084808
- version: REPLACEME
4809+
pr-url: https://github.com/nodejs/node/pull/65988
48094810
description: Runtime deprecation.
48104811
-->
48114812

‎lib/sqlite.js‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,22 @@
22

33
const { deprecate } = require('internal/util');
44

5-
const sqlite = internalBinding('sqlite');
5+
const {
6+
Database,
7+
StatementSync,
8+
Session,
9+
constants,
10+
backup,
11+
} = internalBinding('sqlite');
612

713
module.exports = {
8-
...sqlite,
14+
Database,
915
DatabaseSync: deprecate(
10-
sqlite.Database,
16+
Database,
1117
'sqlite.DatabaseSync is deprecated, use sqlite.Database instead.',
1218
'DEP0210'),
19+
StatementSync,
20+
Session,
21+
constants,
22+
backup,
1323
};

0 commit comments

Comments
 (0)