Socket
Socket
Sign inDemoInstall

tsutils

Package Overview
Dependencies
2
Maintainers
1
Versions
94
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
2345
10Next

3.21.0

Diff

ajaff
published 3.20.0 •

Changelog

Source

3.20.0

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
ajaff
published 3.19.1 •

Changelog

Source

3.19.1

Bugfixes:

  • getSymbolOfClassLikeDeclaration no longer crashes on anonymous mixin classes
ajaff
published 3.19.0 •

Changelog

Source

3.19.0

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
ajaff
published 3.18.0 •

Changelog

Source

3.18.0

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 TypeScript@3.7
    • 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
ajaff
published 3.17.1 •

Changelog

Source

3.17.1

Bugfixes:

  • isValidJsxIdentifier, isValidPropertyAccess, isValidPropertyName: fix unicode character width handling
ajaff
published 3.17.0 •

Changelog

Source

3.17.0

Features:

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

Bugfixes:

  • isValidJsxIdentifier now handles astral plane characters
ajaff
published 3.16.0 •

Changelog

Source

3.16.0

Features:

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

Changelog

Source

3.15.0

Features:

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

Bugfixes:

  • isValidPropertyName, isValidPropertyAccess now handle astral plane characters
ajaff
published 3.14.1 •

Changelog

Source

3.14.1

Bugfixes:

  • findImports: fixed crash on nested namespaces
2345
10Next
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc