@typescript-eslint/type-utils
Advanced tools
Comparing version 5.9.2-alpha.26 to 5.9.2-alpha.27
@@ -154,2 +154,16 @@ "use strict"; | ||
} | ||
if ((0, tsutils_1.isIntersectionType)(type)) { | ||
// Special case for handling arrays/tuples (as readonly arrays/tuples always have mutable methods). | ||
if (type.types.some(t => checker.isArrayType(t) || checker.isTupleType(t))) { | ||
const allReadonlyParts = type.types.every(t => seenTypes.has(t) || | ||
isTypeReadonlyRecurser(checker, t, options, seenTypes) === | ||
3 /* Readonly */); | ||
return allReadonlyParts ? 3 /* Readonly */ : 2 /* Mutable */; | ||
} | ||
// Normal case. | ||
const isReadonlyObject = isTypeReadonlyObject(checker, type, options, seenTypes); | ||
if (isReadonlyObject !== 1 /* UnknownType */) { | ||
return isReadonlyObject; | ||
} | ||
} | ||
if ((0, tsutils_1.isConditionalType)(type)) { | ||
@@ -166,3 +180,3 @@ const result = [type.root.node.trueType, type.root.node.falseType] | ||
// this should only be primitive types | ||
if (!(0, tsutils_1.isObjectType)(type) && !(0, tsutils_1.isUnionOrIntersectionType)(type)) { | ||
if (!(0, tsutils_1.isObjectType)(type)) { | ||
return 3 /* Readonly */; | ||
@@ -169,0 +183,0 @@ } |
{ | ||
"name": "@typescript-eslint/type-utils", | ||
"version": "5.9.2-alpha.26+39a6806c", | ||
"version": "5.9.2-alpha.27+50468820", | ||
"description": "Type utilities for working with TypeScript + ESLint together", | ||
@@ -42,3 +42,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@typescript-eslint/utils": "5.9.2-alpha.26+39a6806c", | ||
"@typescript-eslint/utils": "5.9.2-alpha.27+50468820", | ||
"debug": "^4.3.2", | ||
@@ -48,3 +48,3 @@ "tsutils": "^3.21.0" | ||
"devDependencies": { | ||
"@typescript-eslint/parser": "5.9.2-alpha.26+39a6806c", | ||
"@typescript-eslint/parser": "5.9.2-alpha.27+50468820", | ||
"typescript": "*" | ||
@@ -71,3 +71,3 @@ }, | ||
}, | ||
"gitHead": "39a6806c61a48bbca93f9ffb965dd8b3fe0575b3" | ||
"gitHead": "5046882025e3bc8cb122ecef703aebd0b5e79017" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
71320
1002