Conversation
ae28cfb to
549f9fb
Compare
sandersn
left a comment
There was a problem hiding this comment.
Approved, but you'll need to merge from master and decide whether to keep findDeclaration or replace a new usage that I added with find(symbol.declarations, ...
| return undefined; | ||
| } | ||
|
|
||
| export function findDeclaration<T extends Declaration>(symbol: Symbol, predicate: (node: Declaration) => node is T): T | undefined; |
There was a problem hiding this comment.
please don't remove this one. I use it in an upcoming change and would have to put it back.
There was a problem hiding this comment.
would it be fast enough to have getDeclarationOfKind delegate to findDeclaration ?
There was a problem hiding this comment.
Actually, the rewrite at the bottom of the change to find(symbol.declarations, ... is good enough since my new usage requires a cast as well.
(I also just merged the new usage, so you will see it when you merge from master.)
| tagName, | ||
| objectProperties, | ||
| filter(map(children, transformJsxChildToExpression), isDefined), | ||
| children && mapDefined(children, transformJsxChildToExpression), |
There was a problem hiding this comment.
Pretty much all of our other array utils in core.ts test for the array possibly being undefined. Should we not also do that for mapDefined?
|
@rbuckton Good to go? |
* Remove unused internal utilities * Handle undefined input to `mapDefined`
Many of the functions in
utilities.tsare not used.