madden-franchise 2.3.10 → 2.3.12

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.
@@ -157,6 +157,28 @@ class FranchiseFileTable extends EventEmitter {
157
157
 
158
158
  this._setNextRecordToUseBuffer(nextRecordToUse);
159
159
  this.emptyRecords = this._parseEmptyRecords();
160
+ this.emit('change');
161
+ }
162
+ };
163
+
164
+ async replaceRawData(buf, shouldReadRecords) {
165
+ this.data = buf;
166
+
167
+ // Reset fields
168
+ this.recordsRead = false;
169
+ this.header = this.strategy.parseHeader(this.data);
170
+ this.name = this.header.name;
171
+ this.isArray = this.header.isArray;
172
+ this.loadedOffsets = [];
173
+ this.isChanged = false;
174
+ this.records = [];
175
+ this.table2Records = [];
176
+ this.arraySizes = [];
177
+ this.emptyRecords = new Map();
178
+
179
+ // Re-read records if desired
180
+ if (shouldReadRecords) {
181
+ return this.readRecords();
160
182
  }
161
183
  };
162
184
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "madden-franchise",
3
- "version": "2.3.10",
3
+ "version": "2.3.12",
4
4
  "description": "Tools to read a madden franchise file and get data from it",
5
5
  "main": "FranchiseFile.js",
6
6
  "scripts": {