fs: use a default callback for fs.close()
The `fs.close()` function requires a callback. Most often the only thing that callback does is check and rethrow the error if one occurs. To eliminate common boilerplate, make the callback optional with a default that checks and rethrows the error as an uncaught exception. Signed-off-by:James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37174 Reviewed-By:
Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By:
Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By:
Matteo Collina <matteo.collina@gmail.com> Reviewed-By:
Darshan Sen <raisinten@gmail.com> Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Zijian Liu <lxxyxzj@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com>
parent
bf2f2b74
Please register or sign in to comment