()
| 867 | * @returns {Buffer} content for the source |
| 868 | */ |
| 869 | const getContent = () => { |
| 870 | if (typeof source.buffer === class="st">"function") { |
| 871 | return source.buffer(); |
| 872 | } |
| 873 | const bufferOrString = source.source(); |
| 874 | if (Buffer.isBuffer(bufferOrString)) { |
| 875 | return bufferOrString; |
| 876 | } |
| 877 | return Buffer.from(bufferOrString, class="st">"utf8"); |
| 878 | }; |
| 879 | |
| 880 | const alreadyWritten = () => { |
| 881 | class="cm">// cache the information that the Source has been already been written to that location |