MCPcopy Index your code
hub / github.com/keepfool/vue-tutorials / resolveAsset

Function resolveAsset

01.GettingStarted/js/vue.js:1932–1948  ·  view source on GitHub ↗

* Resolve an asset. * This function is used because child instances need access * to assets defined in its ancestor chain. * * @param {Object} options * @param {String} type * @param {String} id * @param {Boolean} warnMissing * @return {Object|Function}

(options, type, id, warnMissing)

Source from the content-addressed store, hash-verified

1930 */
1931
1932 function resolveAsset(options, type, id, warnMissing) {
1933 /* istanbul ignore if */
1934 if (typeof id !== 'string') {
1935 return;
1936 }
1937 var assets = options[type];
1938 var camelizedId;
1939 var res = assets[id] ||
1940 // camelCase ID
1941 assets[camelizedId = camelize(id)] ||
1942 // Pascal Case ID
1943 assets[camelizedId.charAt(0).toUpperCase() + camelizedId.slice(1)];
1944 if ('development' !== 'production' && warnMissing && !res) {
1945 warn('Failed to resolve ' + type.slice(0, -1) + ': ' + id, options);
1946 }
1947 return res;
1948 }
1949
1950 var uid$1 = 0;
1951

Callers 8

checkComponentAttrFunction · 0.70
getIsBindingFunction · 0.70
vue.jsFile · 0.70
checkElementDirectivesFunction · 0.70
checkTerminalDirectivesFunction · 0.70
compileDirectivesFunction · 0.70
transcludeTemplateFunction · 0.70
miscMixinFunction · 0.70

Calls 2

camelizeFunction · 0.70
warnFunction · 0.70

Tested by

no test coverage detected