Initial curated chimera source from a8ae5b1db07fb49926c94585e2718e5130330974
This commit is contained in:
commit
c737a37f71
531 files changed
+119270
No files matched your search
@@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
(function exposeLibraryModel(root, factory) {
|
||||
const api = factory();
|
||||
if (typeof module === 'object' && module.exports) module.exports = api;
|
||||
else root.chimeraLibraryModel = api;
|
||||
})(typeof globalThis !== 'undefined' ? globalThis : window, function createLibraryModel() {
|
||||
function items(response) {
|
||||
if (Array.isArray(response)) return response;
|
||||
return Array.isArray(response?.items) ? response.items : [];
|
||||
}
|
||||
function isInstalled(title) { return Number(title?.availability?.confirmedInstallCount || 0) > 0; }
|
||||
function hasLocalCopy(title) { return Number(title?.protection?.localCopyCount || title?.availability?.localCopyCount || 0) > 0; }
|
||||
function needsProtection(title) { return isInstalled(title) && !hasLocalCopy(title); }
|
||||
return Object.freeze({ items, isInstalled, hasLocalCopy, needsProtection });
|
||||
});
|
||||
Reference in new issue
Block a user