Skip to content

Commit

Permalink
fix memory import and file store
Browse files Browse the repository at this point in the history
  • Loading branch information
eluce2 committed Apr 25, 2023
1 parent 30708d2 commit 47cf4d1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @proofgeist/fmdapi

## 3.0.7

### Patch Changes

- fix: file return types to conform to zod validator
- fix: if no token store is provided, default memory store was not being imported correctly

## 3.0.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@proofgeist/fmdapi",
"version": "3.0.6",
"version": "3.0.7",
"description": "FileMaker Data API client",
"main": "dist/index.js",
"repository": "[email protected]:proofgeist/fm-dapi.git",
Expand Down
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function DataApi<
if (!tokenStore) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
tokenStore = await import("./tokenStore/memory.js");
tokenStore = (await import("./tokenStore/memory.js")).default;
}
if (!tokenStore) throw new Error("No token store provided");

Expand Down
2 changes: 1 addition & 1 deletion src/tokenStore/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const setSharedData = (key: string, value: string, devFileName: string) => {
};
const getSharedData = (key: string, devFileName: string): string | null => {
const data = getDataFromFile(devFileName);
return data[key];
return data[key] ?? null;
};
export const fileTokenStore = (
fileName = "shared.json"
Expand Down

0 comments on commit 47cf4d1

Please sign in to comment.