本文整理汇总了TypeScript中untildify.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getKnownSearchPathsForVirtualEnvs
export function getKnownSearchPathsForVirtualEnvs(): string[] {
const paths: string[] = [];
if (!IS_WINDOWS) {
const defaultPaths = ['/Envs', '/.virtualenvs', '/.pyenv', '/.pyenv/versions'];
defaultPaths.forEach(p => {
paths.push(untildify('~' + p));
});
}
const venvPath = settings.PythonSettings.getInstance().venvPath;
if (venvPath) {
paths.push(untildify(venvPath));
}
if (workspace.rootPath) {
paths.push(workspace.rootPath);
}
return paths;
}
示例2: findConfig
function findConfig(domain: ConfigDomain, exists: boolean = true) {
const configPath = untildify(configPaths[domain]);
const absolute = path.isAbsolute(configPath);
let currentDir = process.cwd();
let fullPath = absolute ? configPath : path.resolve(currentDir, configPath);
if (!exists) {
return fullPath;
}
// If the config path is not already an absolute path, recursively
// find the config file until we find an existing one.
while (!absolute && currentDir !== path.dirname(currentDir)) {
fullPath = path.resolve(currentDir, configPath);
if (fs.existsSync(fullPath)) {
if (domain === ConfigDomain.LocalDomain && isGlobalConfigPath(fullPath)) {
// We are looking for local config, but we only find the global
// one, meaning local config doesn't exist.
return undefined;
}
return fullPath;
}
currentDir = path.dirname(currentDir);
}
fullPath = path.resolve(currentDir, configPath);
return fs.existsSync(fullPath) ? fullPath : undefined;
}
示例3: _generate
function _generate(name: string, location: string) {
Logger.info('Creating project directory...');
let sanitizedName = _sanitize(name);
let folder: string = Untildify(Path.join(location, sanitizedName));
_mkdir(folder);
Logger.info('Creating database directory...');
let dbFolder = Path.join(folder, 'db');
_mkdir(dbFolder);
Logger.info('Creating environment.json...');
let environment = environmentGenerator();
let environmentPath = Path.join(folder, 'environment.json');
_writeJSON(environmentPath, environment);
Logger.info('Creating resources.json...');
let resources = _resourcesGenerator(name);
let resourcePath = Path.join(folder, 'resources.json');
_writeJSON(resourcePath, resources);
}
示例4: isGlobalConfigPath
function isGlobalConfigPath(configPath: string) {
const globalConfigPath = path.resolve(
untildify(configPaths[ConfigDomain.GlobalDomain])
);
return globalConfigPath === configPath;
}