forked from sashin/sashinexists
run npm install to generate a package lock
This commit is contained in:
36
node_modules/stubborn-fs/dist/handlers.js
generated
vendored
Normal file
36
node_modules/stubborn-fs/dist/handlers.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/* IMPORT */
|
||||
import { IS_USER_ROOT } from './constants.js';
|
||||
/* MAIN */
|
||||
const Handlers = {
|
||||
/* API */
|
||||
isChangeErrorOk: (error) => {
|
||||
if (!Handlers.isNodeError(error))
|
||||
return false;
|
||||
const { code } = error;
|
||||
if (code === 'ENOSYS')
|
||||
return true;
|
||||
if (!IS_USER_ROOT && (code === 'EINVAL' || code === 'EPERM'))
|
||||
return true;
|
||||
return false;
|
||||
},
|
||||
isNodeError: (error) => {
|
||||
return (error instanceof Error);
|
||||
},
|
||||
isRetriableError: (error) => {
|
||||
if (!Handlers.isNodeError(error))
|
||||
return false;
|
||||
const { code } = error;
|
||||
if (code === 'EMFILE' || code === 'ENFILE' || code === 'EAGAIN' || code === 'EBUSY' || code === 'EACCESS' || code === 'EACCES' || code === 'EACCS' || code === 'EPERM')
|
||||
return true;
|
||||
return false;
|
||||
},
|
||||
onChangeError: (error) => {
|
||||
if (!Handlers.isNodeError(error))
|
||||
throw error;
|
||||
if (Handlers.isChangeErrorOk(error))
|
||||
return;
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
/* EXPORT */
|
||||
export default Handlers;
|
||||
Reference in New Issue
Block a user