Skip to content

Commit

Permalink
Fix bug for relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyukaola authored and jingyu committed May 4, 2022
1 parent 4a4b6bf commit 9f3c68d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/didstore.ts
Expand Up @@ -93,7 +93,7 @@ export class DIDStore {
* DID Stores, as we don't have a concept of "folder" isolation.
*/
public static async open(context: string, initialCacheCapacity: number = DIDStore.CACHE_INITIAL_CAPACITY, maxCacheCapacity: number = DIDStore.CACHE_MAX_CAPACITY): Promise<DIDStore> {
checkArgument(context != null, "Invalid store context");
checkArgument(context != null && context != "", "Invalid store context");
checkArgument(maxCacheCapacity >= initialCacheCapacity, "Invalid cache capacity spec");

let storage = new FileSystemStorage(context);
Expand Down
3 changes: 3 additions & 0 deletions src/file.ts
Expand Up @@ -47,6 +47,9 @@ import * as fs from "./fs";
if (subpath)
fullPath += (File.SEPARATOR + subpath);

if (!fullPath.startsWith("/") && !fullPath.startsWith("./") && fullPath[1] !== ':')
fullPath = "./" + fullPath;

this.fullPath = fullPath;
}

Expand Down

0 comments on commit 9f3c68d

Please sign in to comment.