2017-12-10 21:51:33 +01:00
# 2.13.0
2017-05-28 00:38:50 +02:00
2017-12-10 21:51:33 +01:00
**Features:**
* added support for `JsxFragment` introduced in typescript@2.6.2
* added corresponding typeguard functions
# 2.12.2
**Bugfixes:**
* `endsControlFlow`
* added missing logic for labeled statement, iteration statements and try-catch
* added missing logic for `break` and `continue` with labels
* take all jump statements into account, not only the last statement
* `isValidIdentifier` and `isValidNumericLiteral` handle irregular whitespace
* `findImports` searches in ambient modules inside regular `.ts` files (not only `.d.ts` )
* `canHaveJsDoc` is now a typeguard
# 2.12.1
2017-10-14 18:40:54 +02:00
**Bugfixes:**
* `forEachTokenWithTrivia`
* handles irregular whitespace and no longer visits some tokens twice
* correctly calculates the range of JsxText
2017-12-10 21:51:33 +01:00
# 2.12.0
2017-10-14 18:40:54 +02:00
**API-Changes:**
* deprecated `ImportOptions` if favor of the new `ImportKind` enum
2017-12-10 21:51:33 +01:00
# 2.11.2
2017-10-14 18:40:54 +02:00
**Bugfixes:**
* `parseJsDocOfNode` : set correct `pos` , `end` and `parent` properties. Also affects `getJsDoc` of `EndOfFileToken`
2017-12-10 21:51:33 +01:00
# 2.11.1
2017-10-14 18:40:54 +02:00
**Bugfixes:**
* `collectVariableUsage` : correctly consider catch binding as block scoped declaration inside catch block
2017-12-10 21:51:33 +01:00
# 2.11.0
2017-10-14 18:40:54 +02:00
**Bugfixes:**
* `getJsDoc` now correctly returns JsDoc for `EndOfFileToken`
**Features:**
* added utility `parseJsDocOfNode`
2017-12-10 21:51:33 +01:00
# 2.10.0
2017-10-14 18:40:54 +02:00
**Features:**
* added utility `findImports` to find all kinds of imports in a source file
2017-12-10 21:51:33 +01:00
# 2.9.0
2017-10-14 18:40:54 +02:00
**Features:**
* added typeguard `isMappedTypeNode`
* added utilities `canHaveJsDoc` and `getJsDoc`
2017-12-10 21:51:33 +01:00
# 2.8.2
2017-10-14 18:40:54 +02:00
**Bugfixes:**
* `collectVariableUsage` : handle global augmentation like other module augmentations
2017-12-10 21:51:33 +01:00
# 2.8.1
2017-10-14 18:40:54 +02:00
**Bugfixes:**
* Support `typescript@2.5.1` with optional catch binding
* `collectVariableUsage` fixed a bug where method decorator had method's parameters in scope
2017-12-10 21:51:33 +01:00
# 2.8.0
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
* Compatibility with the latest typescript nightly
* Added `getIdentifierText` to unescape identifiers across typescript versions
2017-12-10 21:51:33 +01:00
# 2.7.1
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
**Bugfixes:**
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
* `isReassignmentTarget` don't return `true` for right side of assignment
2017-12-10 21:51:33 +01:00
# 2.7.0
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
**Features:**
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
* Added `isReassignmentTarget` utility
2017-12-10 21:51:33 +01:00
# 2.6.1
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
**Bugfixes:**
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
* `getDeclarationDomain` now returns `undefined` for Parameter in IndexSignature
* `collectVariableUsage` ignores Parameter in IndexSignature
2017-12-10 21:51:33 +01:00
# 2.6.0
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
**Bugfixes:**
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
* `collectVariableUsage` :
* don't merge imports with global declarations
* treat everything in a declaration file as exported if there is no explicit `export {};`
* `isExpressionValueUsed` : handle destructuring in `for...of`
**Features:**
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
* Added `getModifier` utility
* Added `DeclarationDomain.Import` to distinguish imports from other declarations
2017-12-10 21:51:33 +01:00
# 2.5.1
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
**Bugfixes:**
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
* `collectVariableUsage` ignore jump labels as in `break label;`
2017-12-10 21:51:33 +01:00
# 2.5.0
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
**Bugfixes:**
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
* `isFunctionWithBody` handles constructor overload correctly.
**Features:**
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
* Implemented `isExpressionValueUsed` to check whether the result of an expression is actually used.
* Implemented `getDeclarationDomain` to determine if a given declaration introduces a new symbol in the value or type domain.
**`collectVariableUses` is now usable**
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
* no longer ignores signatures and its parameters
* don't merge declarations and uses across domains
* no longer marks exceptions in catch clause or parameter properties as exported
* fixed exports of namespaces
* fixed scoping of ClassExpression name
* correcly handle ambient namespaces and module augmentations
* fixed how `: typeof foo` is handled for parameters and function return type
* **still WIP**: `export {Foo as Bar}` inside ambient namespaces and modules
2017-12-10 21:51:33 +01:00
# 2.4.0
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
**Bugfixes:**
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
* `getLineRanges` : `contentLength` now contains the correct line length when there are multiple consecutive line break characters
* `getTokenAtPosition` : don't match tokens that end at the specified position (because that's already outside of their range)
* deprecated the misnamed `isModfierFlagSet` , use the new `isModifierFlagSet` instead
**Features:**
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
* Added typeguard: `isJsDoc`
* Added experimental scope and usage analysis (`getUsageDomain` and `collectVariableUsage` )
2017-12-10 21:51:33 +01:00
# 2.3.0
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
**Bugfixes:**
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
* `forEachComment` no longer omits some comments when callback returns a truthy value
* `isPositionInComment` fixed false positive inside JSXText
**Features:**
2017-10-14 18:40:54 +02:00
2017-08-14 05:01:11 +02:00
* Added utility: `getCommentAtPosition`
2017-12-10 21:51:33 +01:00
# 2.2.0
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Bugfixes:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* Fixed bit value of `SideEffectOptions.JsxElement` to be a power of 2
**Features:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* Added utilities: `getTokenAtPosition` and `isPositionInComment`
2017-12-10 21:51:33 +01:00
# 2.1.0
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Features:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* Added typeguard `isExpression`
* Added utilities: `hasSideEffects` , `getDeclarationOfBindingElement`
2017-12-10 21:51:33 +01:00
# 2.0.0
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Breaking Changes:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* Dropped compatibility with `typescript@<2.1.0`
* Removed misnamed `isNumericliteral` , use `isNumericLiteral` instead (notice the uppercase L)
* Removed `isEnumLiteralType` which will cause compile errors with typescript@2.4.0
* Refactored directory structure: all imports that referenced subdirectories (e.g. `require('tsutils/src/typeguard')` will be broken
**Features:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* New directory structure allows imports of typeguards or utils independently, e.g. (`require('tsutils/typeguard')`)
2017-12-10 21:51:33 +01:00
# 1.9.1
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Bugfixes:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* `isObjectFlagSet` now uses the correct `objectFlags` property
2017-12-10 21:51:33 +01:00
# 1.9.0
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Bugfixes:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* `getNextToken` no longer omits `EndOfFileToken` when there is no trivia before EOF. That means the only inputs where `getNextToken` returns `undefined` are `SourceFile` and `EndOfFileToken`
**Features**:
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* Added typeguards for types
2017-08-14 05:01:11 +02:00
* Added utilities for flag checking: `isNodeFlagSet` , `isTypeFlagSet` , `isSymbolFlagSet` ,`isObjectFlagSet`, `isModifierFlagSet`
2017-05-28 00:38:50 +02:00
2017-12-10 21:51:33 +01:00
# 1.8.0
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Features:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* Support peer dependency of typescript nightlies of 2.4.0
* Added typeguards: `isJsxAttributes` , `isIntersectionTypeNode` , `isTypeOperatorNode` , `isTypePredicateNode` , `isTypeQueryNode` , `isUnionTypeNode`
2017-12-10 21:51:33 +01:00
# 1.7.0
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Bugfixes:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* `isFunctionScopeBoundary` now handles Interfaces, TypeAliases, FunctionSignatures, etc
**Features:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* Added utilities: `isThisParameter` , `isSameLine` and `isFunctionWithBody`
2017-12-10 21:51:33 +01:00
# 1.6.0
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Features:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* Add `isValidPropertyAccess` , `isValidNumericLiteral` and `isValidPropertyName`
2017-12-10 21:51:33 +01:00
# 1.5.0
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Features:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* Add `isValidIdentifier`
2017-12-10 21:51:33 +01:00
# 1.4.0
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Features:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* Add `contentLength` property to the result of `getLineRanges`
2017-12-10 21:51:33 +01:00
# 1.3.0
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Bugfixes:**
2017-10-14 18:40:54 +02:00
* `canHaveLeadingTrivia` :
2017-05-28 00:38:50 +02:00
* Fix property access on undefined parent reference
2017-10-14 18:40:54 +02:00
* Fixes: [palantir/tslint#2330 ](https://github.com/palantir/tslint/issues/2330 )
* `hasOwnThisReference` : now includes accessors on object literals
2017-05-28 00:38:50 +02:00
**Features:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* Typeguards:
* isTypeParameterDeclaration
* isEnitityName
2017-12-10 21:51:33 +01:00
# 1.2.2
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Bugfixes:**
2017-10-14 18:40:54 +02:00
* `hasOwnThisReference` :
2017-05-28 00:38:50 +02:00
* exclude overload signatures of function declarations
* add method declarations on object literals
2017-12-10 21:51:33 +01:00
# 1.2.1
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Bugfixes:**
2017-10-14 18:40:54 +02:00
* Fix name of `isNumericLiteral`
2017-05-28 00:38:50 +02:00
2017-12-10 21:51:33 +01:00
# 1.2.0
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Features:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* Typeguards:
* isEnumMember
* isExpressionWithTypeArguments
* isImportSpecifier
* Utilities:
* isJsDocKind, isTypeNodeKind
* Allow typescript@next in peerDependencies
2017-12-10 21:51:33 +01:00
# 1.1.0
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Bugfixes:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* Fix isBlockScopeBoundary: Remove WithStatement, IfStatment, DoStatement and WhileStatement because they are no scope boundary whitout a block.
**Features:**
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
* Added more typeguards:
* isAssertionExpression
* isEmptyStatement
* isJsxAttributeLike
* isJsxOpeningLikeElement
* isNonNullExpression
* isSyntaxList
* Utilities:
* getNextToken, getPreviousToken
* hasOwnThisReference
* getLineRanges
2017-12-10 21:51:33 +01:00
# 1.0.0
2017-10-14 18:40:54 +02:00
2017-05-28 00:38:50 +02:00
**Features:**
* Initial implementation of typeguards
* Utilities:
* getChildOfKind
* isNodeKind, isAssignmentKind
* hasModifier, isParameterProperty, hasAccessModifier
* getPreviousStatement, getNextStatement
* getPropertyName
* forEachDestructuringIdentifier, forEachDeclaredVariable
* getVariableDeclarationKind, isBlockScopedVariableDeclarationList, isBlockScopedVariableDeclaration
* isScopeBoundary, isFunctionScopeBoundary, isBlockScopeBoundary
* forEachToken, forEachTokenWithTrivia, forEachComment
2017-08-14 05:01:11 +02:00
* endsControlFlow