Adds a default value, iterator or iterable to an empty pipeline.
If the pipeline has at least one value, the defaults are ignored.
import {pipe, defaultEmpty} from 'iter-ops';const i = pipe( [], // empty iterable/pipeline defaultEmpty([1, 2, 3]) // default for an empty pipeline);console.log(...i); //=> 1, 2, 3 Copy
import {pipe, defaultEmpty} from 'iter-ops';const i = pipe( [], // empty iterable/pipeline defaultEmpty([1, 2, 3]) // default for an empty pipeline);console.log(...i); //=> 1, 2, 3
Note that if you add asynchronous defaults into a synchronous pipeline, they will be processed as simple values.
Adds a default value, iterator or iterable to an empty pipeline.
If the pipeline has at least one value, the defaults are ignored.
Note that if you add asynchronous defaults into a synchronous pipeline, they will be processed as simple values.