Skip to content

Commit 64ec7c2

Browse files
committed
feat: create validator for AssetIndex
Signed-off-by: Kaeeraa <[email protected]>
1 parent b022bc8 commit 64ec7c2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/lib/schemas/minecrafts-schemas.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { TypeCompiler } from "@sinclair/typebox/compiler";
12
import Type, { type Static } from "typebox";
23

34
export const VersionManifest = Type.Object({
@@ -73,6 +74,16 @@ export const AssetIndexSchema = Type.Object({
7374
"url" : Type.String(),
7475
});
7576
export type AssetIndex = Static<typeof AssetIndexSchema>;
77+
export const AssetIndexValidator = TypeCompiler.Compile(AssetIndexSchema);
78+
79+
export const AssetSchema = Type.Object({
80+
"hash": Type.String(),
81+
"size": Type.Number(),
82+
});
83+
84+
export const AssetsSchema = Type.Object({
85+
"objects": Type.Array(AssetSchema),
86+
});
7687

7788
export const LoggingConfigSchema = Type.Object({
7889
"id" : Type.String(),

0 commit comments

Comments
 (0)