public static function find_one_amd_module($component, $jsfilename, $debug = false) {
        $jsfileroot = core_component::get_component_directory($component);
        if (!$jsfileroot) {
            return array();
        }

        $module = str_replace('.js', '', $jsfilename);

        $srcdir = $jsfileroot . '/amd/build';
        $minpart = '.min';
        if ($debug) {
            $srcdir = $jsfileroot . '/amd/src';
            $minpart = '';
        }

        $filename = $srcdir . '/' . $module . $minpart . '.js';
        if (!file_exists($filename)) {
            return array();
        }

        $fullmodulename = $component . '/' . $module;
        return array($fullmodulename => $filename);
    }
public static function find_one_amd_module($component, $jsfilename, $debug = false) {
        $jsfileroot = core_component::get_component_directory($component);
        if (!$jsfileroot) {
            return array();
        }

        $module = str_replace('.js', '', $jsfilename);

        $srcdir = $jsfileroot . '/amd/build';
        $minpart = '.min';
        if ($debug) {
            $srcdir = $jsfileroot . '/amd/src';
            $minpart = '';
        }

        $filename = $srcdir . '/' . $module . $minpart . '.js';
        if (!file_exists($filename)) {
            return array();
        }

        $fullmodulename = $component . '/' . $module;
        return array($fullmodulename => $filename);
    }
public static function find_one_amd_module ( $ component , $ jsfilename , $ debug = false ) { $ jsfileroot = core_component :: get_component_directory ( $ component ) ; if ( ! $ jsfileroot ) { return array ( ) ; } $ module = str_replace ( '.js' , '' , $ jsfilename ) ; $ srcdir = $ jsfileroot . '/amd/build' ; $ minpart = '.min' ; if ( $ debug ) { $ srcdir = $ jsfileroot . '/amd/src' ; $ minpart = '' ; } $ filename = $ srcdir . '/' . $ module . $ minpart . '.js' ; if ( ! file_exists ( $ filename ) ) { return array ( ) ; } $ fullmodulename = $ component . '/' . $ module ; return array ( $ fullmodulename => $ filename ) ; }
Check a single module exists and return the full path to it.

The expected location for amd modules is:
<componentdir>/amd/src/modulename.js

@param string $component The component determines the folder the js file should be in.
@param string $jsfilename The filename for the module (with the js extension).
@param boolean $debug If true, returns the paths to the original (unminified) source files.
@return array $files An array of mappings from module names to file paths.
Empty array if the file does not exist.
Check a single module exists and return the full path to it .