lib/level.js
function(techPath) {
        // Get absolute path if path starts with "."
        // NOTE: Can not replace check to !isAbsolute()
        if(techPath.substring(0, 1) === '.') {
            // Resolve relative path starting at level `.bem/` directory
            techPath = PATH.join(this.bemDir, techPath);

            /* jshint -W109 */
            if(!isRequireable(techPath)) {
                throw new Error("Tech module on path '" + techPath + "' not found");
            }
            /* jshint +W109 */

            return techPath;
        }

        // Trying absolute of relative-without-dot path
        if(isRequireable(techPath)) {
            return techPath;
        }


        /* jshint -W109 */
        try {
            return require.resolve('./' + PATH.join('./techs', techPath));
        } catch (err) {
            throw new Error("Tech module with path '" + techPath + "' not found on require search paths");
        }
        /* jshint +W109 */
    }
function(techPath) {
        // Get absolute path if path starts with "."
        // NOTE: Can not replace check to !isAbsolute()
        if(techPath.substring(0, 1) === '.') {
            // Resolve relative path starting at level `.bem/` directory
            techPath = PATH.join(this.bemDir, techPath);

            /* jshint -W109 */
            if(!isRequireable(techPath)) {
                throw new Error("Tech module on path '" + techPath + "' not found");
            }
            /* jshint +W109 */

            return techPath;
        }

        // Trying absolute of relative-without-dot path
        if(isRequireable(techPath)) {
            return techPath;
        }


        /* jshint -W109 */
        try {
            return require.resolve('./' + PATH.join('./techs', techPath));
        } catch (err) {
            throw new Error("Tech module with path '" + techPath + "' not found on require search paths");
        }
        /* jshint +W109 */
    }
function ( techPath ) { // Get absolute path if path starts with "." // NOTE: Can not replace check to !isAbsolute() if ( techPath . substring ( 0 , 1 ) === '.' ) { // Resolve relative path starting at level `.bem/` directory techPath = PATH . join ( this . bemDir , techPath ) ; /* jshint -W109 */ if ( ! isRequireable ( techPath ) ) { throw new Error ( "Tech module on path '" + techPath + "' not found" ) ; } /* jshint +W109 */ return techPath ; } // Trying absolute of relative-without-dot path if ( isRequireable ( techPath ) ) { return techPath ; } /* jshint -W109 */ try { return require . resolve ( './' + PATH . join ( './techs' , techPath ) ) ; } catch ( err ) { throw new Error ( "Tech module with path '" + techPath + "' not found on require search paths" ) ; } /* jshint +W109 */ }
Resolve tech module path.

@throws {Error}  In case when tech module is not found.
@param {String} techPath  Tech path (relative or absolute).
@return {String}  Tech module path.
Resolve tech module path .