當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。