|
sfcode
An Online Competing and Development Environment
|
Features:
isCompilerOptionEnabledTypeguards are now split into multiple submodules for each version of TypeScript (starting with 2.8.0). That means you can now import directly from "tsutils/typeguard/2.8" to get compatible declaraton files for TypeScript@2.8. For more information please read the relevant section in README.md.
Features:
isTupleType, isOptionalTypeNode, isRestTypeNode, isSyntheticExpression (currently available from "tsutils/typeguard/3.0")isStrictCompilerOptionEnabledAvoid crash caused by removed function in typescript@3.0.0.
Added support for TypeScript@3.0.0 nightly builds.
Features:
getIIFE utilityBugfixes:
forEachComment and forEachTokenWithTrivia no longer duplicate comments around missing nodesBugfixes:
hasSideEffects with tagged template literal without substitution: tag`template`Features:
isLiteralTypeNode) tofindImportsviaImportKind.ImportType`Bugfixes:
collectVariableUsage: fixed name lookup in function signatures to match runtime behavior. Note that this is not completely fixed in TypeScript, yet. See: Microsoft/TypeScript#22825 and Microsoft/TypeScript#22769Features:
isStatementInAmbientContext and isAmbientModuleBlockFeatures:
isConditionalTypeNode, isInferTypeNode, isConditionalType, isInstantiableType, isSubstitutionTypeFeatures:
isForInOrOfStatementBugfixes:
<MyComponent<string>/*comment*/></MyComponent><div><br/>/*no comment*/</div>Bugfixes:
collectVariableUsage: handle ConditionalTypes and infer T, which will be introduced in TypeScript@2.8.0 and are already available in nightly buildsisLiteralType no longer returns true for ts.TypeFlags.BooleanLiteral as this is not a ts.LiteralTypeBugfixes:
endsControlFlow:Features:
isFalsyType utilityBugfixes:
typescript@2.8.0-devBugfixes:
isReassignmentTarget: handle type assertions and non-null assertionBugfixes:
forEachDeclaredVariable uses a more precise type for the callback parameter to make it useable again with typescript@2.7.1Features:
isUniqueESSymbolType typeguardFeatures:
isThenableType utilityunionTypeParts utilityBugfixes:
forEachComment, getCommentAtPosition and isPositionInComment: skip shebang (#! something) to not miss following comments at the start of the fileFeatures:
WrappedAst interface that models the type of a wrapped SourceFile more accurategetWrappedNodeAtPosition utiltiy that takes a NodeWrap and returns the most deeply nested NodeWrap that contains the given positionFeatures:
getControlFlowEnd accepts BlockLike as argumentBugfixes:
getControlFlowEnd and endsControlFlow: correctly handle nested LabeledStatementsendsControlFlow removed erroneous special case when an IterationStatement is passed as argument whose parent is a LabeledStatement.Deprecations:
getControlFlowEnd that contains the label parameter. This parameter is no longer used and should no longer be passed to the function.Bugfixes:
getControlFlowEnd and endsControlFlow (#22)try are filtered out if there is a catch clausecatch only end control flow if try AND catch definitely end control flowFeatures:
kind property to NodeWrapgetControlFlowEnd to public APIFeatures:
isDecorator and isCallLikeExpression typeguardsFeatures:
convertAst utility to produce a flattened and wrapped version of the ASTFeatures:
isDeleteExpressiongetLineBreakStyleBugfixes:
isJsxFragmentFeatures:
JsxFragment introduced in typescript@2.6.2Bugfixes:
endsControlFlowbreak and continue with labelsisValidIdentifier and isValidNumericLiteral handle irregular whitespacefindImports searches in ambient modules inside regular .ts files (not only .d.ts)canHaveJsDoc is now a typeguardBugfixes:
forEachTokenWithTriviaAPI-Changes:
ImportOptions if favor of the new ImportKind enumBugfixes:
parseJsDocOfNode: set correct pos, end and parent properties. Also affects getJsDoc of EndOfFileTokenBugfixes:
collectVariableUsage: correctly consider catch binding as block scoped declaration inside catch blockBugfixes:
getJsDoc now correctly returns JsDoc for EndOfFileTokenFeatures:
parseJsDocOfNodeFeatures:
findImports to find all kinds of imports in a source fileFeatures:
isMappedTypeNodecanHaveJsDoc and getJsDocBugfixes:
collectVariableUsage: handle global augmentation like other module augmentationsBugfixes:
typescript@2.5.1 with optional catch bindingcollectVariableUsage fixed a bug where method decorator had method's parameters in scopegetIdentifierText to unescape identifiers across typescript versionsBugfixes:
isReassignmentTarget don't return true for right side of assignmentFeatures:
isReassignmentTarget utilityBugfixes:
getDeclarationDomain now returns undefined for Parameter in IndexSignaturecollectVariableUsage ignores Parameter in IndexSignatureBugfixes:
collectVariableUsage:export {};isExpressionValueUsed: handle destructuring in for...ofFeatures:
getModifier utilityDeclarationDomain.Import to distinguish imports from other declarationsBugfixes:
collectVariableUsage ignore jump labels as in break label;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 modulesBugfixes:
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)Bugfixes:
forEachComment no longer omits some comments when callback returns a truthy valueisPositionInComment fixed false positive inside JSXTextFeatures:
getCommentAtPositionBugfixes:
SideEffectOptions.JsxElement to be a power of 2Features:
getTokenAtPosition and isPositionInCommentFeatures:
isExpressionhasSideEffects, getDeclarationOfBindingElementBreaking Changes:
typescript@<2.1.0isNumericliteral, use isNumericLiteral instead (notice the uppercase L)isEnumLiteralType which will cause compile errors with typescript@2.4.0Features:
Bugfixes:
isObjectFlagSet now uses the correct objectFlags propertyBugfixes:
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, isModifierFlagSetFeatures:
isJsxAttributes, isIntersectionTypeNode, isTypeOperatorNode, isTypePredicateNode, isTypeQueryNode, isUnionTypeNodeBugfixes:
isFunctionScopeBoundary now handles Interfaces, TypeAliases, FunctionSignatures, etcFeatures:
isThisParameter, isSameLine and isFunctionWithBodyFeatures:
isValidPropertyAccess, isValidNumericLiteral and isValidPropertyNameFeatures:
isValidIdentifierFeatures:
contentLength property to the result of getLineRangesBugfixes:
canHaveLeadingTrivia:hasOwnThisReference: now includes accessors on object literalsFeatures:
Bugfixes:
hasOwnThisReference:Bugfixes:
isNumericLiteralFeatures:
Bugfixes:
Features:
Features: