( input: FileInput )
| 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 | |
| 129 | export class FileReader { |
nothing calls this directly
no outgoing calls
no test coverage detected