@bytebrand/export-cars 1.10.3 → 1.10.4

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": "@bytebrand/export-cars",
3
- "version": "1.10.3",
3
+ "version": "1.10.4",
4
4
  "description": "",
5
5
  "author": "bytebrand",
6
6
  "license": "UNLICENSED",
@@ -60,5 +60,5 @@
60
60
  "engines": {
61
61
  "node": ">=14.0.0"
62
62
  },
63
- "gitHead": "3d8977124d994db8a1c77b65230c92cdd3f0ef0f"
63
+ "gitHead": "8328e981aadcc3aa3d6ac4e94da5928b6172e12e"
64
64
  }
@@ -328,17 +328,23 @@ export class FbTransformer {
328
328
  private async getLocationByInfo(info: { zip: number; city: string }): Promise<DePostalCodesEntryInterface> {
329
329
  const cacheKey = `${info.city}_${info.zip}`;
330
330
 
331
- let entry: DePostalCodesEntryInterface = await this.cacheManager.get(cacheKey);
332
- if (entry) { return entry };
331
+ let entry = await this.cacheManager.get(cacheKey);
332
+ if (entry) { return entry as DePostalCodesEntryInterface; };
333
+ if (entry === 'no_data') { return undefined; }
333
334
 
334
335
  entry = await this.postalCodesService.getLocationByPostalCode(info.zip);
335
- await this.cacheManager.set(cacheKey, entry);
336
+ entry && await this.cacheManager.set(cacheKey, entry);
336
337
 
337
338
  if (!entry) {
338
339
  entry = await this.postalCodesService.getLocationByCity(info.city);
339
- await this.cacheManager.set(cacheKey, entry);
340
+ if (entry) {
341
+ await this.cacheManager.set(cacheKey, entry);
342
+ } else {
343
+ await this.cacheManager.set(cacheKey, 'no_data');
344
+ }
345
+
340
346
  }
341
- return entry;
347
+ return entry as DePostalCodesEntryInterface;
342
348
  }
343
349
 
344
350
  private getExteriorColor(car: DataSchemes.Car): string {