MCPcopy
hub / github.com/node-formidable/formidable / toJSON

Method toJSON

src/VolatileFile.js:34–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32 }
33
34 toJSON() {
35 const json = {
36 size: this.size,
37 newFilename: this.newFilename,
38 length: this.length,
39 originalFilename: this.originalFilename,
40 mimetype: this.mimetype,
41 };
42 if (this.hash && this.hash !== '') {
43 json.hash = this.hash;
44 }
45 return json;
46 }
47
48 toString() {
49 return `VolatileFile: ${this.originalFilename}`;

Calls

no outgoing calls

Tested by

no test coverage detected