Skip to content

Commit

Permalink
refactor(deno): fix Deno lint errors (#7215)
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish authored Aug 21, 2023
1 parent e000200 commit 5de3187
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 5de3187

Please sign in to comment.