Plato on Github
Report Home
src/fs/close.js
Maintainability
83.31
Lines of code
24
Difficulty
4.46
Estimated Errors
0.04
Function weight
By Complexity
By SLOC
/** * @file File system close implementation helper * @since 0.2.7 */ /*#ifndef(UMD)*/ "use strict"; /*exported _gpfFsCloseBuild*/ // Build close method that assess the stream type /*#endif*/ /** * Build close method that assess the stream type * * @param {Function} ExpectedBaseClass Expected base class * @return {Function} Close implementation * @since 0.2.7 */ function _gpfFsCloseBuild (ExpectedBaseClass) { return function (stream) { if (stream instanceof ExpectedBaseClass) { return stream.close(); } return Promise.reject(new gpf.Error.IncompatibleStream()); }; }