MCPcopy
hub / github.com/tensorflow/tfjs / parseUrl

Function parseUrl

tfjs-core/src/io/http.ts:255–262  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

253 * @param url the model url to be parsed.
254 */
255export function parseUrl(url: string): [string, string] {
256 const lastSlash = url.lastIndexOf('/');
257 const lastSearchParam = url.lastIndexOf('?');
258 const prefix = url.substring(0, lastSlash);
259 const suffix =
260 lastSearchParam > lastSlash ? url.substring(lastSearchParam) : '';
261 return [prefix + '/', suffix];
262}
263
264export function isHTTPScheme(url: string): boolean {
265 return url.match(HTTPRequest.URL_SCHEME_REGEX) != null;

Callers 2

http_test.tsFile · 0.90
getWeightUrlsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…