ignore-enoent.js 332 B

12345678910111213141516
  1. export const ignoreENOENT = async (p) => p.catch(er => {
  2. if (er.code !== 'ENOENT') {
  3. throw er;
  4. }
  5. });
  6. export const ignoreENOENTSync = (fn) => {
  7. try {
  8. return fn();
  9. }
  10. catch (er) {
  11. if (er?.code !== 'ENOENT') {
  12. throw er;
  13. }
  14. }
  15. };
  16. //# sourceMappingURL=ignore-enoent.js.map