Skip to content

Commit

Permalink
Disable input data validation
Browse files Browse the repository at this point in the history
  • Loading branch information
vantezzen committed May 23, 2023
1 parent a7e30b4 commit de35ed1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/WrappedCreator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Wrapped from "./Wrapped";
import { TikTokUserDataSchema } from "./types";
import { TikTokUserData, TikTokUserDataSchema } from "./types";
import JSZip from "jszip";

export default class WrappedCreator {
Expand All @@ -19,7 +19,7 @@ export default class WrappedCreator {
reader.onload = (e) => {
if (e.target?.result) {
const content = JSON.parse(e.target.result as string);
const userData = TikTokUserDataSchema.parse(content);
const userData = content as TikTokUserData;
resolve(new Wrapped(userData));
} else {
reject(new Error("Failed to read file"));
Expand All @@ -35,7 +35,7 @@ export default class WrappedCreator {
const jsonFile = Object.values(zip.files)[0];
const jsonContent = await jsonFile.async("string");
const content = JSON.parse(jsonContent as string);
const userData = TikTokUserDataSchema.parse(content);
const userData = content as TikTokUserData;
return new Wrapped(userData);
}

Expand Down

0 comments on commit de35ed1

Please sign in to comment.