s2cfgtojson 3.2.2 → 3.2.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.
Files changed (2) hide show
  1. package/Struct.mts +10 -8
  2. package/package.json +1 -1
package/Struct.mts CHANGED
@@ -102,9 +102,11 @@ export class Struct {
102
102
  }
103
103
 
104
104
  forEach<K extends Exclude<keyof this, Internal>, V extends (typeof this)[K]>(
105
- callback: ([key, value]: [K, V]) => void,
105
+ callback: ([key, value]: [K, V], i: number, arr: [K, V][]) => void,
106
106
  ): void {
107
- this.entries().forEach(([key, value]) => callback([key as K, value as V]));
107
+ this.entries().forEach(([key, value], i, arr) =>
108
+ callback([key as K, value as V], i, arr as any),
109
+ );
108
110
  }
109
111
 
110
112
  /**
@@ -112,11 +114,11 @@ export class Struct {
112
114
  * @param callback
113
115
  */
114
116
  filter<K extends Exclude<keyof this, Internal>, V extends (typeof this)[K]>(
115
- callback: ([key, value]: [K, V]) => boolean,
117
+ callback: ([key, value]: [K, V], i: number, arr: [K, V][]) => boolean,
116
118
  ): Partial<this> & Struct {
117
119
  const clone = this.clone();
118
- clone.entries().forEach(([key, value]) => {
119
- if (!callback([key as K, value as V])) {
120
+ clone.entries().forEach(([key, value], i, arr) => {
121
+ if (!callback([key as K, value as V], i, arr as any)) {
120
122
  delete clone[key];
121
123
  }
122
124
  });
@@ -128,11 +130,11 @@ export class Struct {
128
130
  * @param callback
129
131
  */
130
132
  map<K extends Exclude<keyof this, Internal>, V extends (typeof this)[K]>(
131
- callback: ([key, value]: [K, V]) => V,
133
+ callback: ([key, value]: [K, V], i: number, arr: [K, V][]) => V,
132
134
  ): this {
133
135
  const clone = this.clone();
134
- clone.entries().forEach(([key, value]) => {
135
- clone[key] = callback([key as K, value as V]);
136
+ clone.entries().forEach(([key, value], i, arr) => {
137
+ clone[key] = callback([key as K, value as V], i, arr as any);
136
138
  });
137
139
  return clone;
138
140
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "s2cfgtojson",
3
- "version": "3.2.2",
3
+ "version": "3.2.3",
4
4
  "description": "Converts Stalker 2 Cfg file into POJOs",
5
5
  "keywords": [
6
6
  "stalker",