(
/** @type {IFs} */ fs,
/** @type {string} */ filename
)
| 294 | }; |
| 295 | |
| 296 | const updateFile = ( |
| 297 | /** @type {IFs} */ fs, |
| 298 | /** @type {string} */ filename |
| 299 | ) => { |
| 300 | const oldContent = /** @type {string} */ ( |
| 301 | /** @type {unknown} */ (fs.readFileSync(filename, "utf8")) |
| 302 | ); |
| 303 | if (filename.endsWith(".json")) { |
| 304 | const data = JSON.parse(oldContent); |
| 305 | fs.writeFileSync( |
| 306 | filename, |
| 307 | JSON.stringify({ |
| 308 | ...data, |
| 309 | version: `${data.version}.1` |
| 310 | }) |
| 311 | ); |
| 312 | } else { |
| 313 | fs.writeFileSync(filename, `${oldContent}!`); |
| 314 | } |
| 315 | }; |
| 316 | |
| 317 | for (const [name, options] of /** @type {[string, SnapshotOptions][]} */ ([ |
| 318 | ["timestamp", { timestamp: true }], |
no test coverage detected