UEA-PRODEM
This commit is contained in:
+19
-12
@@ -95,6 +95,12 @@ function collectComments(execute, fullText) {
|
||||
function isJsxElementOrFragment(node) {
|
||||
return node.kind === ts9.SyntaxKind.JsxElement || node.kind === ts9.SyntaxKind.JsxFragment;
|
||||
}
|
||||
var [tsMajor, tsMinor] = ts9.versionMajorMinor.split(".").map((raw) => Number.parseInt(raw, 10));
|
||||
function isTsVersionAtLeast(major, minor = 0) {
|
||||
return tsMajor > major || tsMajor === major && tsMinor >= minor;
|
||||
}
|
||||
|
||||
// src/compilerOptions.ts
|
||||
function isCompilerOptionEnabled(options, option) {
|
||||
switch (option) {
|
||||
case "allowJs":
|
||||
@@ -133,7 +139,12 @@ function isCompilerOptionEnabled(options, option) {
|
||||
return options[option] === true;
|
||||
}
|
||||
function isStrictCompilerOptionEnabled(options, option) {
|
||||
return (options.strict ? options[option] !== false : options[option] === true) && (option !== "strictPropertyInitialization" || isStrictCompilerOptionEnabled(options, "strictNullChecks"));
|
||||
if (option === "strictPropertyInitialization") {
|
||||
if (!isStrictCompilerOptionEnabled(options, "strictNullChecks")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return options[option] ?? options.strict ?? isTsVersionAtLeast(6);
|
||||
}
|
||||
function isModifierFlagSet(node, flag) {
|
||||
return isFlagSet(ts9.getCombinedModifierFlags(node), flag);
|
||||
@@ -474,12 +485,6 @@ function isUnknownKeyword(node) {
|
||||
function isVoidKeyword(node) {
|
||||
return node.kind === ts9.SyntaxKind.VoidKeyword;
|
||||
}
|
||||
var [tsMajor, tsMinor] = ts9.versionMajorMinor.split(".").map((raw) => Number.parseInt(raw, 10));
|
||||
function isTsVersionAtLeast(major, minor = 0) {
|
||||
return tsMajor > major || tsMajor === major && tsMinor >= minor;
|
||||
}
|
||||
|
||||
// src/nodes/typeGuards/union.ts
|
||||
function hasDecorators(node) {
|
||||
return ts9.isParameter(node) || ts9.isPropertyDeclaration(node) || ts9.isMethodDeclaration(node) || ts9.isGetAccessorDeclaration(node) || ts9.isSetAccessorDeclaration(node) || ts9.isClassExpression(node) || ts9.isClassDeclaration(node);
|
||||
}
|
||||
@@ -1177,10 +1182,12 @@ function isReadonlyPropertyIntersection(type, name, typeChecker) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return !!// members of namespace import
|
||||
(isSymbolFlagSet(prop, ts9.SymbolFlags.ValueModule) || // we unwrapped every mapped type, now we can check the actual declarations
|
||||
// eslint-disable-next-line @typescript-eslint/no-deprecated -- Will be made private-only soon.
|
||||
symbolHasReadonlyDeclaration(prop, typeChecker));
|
||||
return (
|
||||
// members of namespace import
|
||||
isSymbolFlagSet(prop, ts9.SymbolFlags.ValueModule) || // we unwrapped every mapped type, now we can check the actual declarations
|
||||
// eslint-disable-next-line @typescript-eslint/no-deprecated -- Will be made private-only soon.
|
||||
symbolHasReadonlyDeclaration(prop, typeChecker)
|
||||
);
|
||||
});
|
||||
}
|
||||
function identifierToKeywordKind(node) {
|
||||
@@ -2086,7 +2093,7 @@ function isNamespaceExported(node) {
|
||||
return node.parent.kind === ts9.SyntaxKind.ModuleDeclaration || includesModifier(node.modifiers, ts9.SyntaxKind.ExportKeyword);
|
||||
}
|
||||
function namespaceHasExportStatement(ns) {
|
||||
if (ns.body === void 0 || ns.body.kind !== ts9.SyntaxKind.ModuleBlock) {
|
||||
if (ns.body?.kind !== ts9.SyntaxKind.ModuleBlock) {
|
||||
return false;
|
||||
}
|
||||
return containsExportStatement(ns.body);
|
||||
|
||||
Reference in New Issue
Block a user