isaacscript-common 81.0.2 → 81.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,5 +65,5 @@ export declare function getRandomJSONEntity(jsonEntities: JSONEntity[], seedOrRN
65
65
  * @param verbose Optional. If specified, will write entries to the "log.txt" file that describe
66
66
  * what the function is doing. Default is false.
67
67
  */
68
- export declare function getRandomJSONRoom(jsonRooms: JSONRoom[], seedOrRNG: Seed | RNG | undefined, verbose?: boolean): JSONRoom;
68
+ export declare function getRandomJSONRoom(jsonRooms: readonly JSONRoom[], seedOrRNG: Seed | RNG | undefined, verbose?: boolean): JSONRoom;
69
69
  //# sourceMappingURL=jsonRoom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsonRoom.d.ts","sourceRoot":"","sources":["../../src/functions/jsonRoom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAexE;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,YAAY,CAAC,CAqDxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,SAAS,QAAQ,EAAE,EAC9B,OAAO,EAAE,GAAG,GACX,QAAQ,GAAG,SAAS,CA0BtB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,QAAQ,EAAE,EAC9B,OAAO,EAAE,GAAG,GACX,SAAS,QAAQ,EAAE,CAYrB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,UAAU,EAAE,EAC1B,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,SAAS,EACjC,OAAO,UAAQ,GACd,UAAU,CAqBZ;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,QAAQ,EAAE,EACrB,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,SAAS,EACjC,OAAO,UAAQ,GACd,QAAQ,CAkBV"}
1
+ {"version":3,"file":"jsonRoom.d.ts","sourceRoot":"","sources":["../../src/functions/jsonRoom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAexE;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,YAAY,CAAC,CAqDxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,SAAS,QAAQ,EAAE,EAC9B,OAAO,EAAE,GAAG,GACX,QAAQ,GAAG,SAAS,CA0BtB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,QAAQ,EAAE,EAC9B,OAAO,EAAE,GAAG,GACX,SAAS,QAAQ,EAAE,CAYrB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,UAAU,EAAE,EAC1B,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,SAAS,EACjC,OAAO,UAAQ,GACd,UAAU,CAqBZ;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,SAAS,QAAQ,EAAE,EAC9B,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,SAAS,EACjC,OAAO,UAAQ,GACd,QAAQ,CAkBV"}
@@ -7170,7 +7170,7 @@ export declare function getRandomJSONEntity(jsonEntities: JSONEntity[], seedOrRN
7170
7170
  * @param verbose Optional. If specified, will write entries to the "log.txt" file that describe
7171
7171
  * what the function is doing. Default is false.
7172
7172
  */
7173
- export declare function getRandomJSONRoom(jsonRooms: JSONRoom[], seedOrRNG: Seed | RNG | undefined, verbose?: boolean): JSONRoom;
7173
+ export declare function getRandomJSONRoom(jsonRooms: readonly JSONRoom[], seedOrRNG: Seed | RNG | undefined, verbose?: boolean): JSONRoom;
7174
7174
 
7175
7175
  /**
7176
7176
  * Helper function to get a random `KColor` object (for use in fonts).
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 81.0.1
3
+ isaacscript-common 81.0.2
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "81.0.2",
3
+ "version": "81.0.3",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -209,7 +209,7 @@ export function getRandomJSONEntity(
209
209
  * what the function is doing. Default is false.
210
210
  */
211
211
  export function getRandomJSONRoom(
212
- jsonRooms: JSONRoom[],
212
+ jsonRooms: readonly JSONRoom[],
213
213
  seedOrRNG: Seed | RNG | undefined,
214
214
  verbose = false,
215
215
  ): JSONRoom {
@@ -232,7 +232,9 @@ export function getRandomJSONRoom(
232
232
  return randomJSONRoom;
233
233
  }
234
234
 
235
- function getTotalWeightOfJSONObject(jsonOjectArray: JSONObject[]): float {
235
+ function getTotalWeightOfJSONObject(
236
+ jsonOjectArray: readonly JSONObject[],
237
+ ): float {
236
238
  const weights = jsonOjectArray.map((jsonObject) => {
237
239
  const weightString = jsonObject.$.weight;
238
240
  const weight = tonumber(weightString);
@@ -248,7 +250,7 @@ function getTotalWeightOfJSONObject(jsonOjectArray: JSONObject[]): float {
248
250
  }
249
251
 
250
252
  function getJSONObjectWithChosenWeight<T extends JSONObject>(
251
- jsonOjectArray: T[],
253
+ jsonOjectArray: readonly T[],
252
254
  chosenWeight: float,
253
255
  ): T | undefined {
254
256
  let weightAccumulator = 0;