UNPKG

@alwatr/nitrobase-helper

Version:

Extremely fast and compact JSON-based database that operates in memory, includes a JSON file backup, and serve over the highly accelerated Nginx.

27 lines (25 loc) 813 B
/* @alwatr/nitrobase-helper v7.8.0 */ // src/main.ts import { flatString, packageTracer } from "@alwatr/nanolib"; import { StoreFileExtension } from "@alwatr/nitrobase-types"; __dev_mode__: packageTracer.add("@alwatr/nitrobase-helper", "7.8.0"); function getStoreId(storeId) { let id = storeId.region + "/" + storeId.name; if (storeId.ownerId !== void 0) { id += "/" + storeId.ownerId; } return flatString(id); } function getStorePath(storeStat) { let path = storeStat.region; if (storeStat.ownerId !== void 0) { path += "/" + storeStat.ownerId.slice(0, 3) + "/" + storeStat.ownerId; } path += `/${storeStat.name}.${storeStat.type}.${storeStat.extension ?? StoreFileExtension.Json}`; return flatString(path); } export { getStoreId, getStorePath }; //# sourceMappingURL=main.mjs.map