Skip to content

Commit

Permalink
refactor(deno): fix Deno lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish authored and MichaelDeBoey committed Aug 22, 2023
1 parent 8779b24 commit 9654114
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/remix-deno/sessions/fileStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function createFileSessionStorage<Data = SessionData, FlashData = Data>({
}: FileSessionStorageOptions): SessionStorage<Data, FlashData> {
return createSessionStorage({
cookie,
async createData(data, expires) {
createData: async (data, expires) => {
const content = JSON.stringify({ data, expires });

while (true) {
Expand Down Expand Up @@ -65,7 +65,7 @@ export function createFileSessionStorage<Data = SessionData, FlashData = Data>({
}
}
},
async readData(id) {
readData: async (id) => {
try {
const file = getFile(dir, id);
const content = JSON.parse(await Deno.readTextFile(file));
Expand All @@ -87,13 +87,13 @@ export function createFileSessionStorage<Data = SessionData, FlashData = Data>({
return null;
}
},
async updateData(id, data, expires) {
updateData: async (id, data, expires) => {
const content = JSON.stringify({ data, expires });
const file = getFile(dir, id);
await Deno.mkdir(path.dirname(file), { recursive: true }).catch(() => {});
await Deno.writeTextFile(file, content);
},
async deleteData(id) {
deleteData: async (id) => {
try {
await Deno.remove(getFile(dir, id));
} catch (error) {
Expand Down

0 comments on commit 9654114

Please sign in to comment.