UNPKG

@fdm-monster/server

Version:

FDM Monster is a bulk OctoPrint manager to set up, configure and monitor 3D printers. Our aim is to provide extremely optimized websocket performance and reliability.

35 lines (34 loc) 870 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "normalizePrinterFile", { enumerable: true, get: function() { return normalizePrinterFile; } }); function normalizePrinterFile(file) { if (!file) { throw new Error("File should not be null for normalization"); } const keys = Object.keys(file); const fileCopy = { ...file }; const knownKeys = [ "path", "date", "hash", "size" ]; const unknownKeys = keys.filter((k)=>!knownKeys.includes(k)); const customData = {}; for (const unknownKey of unknownKeys){ customData[unknownKey] = fileCopy[unknownKey]; delete fileCopy[unknownKey]; } fileCopy.customData = customData; return fileCopy; } //# sourceMappingURL=file.utils.js.map