This commit is contained in:
CHEVALLIER Abel
2025-11-13 16:23:22 +01:00
parent de9c515a47
commit cb235644dc
34924 changed files with 3811102 additions and 0 deletions

27
node_modules/lmdb/level.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
export function levelup(store) {
return Object.assign(Object.create(store), {
get(key, options, callback) {
let result = store.get(key);
if (typeof options == 'function')
callback = options;
if (callback) {
if (result === undefined)
callback(new NotFoundError());
else
callback(null, result);
} else {
if (result === undefined)
return Promise.reject(new NotFoundError());
else
return Promise.resolve(result);
}
},
});
}
class NotFoundError extends Error {
constructor(message) {
super(message);
this.name = 'NotFoundError';
this.notFound = true;
}
}