本文整理汇总了TypeScript中@core/util/path.path_getExtension函数的典型用法代码示例。如果您正苦于以下问题:TypeScript path_getExtension函数的具体用法?TypeScript path_getExtension怎么用?TypeScript path_getExtension使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了path_getExtension函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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);
}
示例2: type_get
export function type_get(endpoint: Endpoint) {
var type = endpoint.contentType;
if (type == null && endpoint.moduleType != null) {
var x = _typeMappings[endpoint.moduleType];
if (x != null) {
return x;
}
}
var ext = type || path_getExtension(endpoint.path);
if (ext === '' || ext === 'mask') {
return 'mask';
}
return _typeMappings[ext];
}
示例3: type_isMask
export function type_isMask(endpoint: Endpoint) {
var type = endpoint.contentType,
ext = type || path_getExtension(endpoint.path);
return ext === '' || ext === 'mask' || ext === 'html';
}
示例4: hasExt
function hasExt(path) {
return path_getExtension(path) !== '';
}