本文整理汇总了TypeScript中@core/util/path.path_normalize函数的典型用法代码示例。如果您正苦于以下问题:TypeScript path_normalize函数的具体用法?TypeScript path_normalize怎么用?TypeScript path_normalize使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了path_normalize函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);
}
示例3: 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);
}
示例4: u_setOption
export function u_setOption (options, key, val) {
if (key === 'base' || key === 'nsBase') {
var path = path_normalize(val);
if (path[path.length - 1] !== '/') {
path += '/';
}
// Do not resolve root, as it will be resolved by base later
// @NextIteration: remove also path_resolveRoot, use instead resolveCurrent
// if (path[0] === '/') {
// path = path_combine(path_resolveRoot(), path);
// }
options[key] = path;
return this;
}
var current = obj_getProperty(options, key);
if (is_Object(current) && is_Object(val)) {
obj_extend(current, val);
return this;
}
obj_setProperty(options, key, val);
};
示例5: eq_
].forEach(row => {
var [ path, expect ] = row;
eq_(path_normalize(path), expect);
});