@nmakarov/cli-toolkit 0.11.1 → 0.11.2

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/dist/index.js CHANGED
@@ -2506,6 +2506,12 @@ var FileDatabase = class {
2506
2506
  figureOutDataAndFileToWrite(data) {
2507
2507
  let dataToWrite;
2508
2508
  let dataLeftOver;
2509
+ if (!this.metadata.dataType) {
2510
+ this.metadata.dataType = detectDataType(data);
2511
+ }
2512
+ if (this.metadata.files.length === 0) {
2513
+ this.makeNewFile();
2514
+ }
2509
2515
  const lastFile = this.metadata.files[this.metadata.files.length - 1];
2510
2516
  const lastFileRecordsCount = lastFile.recordsCount;
2511
2517
  if (Array.isArray(data)) {