Home / File/ util.ts — astro Source File

util.ts — astro Source File

Architecture documentation for util.ts, a typescript file in the astro codebase.

Entity Profile

Relationship Graph

Source Code

export function isPromise<T = any>(value: any): value is Promise<T> {
	return (
		!!value && typeof value === 'object' && 'then' in value && typeof value.then === 'function'
	);
}

export async function* streamAsyncIterator(stream: ReadableStream) {
	const reader = stream.getReader();

	try {
		while (true) {
			const { done, value } = await reader.read();
			if (done) return;
			yield value;
		}
	} finally {
		reader.releaseLock();
	}
}

Domain

Subdomains

Frequently Asked Questions

What does util.ts do?
util.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in util.ts?
util.ts defines 2 function(s): isPromise, streamAsyncIterator.
Where is util.ts in the architecture?
util.ts is located at packages/astro/src/runtime/server/util.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/runtime/server).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free