当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript class_Uri.combine方法代码示例

本文整理汇总了TypeScript中atma-utils.class_Uri.combine方法的典型用法代码示例。如果您正苦于以下问题:TypeScript class_Uri.combine方法的具体用法?TypeScript class_Uri.combine怎么用?TypeScript class_Uri.combine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在atma-utils.class_Uri的用法示例。


在下文中一共展示了class_Uri.combine方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: prepare

export function prepare (path: string, options: IOptions) {
    if (lastOptions === options) {
        return;
    }
    lastOptions = options;
    
    var base = options.base;
    if (base[0] === '/') {
        base = class_Uri.combine(process.cwd(), base);
    }

    options.plugins.map(function(name){
        if (name[0] === '.' || name[0] === '/') {
            name = pathUtils.join(base, name);
        }
        let plugin: IPlugin = require(name);
        let config = options.configs && options.configs[name];
        if (config) {
            mask.cfg(name, config);            
        }
        plugin.initialize(optimizer, config, mask, io);
        plugins.push(plugin);        
    });

    configurate(lastConfiguration);
}
开发者ID:tenbits,项目名称:postmask,代码行数:26,代码来源:plugins.ts

示例2: secondHasCommonExports

    function secondHasCommonExports(a: string, b: string): { exportPath: string, isSubPath: boolean } {
        const FILE = 'exports.ts';
        if (b.endsWith(FILE)) {
            return null;
        }

        let uriA = new class_Uri(a);
        let uriB = new class_Uri(b);
        let uriExports = null;
        let dir = new class_Uri(uriB.toLocalDir());
        let prev = dir.toLocalDir();
        while (uriExports == null) {
            let exp = dir.combine(FILE);
            if (io.File.exists(exp)) {
                uriExports = exp;
                break;
            }
            dir = dir.cdUp();
            if (dir.toLocalDir() === prev) {
                break;
            }
            prev = dir.toLocalDir();
        }
        if (uriExports == null) {
            return null;
        }
        let local = uriExports.toLocalFile();
        if (local in modules === false) {
            return null;
        }
        return {
            exportPath: local,
            isSubPath: secondIsSubPath(local, a)
        }        
    }
开发者ID:atmajs,项目名称:app-bundler,代码行数:35,代码来源:ModuleTree.ts

示例3: path_isRelative

		dependencies && dependencies.filter(x => x.pos != null && path_isRelative(x.url)).forEach(dep => {
			
			let resUrl = new class_Uri(resource.url);
			let resDep = new class_Uri(dep.url);
			
			
			let url = resUrl.combine(resDep as any).toLocalFile();

			let start = dep.pos + offset + 1;
			let c = content[start - 1];
			let end = content.indexOf(c, start);

			let oldLength = end - start;
			let newLength = url.length;

			content = content.substring(0, start) + url + content.substring(end);
			offset += newLength - oldLength;
		})
开发者ID:atmajs,项目名称:app-bundler,代码行数:18,代码来源:GlobalJsBuilder.ts

示例4: toDir

function toDir(path) {
    return class_Uri.combine(normalizePath(path), '/');
}
开发者ID:atmajs,项目名称:atma-io,代码行数:3,代码来源:Env.ts

示例5: class_Uri

                break;
        }

        if (path == null) {
            logger.error('<io.env> Unknown AppData Dir');

            Object.defineProperty(this, 'appdataDir', {
                value: this.applicationDir
            });
            return this.applicationDir;
        }

        path = new class_Uri(toDir(path));

        if (platform === 'darwin')
            path = path.combine('Library/Application Support/');

        path = path.combine('.' + mainFile.file + '/');

        Object.defineProperty(this, 'appdataDir', {
            value: path
        });
        return path;
    }
};

function toDir(path) {
    return class_Uri.combine(normalizePath(path), '/');
}
function normalizePath(path) {
    return path.replace(/\\/g, '/');
开发者ID:atmajs,项目名称:atma-io,代码行数:31,代码来源:Env.ts


注:本文中的atma-utils.class_Uri.combine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。