MCPcopy
hub / github.com/brunosimon/keppler / constructor

Method constructor

lib/file.js:7–34  ·  view source on GitHub ↗
(_options)

Source from the content-addressed store, hash-verified

5class 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 {

Callers

nothing calls this directly

Calls 2

createVersionMethod · 0.95
getIdMethod · 0.80

Tested by

no test coverage detected