* @inheritDoc
(name: string, data: any, origin: string)
| 43 | * @inheritDoc |
| 44 | */ |
| 45 | set(name: string, data: any, origin: string): void { |
| 46 | if (this.#options.combined) { |
| 47 | this.#cache[name.replace(/\.[jt]s$/, '')] = data; |
| 48 | return; |
| 49 | } |
| 50 | |
| 51 | const path = this.path(name); |
| 52 | const hash = this.getHash(origin); |
| 53 | writeFileSync( |
| 54 | path, |
| 55 | JSON.stringify({ data, origin, hash, version: this.#VERSION }, null, this.#pretty ? 2 : undefined), |
| 56 | ); |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * @inheritDoc |