(entries, cb)
| 793 | } |
| 794 | |
| 795 | function _writev(entries, cb) { |
| 796 | const chunks = []; |
| 797 | for (let i = 0; i < entries.length; i++) { |
| 798 | const { chunk, encoding } = entries[i]; |
| 799 | chunks[i] = typeof chunk === 'string' ? |
| 800 | Buffer.from(chunk, encoding) : chunk; |
| 801 | } |
| 802 | if (hasWritevSync) { |
| 803 | try { |
| 804 | if (writer.writevSync(chunks)) { |
| 805 | queueMicrotask(cb); |
| 806 | return; |
| 807 | } |
| 808 | // WritevSync returned false: not accepted, fall through to async. |
| 809 | } catch (err) { |
| 810 | cb(err); |
| 811 | return; |
| 812 | } |
| 813 | } |
| 814 | try { |
| 815 | PromisePrototypeThen(writer.writev(chunks), () => cb(), cb); |
| 816 | } catch (err) { |
| 817 | cb(err); |
| 818 | } |
| 819 | } |
| 820 | |
| 821 | function _final(cb) { |
| 822 | if (!hasEnd) { |
nothing calls this directly
no test coverage detected