Skip to content

Commit

Permalink
add assert and remove cast
Browse files Browse the repository at this point in the history
  • Loading branch information
hmalik88 committed Dec 17, 2024
1 parent e68ce95 commit 385668c
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
refine,
string,
} from '@metamask/superstruct';
import { type PendingJsonRpcResponse } from '@metamask/utils';
import { assert, type PendingJsonRpcResponse } from '@metamask/utils';
import { DateTime } from 'luxon';

import { SnapEndowments } from '../endowments';
Expand Down Expand Up @@ -114,7 +114,9 @@ async function getScheduleBackgroundEventImplementation(
.startOf('second')
.toISO({
suppressMilliseconds: true,
}) as string;
});

assert(truncatedDate);

const id = scheduleBackgroundEvent({ date: truncatedDate, request });
res.result = id;
Expand Down

0 comments on commit 385668c

Please sign in to comment.