@capgo/capacitor-uploader
Version:
Upload file natively
21 lines • 700 B
JavaScript
export class PathHelper {
// Check if the path follows the idb://[databaseName]/[storeName]/[key] format
static isIndexedDBPath(path) {
const regex = /^idb:\/\/([^/]+)\/([^/]+)\/(.+)$/;
return regex.test(path);
}
// Parse the path to extract database, storeName, and key
static parseIndexedDBPath(path) {
const regex = /^idb:\/\/([^/]+)\/([^/]+)\/(.+)$/;
const match = path.match(regex);
if (!match) {
throw new Error('Invalid IndexedDB path format');
}
return {
database: match[1],
storeName: match[2],
key: match[3],
};
}
}
//# sourceMappingURL=PathHelper.js.map