// operator/before.ts
/*
* Copyright (c) 2021-2026 Check Digit, LLC
*
* This code is licensed under the MIT license (see LICENSE.txt for details).
*/
import type { Asyncerator } from '../asyncerator.ts';
import type { Operator } from './index.ts';
/**
* Emit a value before a stream starts.
* @param value
*/
export default function (value: Input): Operator {
return async function* (iterator: Asyncerator) {
yield value;
yield* iterator;
};
}