Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/lib/db-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,21 @@ class DBManager {
replicate: db.options.replicate,
},
type: db.type,
uid: db.uid
uid: db.uid,
capabilities: Object.keys( //TODO: cleanup this mess once tc39 object.fromEntries aproved
Object.assign ({}, ... // https://tc39.github.io/proposal-object-from-entries
Object.entries({
add: typeof db.add == 'function',
get: typeof db.get == 'function',
inc: typeof db.inc == 'function',
iterator: typeof db.iterator == 'function',
put: typeof db.put == 'function',
query: typeof db.query == 'function',
remove: typeof (db.del || db.remove) == 'function',
value: typeof db.value == 'function'
}).filter(([k,v]) => v).map(([k,v]) => ({[k]:v}))
)
)
};
};
}
Expand Down