MCPcopy Create free account
hub / github.com/alignoth/alignoth / Io

Function Io

resources/vega.min.js:3089–3121  ·  view source on GitHub ↗
(t, e)

Source from the content-addressed store, hash-verified

3087 return n.localFile ? this.file(r) : this.http(r, e);
3088 }
3089 async function Io(t, e) {
3090 e = ot({}, this.options, e);
3091 const n = this.fileAccess,
3092 r = { href: null };
3093 let i, o, a;
3094 const u = Uo.test(t.replace(qo, ""));
3095 (null != t && "string" == typeof t && u) ||
3096 s("Sanitize failure, invalid URI: " + Dt(t));
3097 const l = Lo.test(t);
3098 return (
3099 (a = e.baseURL) &&
3100 !l &&
3101 (t.startsWith("/") || a.endsWith("/") || (t = "/" + t), (t = a + t)),
3102 (o =
3103 (i = t.startsWith(Po)) ||
3104 "file" === e.mode ||
3105 ("http" !== e.mode && !l && n)),
3106 i
3107 ? (t = t.slice(Po.length))
3108 : t.startsWith("//") &&
3109 ("file" === e.defaultProtocol
3110 ? ((t = t.slice(2)), (o = !0))
3111 : (t = (e.defaultProtocol || "http") + ":" + t)),
3112 Object.defineProperty(r, "localFile", { value: !!o }),
3113 (r.href = t),
3114 e.target && (r.target = e.target + ""),
3115 e.rel && (r.rel = e.rel + ""),
3116 "image" === e.context &&
3117 e.crossOrigin &&
3118 (r.crossOrigin = e.crossOrigin + ""),
3119 r
3120 );
3121 }
3122 function Wo(t) {
3123 return Ho;
3124 }

Callers

nothing calls this directly

Calls 4

DtFunction · 0.85
testMethod · 0.80
otFunction · 0.70
sFunction · 0.70

Tested by

no test coverage detected