mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-27 06:43:19 +08:00
Format the declaration reads changed in #1426
oxfmt joins the .some(...) calls onto the declarations reads, so format:check passes again.
This commit is contained in:
@@ -3195,8 +3195,9 @@ export class Lowerer {
|
||||
const symbol = part.getSymbol();
|
||||
return (
|
||||
(symbol?.name === "WeakMap" || symbol?.name === "WeakSet") &&
|
||||
symbol.declarations
|
||||
.some((d) => ts.isInterfaceDeclaration(d) && this.isStdlibFile(d.getSourceFile()))
|
||||
symbol.declarations.some(
|
||||
(d) => ts.isInterfaceDeclaration(d) && this.isStdlibFile(d.getSourceFile()),
|
||||
)
|
||||
);
|
||||
};
|
||||
if (!type.isUnionType()) return weak(type);
|
||||
|
||||
@@ -1360,8 +1360,9 @@ export function mapAsyncGeneratorAnnotation(type: ts.Type, ctx: TypeMapperCtx):
|
||||
if (
|
||||
!symbol ||
|
||||
!["AsyncIterator", "AsyncIterableIterator", "AsyncIterable"].includes(symbol.name) ||
|
||||
!symbol.declarations
|
||||
.some((d) => ts.isInterfaceDeclaration(d) && ctx.isStdlibFile(d.getSourceFile()))
|
||||
!symbol.declarations.some(
|
||||
(d) => ts.isInterfaceDeclaration(d) && ctx.isStdlibFile(d.getSourceFile()),
|
||||
)
|
||||
)
|
||||
return null;
|
||||
const args = checker.getTypeArguments(type as ts.TypeReference);
|
||||
@@ -2504,12 +2505,11 @@ function mapTypeInner(type: ts.Type, ctx: TypeMapperCtx): IrType | null {
|
||||
if (
|
||||
psym &&
|
||||
WEBCRYPTO_DYN_TYPES.has(psym.name) &&
|
||||
psym.declarations
|
||||
.some(
|
||||
(d) =>
|
||||
(ts.isClassDeclaration(d) || ts.isInterfaceDeclaration(d)) &&
|
||||
ctx.isStdlibFile(d.getSourceFile()),
|
||||
)
|
||||
psym.declarations.some(
|
||||
(d) =>
|
||||
(ts.isClassDeclaration(d) || ts.isInterfaceDeclaration(d)) &&
|
||||
ctx.isStdlibFile(d.getSourceFile()),
|
||||
)
|
||||
) {
|
||||
return DYN;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user