(_options)
| 5 | class File |
| 6 | { |
| 7 | constructor(_options) |
| 8 | { |
| 9 | // Set up |
| 10 | this.id = ids.getId() |
| 11 | this.name = _options.name |
| 12 | this.path = {} |
| 13 | this.path.directory = _options.path |
| 14 | this.path.full = this.path.directory + '/' + this.name |
| 15 | this.versions = [] |
| 16 | this.projectSocket = _options.projectSocket |
| 17 | |
| 18 | const nameParts = this.name.split('.') |
| 19 | |
| 20 | if(nameParts.length > 1) |
| 21 | { |
| 22 | this.extension = nameParts[ nameParts.length - 1 ] |
| 23 | } |
| 24 | else |
| 25 | { |
| 26 | this.extension = '' |
| 27 | } |
| 28 | |
| 29 | // Create first version |
| 30 | if(typeof _options.content !== 'undefined') |
| 31 | { |
| 32 | this.createVersion(_options.content) |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | createVersion(content) |
| 37 | { |
nothing calls this directly
no test coverage detected