@stdlib/esm
Version:
ES module distribution for Stdlib, a standard library for JavaScript and Node.js.
3 lines • 873 B
JavaScript
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
import e from"./../utils/define-nonenumerable-read-only-property.js";import r from"./../vendor/fs.js";import i from"./../assert/is-nonnegative-integer.js";import n from"./../assert/is-function.js";var t=r.close,o=i.isPrimitive,a=n;function s(e,r){if(!o(e))throw new TypeError("invalid argument. First argument must be a valid file descriptor (nonnegative integer). Value: `"+e+"`.");if(!a(r))throw new TypeError("invalid argument. Last argument must be a function. VAlue: `"+r+"`.");t(e,r)}var u=r.closeSync,m=i.isPrimitive;function f(e){if(!m(e))throw new TypeError("invalid argument. Must provide a valid file descriptor (nonnegative integer). Value: `"+e+"`.");try{u(e)}catch(e){return e}}var l=e,v=s,p=f;l(v,"sync",p);export default v;
//# sourceMappingURL=close.js.map