🔨 remove unsafe date parsing options from getGithubUserContribution ( thanks @Sutil )
This commit is contained in:
@@ -4,7 +4,6 @@ const params = [
|
||||
//
|
||||
[{}, ""],
|
||||
[{ year: 2017 }, "from=2017-01-01&to=2017-12-31"],
|
||||
[{ from: new Date("2017-12-03") }, "from=2017-12-03"],
|
||||
[{ from: "2017-12-03" }, "from=2017-12-03"],
|
||||
[{ to: "2017-12-03" }, "to=2017-12-03"],
|
||||
] as const;
|
||||
@@ -16,5 +15,5 @@ params.forEach(([params, res]) =>
|
||||
);
|
||||
|
||||
it("should fail if the date is in the future", () => {
|
||||
expect(() => formatParams({ to: new Date() })).toThrow(Error);
|
||||
expect(() => formatParams({ to: "9999-01-01" })).toThrow(Error);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user