(path)
| 16064 | return this._subparticlesToXml(0) |
| 16065 | } |
| 16066 | toDisk(path) { |
| 16067 | if (!this.isNodeJs()) throw new Error("This method only works in Node.js") |
| 16068 | const format = Particle._getFileFormat(path) |
| 16069 | const formats = { |
| 16070 | particles: particle => particle.toString(), |
| 16071 | csv: particle => particle.asCsv, |
| 16072 | tsv: particle => particle.asTsv |
| 16073 | } |
| 16074 | this.require("fs").writeFileSync(path, formats[format](this), "utf8") |
| 16075 | return this |
| 16076 | } |
| 16077 | _lineToYaml(indentLevel, listTag = "") { |
| 16078 | let prefix = " ".repeat(indentLevel) |
| 16079 | if (listTag && indentLevel > 1) prefix = " ".repeat(indentLevel - 2) + listTag + " " |
nothing calls this directly
no test coverage detected