Plato on Github
Report Home
src/resource.js
Maintainability
112.98
Lines of code
37
Difficulty
10.71
Estimated Errors
0.16
Function weight
By Complexity
By SLOC
/** * @namespace Lyria * Lyria namespace decleration */ define('lyria/resource', ['path'], function(Path) { var Resource = { /** * */ path: { assets: 'assets', audio: 'audio', data: 'data', image: 'images', scene: 'scenes', video: 'video', prefab: 'prefabs' }, /** * Returns the relative filename to an asset by filename and type * * @param {String} filename * @param {String} type */ name: function(filename, type) { if (!filename) { return; } var assetPath = Resource.path['assets']; var typePath = (Resource.path[type]) ? (Resource.path[type]) : type; return Path.resolve(assetPath, [Path.dotToPath(typePath), filename]); } }; return Resource; });