Sha256: 6c43561a7aa03bade1568615fb105b7ec60e811c1b5142f34996148e58dfcabd
Contents?: true
Size: 564 Bytes
Versions: 73
Compression:
Stored size: 564 Bytes
Contents
const hq = require("alias-hq"); const aliases = hq.get("webpack"); exports.cocoPath = function (aliasedPath, relative = false) { const pathParts = aliasedPath.split("/"); const alias = pathParts.shift(); const restPath = pathParts.join("/"); if (aliases[alias]) { const rootPath = aliases[alias].replace(/\/$/, ""); const path = restPath.length ? `${rootPath}/${restPath}` : rootPath; return relative ? path.replace(process.cwd(), "").replace(/^\//, "") : path; } else { throw new Error(`'${alias}' is not a valid path alias.`); } };
Version data entries
73 entries across 73 versions & 1 rubygems