You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Return early is the way of writing functions or methods so that the expected positive result is returned at the end of the function and the rest of the code terminates the execution (by returning or throwing an exception) when conditions are not met.
exportfunctionisCacheFeatureAvailable(): boolean{if(!cache.isFeatureAvailable()){if(isGhes()){logWarning(`Cache action is only supported on GHES version >= 3.5...`);}else{logWarning("An internal error has occurred ...");}returnfalse;}returntrue;}
TO-BE
exportfunctionisCacheFeatureAvailable(): boolean{if(cache.isFeatureAvailable()){returntrue;}if(isGhes()){logWarning(`Cache action is only supported on GHES version >= 3.5...`);returnfalse;}logWarning("An internal error has occurred ...");returnfalse;}
The text was updated successfully, but these errors were encountered:
Description
Return early is the way of writing functions or methods so that the expected positive result is returned at the end of the function and the rest of the code terminates the execution (by returning or throwing an exception) when conditions are not met.
See actions/cache#1012
In
cache-utils.ts
:AS-IS
TO-BE
The text was updated successfully, but these errors were encountered: