本文整理匯總了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) !== '';
}