Skip to content

Commit

Permalink
chore: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bdkopen committed Sep 8, 2024
1 parent ebac715 commit 9fc72b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,18 @@ Minecraft Java Edition uses big-endian format, and Bedrock uses little-endian.

Returns a buffer with a serialized nbt `value`.

### parseUncompressed(data, format='big')
### parseUncompressed(data, format='big', options?= {noArraySizeCheck?: boolean})

Takes a buffer `data` and returns a parsed nbt value.

The `options` parameter is optional. When `noArraySizeCheck` is `true`, an array size check is disabled which allows for parsing of large arrays.

### parseAs(data, type, options?= {noArraySizeCheck?: boolean})

Takes a buffer `data` and returns a parsed nbt value. If the buffer is gzipped, it will unzip the data first.

The `options` parameter is optional. When `noArraySizeCheck` is `true`, an array size check is disabled which allows for parsing of large arrays.


### simplify(nbt)

Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ declare module 'prismarine-nbt'{
}
export function writeUncompressed(value: NBT, format?: NBTFormat): Buffer;
export function parseUncompressed(value: Buffer, format?: NBTFormat, options?: ParseOptions): NBT;
export function parseAs(value: Buffer, format: NBTFormat, options?: ParseOptions): Promise<{parsed: NBT, type: NBTFormat, metadata: Metadata}>;
export function parseAs(value: Buffer, type: NBTFormat, options?: ParseOptions): Promise<{parsed: NBT, type: NBTFormat, metadata: Metadata}>;

export function parse(data: Buffer, nbtType?: NBTFormat): Promise<{parsed: NBT, type: NBTFormat, metadata: Metadata}>;
export function simplify(data: Tags[TagType]): any
Expand Down

0 comments on commit 9fc72b5

Please sign in to comment.