Skip to content

Releases: ajafff/tsutils

v3.21.0

07 Mar 17:26
Compare
Choose a tag to compare

Features:

  • added getWellKnownSymbolPropertyOfType to reliably get symbol named properties due to changes in [email protected]
  • getPropertyNameOfWellKnownSymbol is now deprecated

v3.20.0

25 Jan 15:45
Compare
Choose a tag to compare

Features:

  • findImports and findImportLikeNodes take an additional parameter ignoreFileName. The default value for this paramter is true to remain backwards compatible. When set to false, it matches the behavior of TypeScript, i.e. only looks for require in JavaScript files.

Bugfixes:

  • getJsDoc for EndOfFileToken now returns JSDoc comments whose contents are usable with the type checker

v3.19.1

09 Jan 10:33
Compare
Choose a tag to compare

Bugfixes:

  • getSymbolOfClassLikeDeclaration no longer crashes on anonymous mixin classes

v3.19.0

06 Jan 18:49
Compare
Choose a tag to compare

Features:

  • getSymbolOfClassLikeDeclaration to retrieve the symbol of class declarations and expressions regardless whether they have a name or not
  • getBaseOfClassLikeDeclaration to conventiently get the expression after extends
  • getBaseClassMemberOfClassElement to look up the declaration of a class member in the base class

Bugfixes:

  • getConstructorTypeOfClassLikeDeclaration now really returns the constructor type (the static side of the class), previously it returned the instance type
  • hasExhaustiveCaseClauses allows additional case clauses with null, undefined and never

v3.18.0

03 Jan 20:19
Compare
Choose a tag to compare

Features:

  • Source maps for easier debugging
  • JSDoc is preserved in declaration files
  • Comments are presered in transpiled code
  • Everything you need to handle the control flow changes of [email protected]
    • callExpressionAffectsControlFlow to determine whether a CallExpression affects control flow by returning never or asserts
    • hasExhaustiveCaseClauses to determine whether a SwitchStatement's CaseClauses handle every possible value
    • endsControlFlow and getControlFlowEnd take an optional checker parameter to recognize exhaustive SwitchStatements and control flow effects of CallExpressions
  • formatPseudoBigInt converts TypeScript's representation of a BigInt to its literal representation as you would write it in your source code
  • getAstNodeAtPosition similar to getTokenAtPosition, but only operates on AST Nodes
  • removeOptionalChainingUndefinedMarkerType and isOptionalChainingUndefinedMarkerType to handle types originating in an optional chain
  • findImports and findImportLikeNodes: prepare for import assertions
  • getTsCheckDirective as new name for getCheckJsDirective
  • getCheckJsDirective is now deprecated

Bugfixes:

  • getUsageDomain: handles NamespaceExport and NamedTupleMember
  • getPropertyName: handles parentheses and negative numeric literals, excludes RegExp literals and private identifiers
  • getSingleLateBoundPropertyNameOfPropertyName and getLateBoundPropertyNamesOfPropertyName: handles private identifiers
  • hasAccessModifier: handles JSDoc access modifier
  • hasSideEffects: correctly determines side effects of (static) property initializers
  • isExpressionValueUsed: handle nullish coalescing and conditional assignment operators
  • canHaveJsDoc: aligned with upstream changes in TypeScript
  • isCompilerOptionEnabled:
    • noUncheckedIndexedAccess requires strictNullChecks
    • checkJs implies allowJs
    • emitDeclarationOnly requires declaration
  • isInConstContext: handle template string interpolations
  • excluded unnecessary files from npm package

v3.17.1

07 Aug 12:02
Compare
Choose a tag to compare

Bugfixes:

  • isValidJsxIdentifier, isValidPropertyAccess, isValidPropertyName: fix unicode character width handling

v3.17.0

05 Aug 19:53
Compare
Choose a tag to compare

Features:

  • isValidJsxIdentifier added an optional parameter to specify the target ECMAScript version

Bugfixes:

  • isValidJsxIdentifier now handles astral plane characters

v3.16.0

05 Aug 15:26
Compare
Choose a tag to compare

Features:

  • added getIteratorYieldResultFromIteratorResult to extract the yielded type from IteratorResult<TYield, TReturn, TNext>

v3.15.0

04 Aug 18:53
Compare
Choose a tag to compare

Features:

  • isValidIdentifier, isValidPropertyName, isValidPropertyAccess, isValidNumericLiteral added an optional parameter to specify the target ECMAScript version

Bugfixes:

  • isValidPropertyName, isValidPropertyAccess now handle astral plane characters

v3.14.1

25 Jul 13:13
Compare
Choose a tag to compare

Bugfixes:

  • findImports: fixed crash on nested namespaces