* 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)
| 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 |
no test coverage detected