isaacscript-common 30.5.1 → 30.5.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "30.5.1",
3
+ "version": "30.5.2",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -213,15 +213,13 @@ export function copyArray<T>(
213
213
  numElements?: int,
214
214
  ): T[] {
215
215
  if (numElements === undefined) {
216
- numElements = oldArray.length;
216
+ return [...oldArray];
217
217
  }
218
218
 
219
219
  const newArray: T[] = [];
220
220
  for (let i = 0; i < numElements; i++) {
221
- const oldElement = oldArray[i];
222
- if (oldElement !== undefined) {
223
- newArray.push(oldElement);
224
- }
221
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
222
+ newArray.push(oldArray[i]!);
225
223
  }
226
224
 
227
225
  return newArray;