File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1634,10 +1634,16 @@ namespace ts {
16341634 } ;
16351635 }
16361636
1637- export function memoizeOne < ArgsT extends unknown [ ] , ReturnT > ( callback : ( ...args : ArgsT ) => ReturnT ) {
1637+ export function memoizeOne < ArgsT extends unknown [ ] , ReturnT > ( callback : ( ...args : ArgsT ) => ReturnT ) : typeof callback & { clear : ( ) => void } {
16381638 let value : ReturnT ;
16391639 let cachedArgs : ArgsT ;
1640- return ( ...args : ArgsT ) => {
1640+ runMemoized . clear = ( ) => {
1641+ value = undefined ! ;
1642+ cachedArgs = undefined ! ;
1643+ } ;
1644+ return runMemoized ;
1645+
1646+ function runMemoized ( ...args : ArgsT ) {
16411647 const length = args . length ;
16421648 if ( cachedArgs && cachedArgs . length === length ) {
16431649 for ( let i = 0 ; i < length ; i ++ ) {
@@ -1653,7 +1659,6 @@ namespace ts {
16531659 } ;
16541660 }
16551661
1656-
16571662 /**
16581663 * High-order function, composes functions. Note that functions are composed inside-out;
16591664 * for example, `compose(a, b)` is the equivalent of `x => b(a(x))`.
Original file line number Diff line number Diff line change @@ -185,6 +185,10 @@ namespace ts.moduleSpecifiers {
185185 return result ;
186186 } ) ;
187187
188+ export function clearSymlinksCache ( ) {
189+ discoverProbableSymlinks . clear ( ) ;
190+ }
191+
188192 /**
189193 * Looks for existing imports that use symlinks to this module.
190194 * Symlinks will be returned first so they are preferred over the real path.
Original file line number Diff line number Diff line change @@ -591,6 +591,7 @@ namespace ts.codefix {
591591 }
592592 }
593593 } ) ;
594+ moduleSpecifiers . clearSymlinksCache ( ) ;
594595
595596 function getNodeModulesPackageNameFromFileName ( importedFileName : string ) : string | undefined {
596597 if ( ! stringContains ( importedFileName , "node_modules" ) ) {
You can’t perform that action at this time.
0 commit comments