( buffer: Uint8Array )
| 101 | } |
| 102 | |
| 103 | function makeNodeFileBuffer ( buffer: Uint8Array ) { |
| 104 | const fileBuffer = Buffer.alloc( buffer.byteLength ) |
| 105 | |
| 106 | for ( let index = 0; index < buffer.length; index += 1 ) { |
| 107 | fileBuffer[ index ] = buffer[ index ] |
| 108 | } |
| 109 | |
| 110 | return fileBuffer |
| 111 | } |
| 112 | |
| 113 | function toArrayBuffer ( value: ArrayBuffer | ArrayBufferView ) { |
| 114 | if ( value instanceof ArrayBuffer ) { |