UEA-PRODEM
This commit is contained in:
+19
-12
@@ -101,6 +101,12 @@ function collectComments(execute, fullText) {
|
||||
function isJsxElementOrFragment(node) {
|
||||
return node.kind === ts9__default.default.SyntaxKind.JsxElement || node.kind === ts9__default.default.SyntaxKind.JsxFragment;
|
||||
}
|
||||
var [tsMajor, tsMinor] = ts9__default.default.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":
|
||||
@@ -139,7 +145,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__default.default.getCombinedModifierFlags(node), flag);
|
||||
@@ -480,12 +491,6 @@ function isUnknownKeyword(node) {
|
||||
function isVoidKeyword(node) {
|
||||
return node.kind === ts9__default.default.SyntaxKind.VoidKeyword;
|
||||
}
|
||||
var [tsMajor, tsMinor] = ts9__default.default.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__default.default.isParameter(node) || ts9__default.default.isPropertyDeclaration(node) || ts9__default.default.isMethodDeclaration(node) || ts9__default.default.isGetAccessorDeclaration(node) || ts9__default.default.isSetAccessorDeclaration(node) || ts9__default.default.isClassExpression(node) || ts9__default.default.isClassDeclaration(node);
|
||||
}
|
||||
@@ -1183,10 +1188,12 @@ function isReadonlyPropertyIntersection(type, name, typeChecker) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return !!// members of namespace import
|
||||
(isSymbolFlagSet(prop, ts9__default.default.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__default.default.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) {
|
||||
@@ -2092,7 +2099,7 @@ function isNamespaceExported(node) {
|
||||
return node.parent.kind === ts9__default.default.SyntaxKind.ModuleDeclaration || includesModifier(node.modifiers, ts9__default.default.SyntaxKind.ExportKeyword);
|
||||
}
|
||||
function namespaceHasExportStatement(ns) {
|
||||
if (ns.body === void 0 || ns.body.kind !== ts9__default.default.SyntaxKind.ModuleBlock) {
|
||||
if (ns.body?.kind !== ts9__default.default.SyntaxKind.ModuleBlock) {
|
||||
return false;
|
||||
}
|
||||
return containsExportStatement(ns.body);
|
||||
|
||||
+4
-1
@@ -1997,7 +1997,7 @@ declare function isVariableLikeDeclaration(node: ts.Node): node is ts.VariableLi
|
||||
* ```ts
|
||||
* declare const node: ts.Node;
|
||||
*
|
||||
* if (isFunctionScopeBoundary(node, ts.ObjectFlags.Anonymous)) {
|
||||
* if (isFunctionScopeBoundary(node)) {
|
||||
* // ...
|
||||
* }
|
||||
* ```
|
||||
@@ -2824,6 +2824,7 @@ declare function isUniqueESSymbolType(type: ts.Type): type is ts.UniqueESSymbolT
|
||||
*/
|
||||
declare function intersectionConstituents(type: ts.Type): ts.Type[];
|
||||
/**
|
||||
* @alias intersectionConstituents
|
||||
* @deprecated Use {@link intersectionConstituents} instead.
|
||||
* @category Types - Utilities
|
||||
* ```
|
||||
@@ -2947,6 +2948,7 @@ declare function typeConstituents(type: ts.Type): ts.Type[];
|
||||
*/
|
||||
declare function typeIsLiteral(type: ts.Type): type is ts.LiteralType;
|
||||
/**
|
||||
* @alias typeConstituents
|
||||
* @deprecated Use {@link typeConstituents} instead.
|
||||
* @category Types - Utilities
|
||||
*/
|
||||
@@ -2967,6 +2969,7 @@ declare const typeParts: typeof typeConstituents;
|
||||
*/
|
||||
declare function unionConstituents(type: ts.Type): ts.Type[];
|
||||
/**
|
||||
* @alias unionConstituents
|
||||
* @deprecated Use {@link unionConstituents} instead.
|
||||
* @category Types - Utilities
|
||||
*/
|
||||
|
||||
+4
-1
@@ -1997,7 +1997,7 @@ declare function isVariableLikeDeclaration(node: ts.Node): node is ts.VariableLi
|
||||
* ```ts
|
||||
* declare const node: ts.Node;
|
||||
*
|
||||
* if (isFunctionScopeBoundary(node, ts.ObjectFlags.Anonymous)) {
|
||||
* if (isFunctionScopeBoundary(node)) {
|
||||
* // ...
|
||||
* }
|
||||
* ```
|
||||
@@ -2824,6 +2824,7 @@ declare function isUniqueESSymbolType(type: ts.Type): type is ts.UniqueESSymbolT
|
||||
*/
|
||||
declare function intersectionConstituents(type: ts.Type): ts.Type[];
|
||||
/**
|
||||
* @alias intersectionConstituents
|
||||
* @deprecated Use {@link intersectionConstituents} instead.
|
||||
* @category Types - Utilities
|
||||
* ```
|
||||
@@ -2947,6 +2948,7 @@ declare function typeConstituents(type: ts.Type): ts.Type[];
|
||||
*/
|
||||
declare function typeIsLiteral(type: ts.Type): type is ts.LiteralType;
|
||||
/**
|
||||
* @alias typeConstituents
|
||||
* @deprecated Use {@link typeConstituents} instead.
|
||||
* @category Types - Utilities
|
||||
*/
|
||||
@@ -2967,6 +2969,7 @@ declare const typeParts: typeof typeConstituents;
|
||||
*/
|
||||
declare function unionConstituents(type: ts.Type): ts.Type[];
|
||||
/**
|
||||
* @alias unionConstituents
|
||||
* @deprecated Use {@link unionConstituents} instead.
|
||||
* @category Types - Utilities
|
||||
*/
|
||||
|
||||
+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