INNER CODE UNIT · TypeScript
needsNativeHydration
tianma-if/edgeever · apps/ios/EditorSource/src/main.ts:299
function needsNativeHydration(src: string): boolean {
if (!src || src.startsWith("data:") || src.startsWith("blob:") || src.startsWith("edgeever-res:")) {
return false;
}
// Protected API paths always need auth + rewrite.
if (isProtectedResource(src)) return true;
// Absolute remote images also need rewrite under file:// packaging.
if (src.startsWith("http://") || src.startsWith("https://")) return true;
// Root-relative non-api assets resolved via native base URL.
if (src.startsWith("/")) return true;
return false;
}
function requestResource(source: string): Promise<string | null> {
return new Promise((resolve) => {
const requestId = `r${++resourceSeq}`;
resourceResolvers.set(requestId, resolve);
post({ type: "loadResource", requestId, source });