(source, options = { __proto__: null })
| 680 | } |
| 681 | |
| 682 | function shareSync(source, options = { __proto__: null }) { |
| 683 | // Normalize source via fromSync() - accepts strings, ArrayBuffers, protocols, etc. |
| 684 | const normalized = fromSync(source); |
| 685 | validateObject(options, 'options'); |
| 686 | const { |
| 687 | highWaterMark = kMultiConsumerDefaultHWM, |
| 688 | backpressure = 'strict', |
| 689 | } = options; |
| 690 | validateInteger(highWaterMark, 'options.highWaterMark'); |
| 691 | validateBackpressure(backpressure); |
| 692 | |
| 693 | const opts = { |
| 694 | __proto__: null, |
| 695 | highWaterMark: clampHWM(highWaterMark), |
| 696 | backpressure, |
| 697 | }; |
| 698 | |
| 699 | return new SyncShareImpl(normalized, opts); |
| 700 | } |
| 701 | |
| 702 | function isShareable(value) { |
| 703 | return hasProtocol(value, shareProtocol); |
no test coverage detected