当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript path.path_combine函数代码示例

本文整理汇总了TypeScript中@core/util/path.path_combine函数的典型用法代码示例。如果您正苦于以下问题:TypeScript path_combine函数的具体用法?TypeScript path_combine怎么用?TypeScript path_combine使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了path_combine函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: check

 function check(){
     nodeModules = path_combine(root, current, '/node_modules/', name, '/');
     lookups.unshift(path_combine(nodeModules, 'package.json'));
     _file_get(lookups[0]).then(function(text){
         onComplete(null, text);
     }, onComplete);
 }
开发者ID:atmajs,项目名称:MaskJS,代码行数:7,代码来源:utils.ts

示例2: toAbsolute

function toAbsolute(path_, ctx, ctr, module) {
    var path = path_;
    if (path_isRelative(path)) {
        path = path_combine(u_resolveLocation(ctx, ctr, module), path);
    }
    else if (path.charCodeAt(0) === 47 /*/*/) {
        path = path_combine(u_resolveBase(), path);
    }
    return path_normalize(path);
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:10,代码来源:utils.ts

示例3: u_resolveLocation

export function u_resolveLocation (ctx, ctr?, module?) {
    if (module != null) {
        return module.location;
    }
    while(ctr != null) {
        if (ctr.location != null) {
            return ctr.location;
        }
        if (ctr.resource != null && ctr.resource.location) {
            return ctr.resource.location;
        }
        ctr = ctr.parent;
    }
    var path = null;
    if (ctx != null) {
        if (ctx.filename != null) {
            path = path_getDir(path_normalize(ctx.filename));
        }
        if (ctx.dirname != null) {
            path = path_normalize(ctx.dirname + '/');
        }
    }
    if (path == null) {
        return path_resolveCurrent();
    }
    if (path_isRelative(path) === false) {
        return path;
    }
    return path_combine(u_resolveBase(), path);
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:30,代码来源:utils.ts

示例4: onComplete

 function onComplete(error, text) {
     var json;
     if (text) {
         try { json = JSON.parse(text); }
         catch (error) {}
     }
     if (error != null || json == null) {
         var next = current.replace(/[^\/]+\/?$/, '');
         if (next === current) {
             cb('Module was not resolved: ' + lookups.join(','));
             return;
         }
         current = next;
         check();
         return;
     }
     if (resource) {
         cb(null, nodeModules + resource);
         return;
     }
     var filename;
     if (contentType === 'mask' && json.mainMask) {
         filename = json.mainMask;
     }
     else if (contentType === 'js' && json.main) {
         filename = json.main;
     } else {
         filename = 'index.' + _ext[contentType];
     }
     cb(null, path_combine(nodeModules, filename));
 }
开发者ID:atmajs,项目名称:MaskJS,代码行数:31,代码来源:utils.ts

示例5: fromNs

function fromNs(node) {
    var type = node.contentType || 'script';
    var path = node.namespace.replace(/\./g, '/');
    if (path[0] === '/') {
        path = '.' + path;
    } else {
        var base = _opts.nsBase;
        if (base != null) {
            path = path_combine(base, path);
        }
    }
    var exports = node.exports;
    if (exports == null) {
        path += '/' + node.alias;
    }
    else if (exports.length === 1) {
        var exp = exports[0];
        var name = exp.name;
        path += '/' + name;

        if (type === 'script' && _opts.es6Modules !== true) {
            node.alias = exp.alias || name;
            node.exports = null;
        }
    }		
    var default_ = _opts.ext[type] || type;
    path += '.' + default_;
    return path;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:29,代码来源:utils.ts

示例6: u_resolveBase

export function u_resolveBase (){
    if (_opts.base == null) {
        _opts.base = path_resolveCurrent();
    }
    else if (path_isRelative(_opts.base) === true) {
        _opts.base = path_combine(path_resolveCurrent(), _opts.base);
    }
    return _opts.base;
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:9,代码来源:utils.ts

示例7: resolvePath

	function resolvePath(node, location) {
		var path = node.path,
			type = node.contentType;
		if ((type == null || type === 'mask') && path_getExtension(path) === '') {
			path += '.mask';
		}
		if (path_isRelative(path)) {
			path = path_combine(location, path);
		}
		return path_normalize(path);
	}
开发者ID:atmajs,项目名称:MaskJS,代码行数:11,代码来源:dependencies.ts

示例8: eq_

 ].forEach(row => {
     var [ base, path, expect ] = row;
     
     eq_(path_combine(base, path), expect);
 });
开发者ID:atmajs,项目名称:MaskJS,代码行数:5,代码来源:path.spec.ts


注:本文中的@core/util/path.path_combine函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。