當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript path.path_getDir函數代碼示例

本文整理匯總了TypeScript中@core/util/path.path_getDir函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript path_getDir函數的具體用法?TypeScript path_getDir怎麽用?TypeScript path_getDir使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了path_getDir函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: function

	constructor: function(path, parent) {
		this.path = path;
		this.parent = parent;
		this.exports = {};
		this.location = path_getDir(path);
		this.complete_ = this.complete_.bind(this);
	},
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:7,代碼來源:Module.ts

示例2: u_resolveLocation

export function u_resolveLocation (ctx, ctr?, module?) {
    if (module != null) {
        return module.location;
    }
    while(ctr != null) {
        if (ctr.location != null) {
            return ctr.location;
        }
        if (ctr.resource != null && ctr.resource.location) {
            return ctr.resource.location;
        }
        ctr = ctr.parent;
    }
    var path = null;
    if (ctx != null) {
        if (ctx.filename != null) {
            path = path_getDir(path_normalize(ctx.filename));
        }
        if (ctx.dirname != null) {
            path = path_normalize(ctx.dirname + '/');
        }
    }
    if (path == null) {
        return path_resolveCurrent();
    }
    if (path_isRelative(path) === false) {
        return path;
    }
    return path_combine(u_resolveBase(), path);
};
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:30,代碼來源:utils.ts

示例3: u_resolveNpmPath

            u_resolveNpmPath(this.type, this.path, this.parent.location, function(err, path){
				if (err != null) {
                    self.onLoadError_(err);
					return;
                }
				self.location = path_getDir(path);
				self.path = path;
				self.doLoad();
			});
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:9,代碼來源:Module.ts

示例4: walk

	function walk(ast, path, opts, done) {
		var location = path_getDir(path);
		var dependency = {
			mask: [],
			data: [],
			style: [],
			script: [],
		};

		mask_TreeWalker.walkAsync(ast, visit, complete);

		function visit (node, next){
			if (node.tagName !== 'import') {
				return next();
			}
			var path = resolvePath(node, location);
			var type = type_get(node);
			if (opts.deep === false) {
				dependency[type].push(path);
				return next();
			}
			if ('mask' === type) {
				getMask(path, opts, function(error, dep){
					if (error) {
						return done(error);
					}
					dependency.mask.push(dep);
					next();
				});
				return;
			}

			dependency[type].push(path);
			next();
		}
		function complete() {
			done(null, dependency);
		}
	}
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:39,代碼來源:dependencies.ts


注:本文中的@core/util/path.path_getDir函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。