PrismarineJS / node-minecraft-data

Provide easy access to minecraft-data in node.js
https://prismarinejs.github.io/minecraft-data/
100 stars 51 forks source link

fix strict null types & object type #348

Closed zardoy closed 2 months ago

zardoy commented 3 months ago
  1. Remove usage of object type because With Record<string, any>, you can access any property on the object without TypeScript complaining, because it's assumed that the object can have any string as a key with any type of value. With object, TypeScript doesn't allow you to access any properties on the object directly, because it doesn't know what properties the object has.

  2. This node wrapper is always adding minStateId, maxStateId, and defaultState, that's why they should be required: https://github.com/zardoy/node-minecraft-data/blob/542925dfcabdecbfe0556db54530fc806827c302/lib/indexes.js#L7