MCPcopy Create free account
hub / github.com/ThatGuySam/doesitarm / constructor

Method constructor

helpers/scanner/file-api.ts:102–126  ·  view source on GitHub ↗
( input: FileInput )

Source from the content-addressed store, hash-verified

100 type?: string
101
102 constructor ( input: FileInput ) {
103 if ( typeof input === 'string' ) {
104 this.path = input
105 } else {
106 Object.assign( this, input )
107 }
108
109 if ( !this.name ) {
110 throw new Error( 'No name' )
111 }
112
113 if ( !this.path ) {
114 if ( this.buffer ) {
115 this.size = this.buffer.length
116 } else if ( !this.stream ) {
117 throw new Error( 'No input, nor stream, nor buffer.' )
118 }
119
120 return
121 }
122
123 if ( !this.jsdom ) {
124 return
125 }
126 }
127}
128
129export class FileReader {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected