(chunk, encoding, cb)
| 771 | // from _write/_writev/_final callbacks. |
| 772 | |
| 773 | function _write(chunk, encoding, cb) { |
| 774 | const bytes = typeof chunk === 'string' ? |
| 775 | Buffer.from(chunk, encoding) : chunk; |
| 776 | if (hasWriteSync) { |
| 777 | try { |
| 778 | if (writer.writeSync(bytes)) { |
| 779 | queueMicrotask(cb); |
| 780 | return; |
| 781 | } |
| 782 | // WriteSync returned false: not accepted, fall through to async. |
| 783 | } catch (err) { |
| 784 | cb(err); |
| 785 | return; |
| 786 | } |
| 787 | } |
| 788 | try { |
| 789 | PromisePrototypeThen(writer.write(bytes), () => cb(), cb); |
| 790 | } catch (err) { |
| 791 | cb(err); |
| 792 | } |
| 793 | } |
| 794 | |
| 795 | function _writev(entries, cb) { |
| 796 | const chunks = []; |
nothing calls this directly
no test coverage detected
searching dependent graphs…