Sha256: 5d4e6d70616f0e4ecb6409968dc778ed4363a502c80fa73dbd98e240cfce4f1e
Contents?: true
Size: 1.37 KB
Versions: 62
Compression:
Stored size: 1.37 KB
Contents
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ var ContextDependencyHelpers = exports; ContextDependencyHelpers.create = function(Dep, range, param, expr, options) { if(param.isWrapped() && param.prefix.isString()) { var prefix = param.prefix.string; var postfix = param.postfix.isString() ? param.postfix.string : ""; var prefixRange = param.prefix.range; var valueRange = [prefixRange ? prefixRange[1] : param.range[0], param.range[1]]; var idx = prefix.lastIndexOf("/"); var context = "."; if(idx >= 0) { context = prefix.substr(0, idx); prefix = "." + prefix.substr(idx); } var regExp = new RegExp("^" + prefix.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") + options.wrappedContextRegExp.source + postfix.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") + "$"); var dep = new Dep(context, options.wrappedContextRecursive, regExp, range, valueRange); dep.loc = expr.loc; dep.prepend = prefix; dep.critical = options.wrappedContextCritical && "a part of the request of a dependency is an expression"; return dep; } else { var dep = new Dep(options.exprContextRequest, options.exprContextRecursive, options.exprContextRegExp, range, param.range); dep.loc = expr.loc; dep.critical = options.exprContextCritical && "the request of a dependency is an expression"; return dep; } };
Version data entries
62 entries across 62 versions & 1 rubygems
Version | Path |
---|---|
smock-0.1.209 | node_modules/webpack/lib/dependencies/ContextDependencyHelpers.js |
smock-0.1.208 | node_modules/webpack/lib/dependencies/ContextDependencyHelpers.js |