NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #1816 most downloaded on npm
utilities for working with typescript's AST
Last release 6 years ago
no release in 18 months
Ships unpredictably
gaps range from 9 days to 1.4 years
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
94 releases · first in 2017
deprecated ImportOptions if favor of the new ImportKind enum
API-Changes:
ImportOptions if favor of the new ImportKind enumparseJsDocOfNode: set correct pos, end and parent properties. Also affects getJsDoc of EndOfFileToken
Bugfixes:
parseJsDocOfNode: set correct pos, end and parent properties. Also affects getJsDoc of EndOfFileTokenOne column per quarter.
collectVariableUsage: correctly consider catch binding as block scoped declaration inside catch block
Bugfixes:
collectVariableUsage: correctly consider catch binding as block scoped declaration inside catch blockgetJsDoc now correctly returns JsDoc for EndOfFileToken
Bugfixes:
getJsDoc now correctly returns JsDoc for EndOfFileTokenFeatures:
parseJsDocOfNodeadded utility findImports to find all kinds of imports in a source file
Features:
findImports to find all kinds of imports in a source fileadded typeguard isMappedTypeNode
Features:
isMappedTypeNodecanHaveJsDoc and getJsDoccollectVariableUsage: handle global augmentation like other module augmentations
Bugfixes:
collectVariableUsage: handle global augmentation like other module augmentationsSupport typescript@2.5.1 with optional catch binding
Bugfixes:
typescript@2.5.1 with optional catch bindingcollectVariableUsage fixed a bug where method decorator had method's parameters in scopeCompatibility with the latest typescript nightly
getIdentifierText to unescape identifiers across typescript versionsisReassignmentTarget don't return true for right side of assignment
Bugfixes:
isReassignmentTarget don't return true for right side of assignmentAdded isReassignmentTarget utility
Features:
isReassignmentTarget utilitygetDeclarationDomain now returns undefined for Parameter in IndexSignature
Bugfixes:
getDeclarationDomain now returns undefined for Parameter in IndexSignaturecollectVariableUsage ignores Parameter in IndexSignaturedon't merge imports with global declarations
Bugfixes:
collectVariableUsage:
export {};isExpressionValueUsed: handle destructuring in for...ofFeatures:
getModifier utilityDeclarationDomain.Import to distinguish imports from other declarationscollectVariableUsage ignore jump labels as in break label;
Bugfixes:
collectVariableUsage ignore jump labels as in break label;isFunctionWithBody handles constructor overload correctly.
Bugfixes:
isFunctionWithBody handles constructor overload correctly.Features:
isExpressionValueUsed to check whether the result of an expression is actually used.getDeclarationDomain to determine if a given declaration introduces a new symbol in the value or type domain.collectVariableUses is now usable
: typeof foo is handled for parameters and function return typeexport {Foo as Bar} inside ambient namespaces and modulesdeprecated the misnamed isModfierFlagSet, use the new isModifierFlagSet instead
Bugfixes:
getLineRanges: contentLength now contains the correct line length when there are multiple consecutive line break charactersgetTokenAtPosition: don't match tokens that end at the specified position (because that's already outside of their range)isModfierFlagSet, use the new isModifierFlagSet insteadFeatures:
isJsDocgetUsageDomain and collectVariableUsage)forEachComment no longer omits some comments when callback returns a truthy value
Bugfixes:
forEachComment no longer omits some comments when callback returns a truthy valueisPositionInComment fixed false positive inside JSXTextFeatures:
getCommentAtPositionFixed bit value of SideEffectOptions.JsxElement to be a power of 2
Bugfixes:
SideEffectOptions.JsxElement to be a power of 2Features:
getTokenAtPosition and isPositionInCommentAdded utilities: hasSideEffects, getDeclarationOfBindingElement
Features:
isExpressionhasSideEffects, getDeclarationOfBindingElementDropped compatibility with typescript@<2.1.0
Breaking Changes:
typescript@<2.1.0isNumericliteral, use isNumericLiteral instead (notice the uppercase L)isEnumLiteralType which will cause compile errors with typescript@2.4.0require('tsutils/src/typeguard') will be brokenFeatures:
require('tsutils/typeguard'))isObjectFlagSet now uses the correct objectFlags property
Bugfixes:
isObjectFlagSet now uses the correct objectFlags propertygetNextToken no longer omits EndOfFileToken when there is no trivia before EOF. That means the only inputs where getNextToken returns undefined are So
Bugfixes:
getNextToken no longer omits EndOfFileToken when there is no trivia before EOF. That means the only inputs where getNextToken returns undefined are SourceFile and EndOfFileTokenFeatures:
isNodeFlagSet, isTypeFlagSet, isSymbolFlagSet,isObjectFlagSet, isModifierFlagSetSupport peer dependency of typescript nightlies of 2.4.0
Features:
isJsxAttributes, isIntersectionTypeNode, isTypeOperatorNode, isTypePredicateNode, isTypeQueryNode, isUnionTypeNodeisFunctionScopeBoundary now handles Interfaces, TypeAliases, FunctionSignatures, etc
Bugfixes:
isFunctionScopeBoundary now handles Interfaces, TypeAliases, FunctionSignatures, etcFeatures:
isThisParameter, isSameLine and isFunctionWithBodyAdd isValidPropertyAccess, isValidNumericLiteral and isValidPropertyName
Features:
isValidPropertyAccess, isValidNumericLiteral and isValidPropertyNameFeatures: * Add isValidIdentifier
Features:
isValidIdentifierAdd contentLength property to the result of getLineRanges
Features:
contentLength property to the result of getLineRangesFix property access on undefined parent reference
Bugfixes:
canHaveLeadingTrivia:
hasOwnThisReference: now includes accessors on object literalsFeatures:
exclude overload signatures of function declarations
Bugfixes:
hasOwnThisReference:
Bugfixes: * Fix name of isNumericLiteral
Bugfixes:
isNumericLiteralAllow typescript@next in peerDependencies
Features:
Fix isBlockScopeBoundary: Remove WithStatement, IfStatment, DoStatement and WhileStatement because they are no scope boundary whitout a block.
Bugfixes:
Features:
Initial implementation of typeguards
Features:
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →