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

Function parseURL

tfjs-core/src/io/model_management.ts:94–105  ·  view source on GitHub ↗

* Helper method for parsing a URL string into a scheme and a path. * * @param url E.g., 'localstorage://my-model' * @returns A dictionary with two fields: scheme and path. * Scheme: e.g., 'localstorage' in the example above. * Path: e.g., 'my-model' in the example above.

(url: string)

Source from the content-addressed store, hash-verified

92 * Path: e.g., 'my-model' in the example above.
93 */
94function parseURL(url: string): {scheme: string, path: string} {
95 if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {
96 throw new Error(
97 `The url string provided does not contain a scheme. ` +
98 `Supported schemes are: ` +
99 `${ModelStoreManagerRegistry.getSchemes().join(',')}`);
100 }
101 return {
102 scheme: url.split(URL_SCHEME_SUFFIX)[0],
103 path: url.split(URL_SCHEME_SUFFIX)[1],
104 };
105}
106
107async function cloneModelInternal(
108 sourceURL: string, destURL: string,

Callers 2

cloneModelInternalFunction · 0.85
removeModelFunction · 0.85

Calls 3

joinMethod · 0.80
getSchemesMethod · 0.80
splitMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…