(path)
| 17848 | return str ? indent + str.replace(/\n/g, indent) : "" |
| 17849 | } |
| 17850 | static fromDisk(path) { |
| 17851 | const format = this._getFileFormat(path) |
| 17852 | const content = require("fs").readFileSync(path, "utf8") |
| 17853 | const methods = { |
| 17854 | particles: content => new Particle(content), |
| 17855 | csv: content => this.fromCsv(content), |
| 17856 | tsv: content => this.fromTsv(content) |
| 17857 | } |
| 17858 | if (!methods[format]) throw new Error(`No support for '${format}'`) |
| 17859 | return methods[format](content) |
| 17860 | } |
| 17861 | static fromFolder(folderPath, filepathPredicate = filepath => filepath !== ".DS_Store") { |
| 17862 | const path = require("path") |
| 17863 | const fs = require("fs") |
no test coverage detected