mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
fix(ext/ffi): unexport brand from dts (#28503)
This is technically **BREAKING** as it removes a public API, but the brand is type-only and the chance of anyone actually relying on this seems very unlikely. --------- Co-authored-by: David Sherret <dsherret@gmail.com>
This commit is contained in:
parent
f44329fc56
commit
56282c1d9f
2 changed files with 9 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env -S deno run --allow-read --allow-env --allow-sys --config=tests/config/deno.json
|
||||
// Copyright 2018-2025 the Deno authors. MIT license.
|
||||
import { Node, Project, ts } from "npm:ts-morph@22.0.0";
|
||||
import { Node, Project, ts } from "npm:ts-morph@25.0.1";
|
||||
import { join, ROOT_PATH } from "./util.js";
|
||||
|
||||
const libs = [
|
||||
|
@ -50,7 +50,7 @@ for (const file of project.getSourceFiles()) {
|
|||
node.getKind() === ts.SyntaxKind.TypeAliasDeclaration;
|
||||
|
||||
if (parent) {
|
||||
if (!node.isExported()) {
|
||||
if (!node.isExported() && !isBrandVarStmt(node)) {
|
||||
errors.push(getMissingErrorPrefix(node) + "export keyword");
|
||||
continue;
|
||||
}
|
||||
|
@ -87,6 +87,12 @@ if (errors.length > 0) {
|
|||
throw new AggregateError(errors);
|
||||
}
|
||||
|
||||
function isBrandVarStmt(node) {
|
||||
// this variable statement is intentionally private
|
||||
return Node.isVariableStatement(node) &&
|
||||
node.getDeclarations()[0].getName() === "brand";
|
||||
}
|
||||
|
||||
function getMissingErrorPrefix(node) {
|
||||
return getErrorPrefix(node) + `is missing a `;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue