本文整理匯總了TypeScript中@core/util/path.path_isRelative函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript path_isRelative函數的具體用法?TypeScript path_isRelative怎麽用?TypeScript path_isRelative使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了path_isRelative函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: 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);
};
示例2: 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;
};
示例3: 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);
}
示例4: 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);
}