From 5298fde3224765120e7a225140d3c18b5eca53e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Isager=20Dalsgar=C3=B0?= Date: Thu, 7 Nov 2024 11:38:45 +0100 Subject: [PATCH] Remove `require('constants')` and `fsctl` workaround --- index.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 4824381..5e0ed88 100644 --- a/index.js +++ b/index.js @@ -1,19 +1,12 @@ const RandomAccessStorage = require('random-access-storage') const fs = require('fs') const path = require('path') -const constants = fs.constants || require('constants') // eslint-disable-line n/no-deprecated-api +const constants = fs.constants let fsext = null try { fsext = require('fs-native-extensions') -} catch { - try { // tmp workaround for places where fsctl is bundled... - fsext = { - tryLock: require('fsctl').lock, - sparse: () => Promise.resolve() - } - } catch {} -} +} catch {} const RDWR = constants.O_RDWR const RDONLY = constants.O_RDONLY