site/node_modules/rimraf/dist/commonjs/ignore-enoent.js

21 lines
535 B
JavaScript
Raw Normal View History

2024-10-14 06:09:33 +00:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ignoreENOENTSync = exports.ignoreENOENT = void 0;
const ignoreENOENT = async (p) => p.catch(er => {
if (er.code !== 'ENOENT') {
throw er;
}
});
exports.ignoreENOENT = ignoreENOENT;
const ignoreENOENTSync = (fn) => {
try {
return fn();
}
catch (er) {
if (er?.code !== 'ENOENT') {
throw er;
}
}
};
exports.ignoreENOENTSync = ignoreENOENTSync;
//# sourceMappingURL=ignore-enoent.js.map