declare const _default: "\n\nexport function assertPath(path) {\n\tif (typeof path !== 'string') {\n\t\tthrow new TypeError('Path must be a string. Received ' + JSON.stringify(path))\n\t}\n}\n\n// Resolves . and .. elements in a path with directory names\nexport function normalizeStringPosix(path, allowAboveRoot) {\n\tvar res = ''\n\tvar lastSegmentLength = 0\n\tvar lastSlash = -1\n\tvar dots = 0\n\tvar code\n\tfor (var i = 0; i <= path.length; ++i) {\n\t\tif (i < path.length) code = path.charCodeAt(i)\n\t\telse if (code === 47 /*/*/) break\n\t\telse code = 47 /*/*/\n\t\tif (code === 47 /*/*/) {\n\t\t\tif (lastSlash === i - 1 || dots === 1) {\n\t\t\t\t// NOOP\n\t\t\t} else if (lastSlash !== i - 1 && dots === 2) {\n\t\t\t\tif (\n\t\t\t\t\tres.length < 2 ||\n\t\t\t\t\tlastSegmentLength !== 2 ||\n\t\t\t\t\tres.charCodeAt(res.length - 1) !== 46 /*.*/ ||\n\t\t\t\t\tres.charCodeAt(res.length - 2) !== 46 /*.*/\n\t\t\t\t) {\n\t\t\t\t\tif (res.length > 2) {\n\t\t\t\t\t\tvar lastSlashIndex = res.lastIndexOf('/')\n\t\t\t\t\t\tif (lastSlashIndex !== res.length - 1) {\n\t\t\t\t\t\t\tif (lastSlashIndex === -1) {\n\t\t\t\t\t\t\t\tres = ''\n\t\t\t\t\t\t\t\tlastSegmentLength = 0\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tres = res.slice(0, lastSlashIndex)\n\t\t\t\t\t\t\t\tlastSegmentLength = res.length - 1 - res.lastIndexOf('/')\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlastSlash = i\n\t\t\t\t\t\t\tdots = 0\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (res.length === 2 || res.length === 1) {\n\t\t\t\t\t\tres = ''\n\t\t\t\t\t\tlastSegmentLength = 0\n\t\t\t\t\t\tlastSlash = i\n\t\t\t\t\t\tdots = 0\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (allowAboveRoot) {\n\t\t\t\t\tif (res.length > 0) res += '/..'\n\t\t\t\t\telse res = '..'\n\t\t\t\t\tlastSegmentLength = 2\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (res.length > 0) res += '/' + path.slice(lastSlash + 1, i)\n\t\t\t\telse res = path.slice(lastSlash + 1, i)\n\t\t\t\tlastSegmentLength = i - lastSlash - 1\n\t\t\t}\n\t\t\tlastSlash = i\n\t\t\tdots = 0\n\t\t} else if (code === 46 /*.*/ && dots !== -1) {\n\t\t\t++dots\n\t\t} else {\n\t\t\tdots = -1\n\t\t}\n\t}\n\treturn res\n}\n\nfunction _format(sep, pathObject) {\n\tvar dir = pathObject.dir || pathObject.root\n\tvar base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '')\n\tif (!dir) {\n\t\treturn base\n\t}\n\tif (dir === pathObject.root) {\n\t\treturn dir + base\n\t}\n\treturn dir + sep + base\n}\n\n// path.resolve([from ...], to)\nexport const resolve = function resolve() {\n\tvar resolvedPath = ''\n\tvar resolvedAbsolute = false\n\tvar cwd\n\n\tfor (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n\t\tvar path\n\t\tif (i >= 0) path = arguments[i]\n\t\telse {\n\t\t\tif (cwd === undefined) cwd = process.cwd()\n\t\t\tpath = cwd\n\t\t}\n\n\t\tassertPath(path)\n\n\t\t// Skip empty entries\n\t\tif (path.length === 0) {\n\t\t\tcontinue\n\t\t}\n\n\t\tresolvedPath = path + '/' + resolvedPath\n\t\tresolvedAbsolute = path.charCodeAt(0) === 47 /*/*/\n\t}\n\n\t// At this point the path should be resolved to a full absolute path, but\n\t// handle relative paths to be safe (might happen when process.cwd() fails)\n\n\t// Normalize the path\n\tresolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute)\n\n\tif (resolvedAbsolute) {\n\t\tif (resolvedPath.length > 0) return '/' + resolvedPath\n\t\telse return '/'\n\t} else if (resolvedPath.length > 0) {\n\t\treturn resolvedPath\n\t} else {\n\t\treturn '.'\n\t}\n}\n\nexport const normalize = function normalize(path) {\n\tassertPath(path)\n\n\tif (path.length === 0) return '.'\n\n\tvar isAbsolute = path.charCodeAt(0) === 47 /*/*/\n\tvar trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/\n\n\t// Normalize the path\n\tpath = normalizeStringPosix(path, !isAbsolute)\n\n\tif (path.length === 0 && !isAbsolute) path = '.'\n\tif (path.length > 0 && trailingSeparator) path += '/'\n\n\tif (isAbsolute) return '/' + path\n\treturn path\n}\n\nexport const isAbsolute = function isAbsolute(path) {\n\tassertPath(path)\n\treturn path.length > 0 && path.charCodeAt(0) === 47 /*/*/\n}\n\nexport const join = function join() {\n\tif (arguments.length === 0) return '.'\n\tvar joined\n\tfor (var i = 0; i < arguments.length; ++i) {\n\t\tvar arg = arguments[i]\n\t\tassertPath(arg)\n\t\tif (arg.length > 0) {\n\t\t\tif (joined === undefined) joined = arg\n\t\t\telse joined += '/' + arg\n\t\t}\n\t}\n\tif (joined === undefined) return '.'\n\treturn normalize(joined)\n}\n\nexport const relative = function relative(from, to) {\n\tassertPath(from)\n\tassertPath(to)\n\n\tif (from === to) return ''\n\n\tfrom = resolve(from)\n\tto = resolve(to)\n\n\tif (from === to) return ''\n\n\t// Trim any leading backslashes\n\tvar fromStart = 1\n\tfor (; fromStart < from.length; ++fromStart) {\n\t\tif (from.charCodeAt(fromStart) !== 47 /*/*/) break\n\t}\n\tvar fromEnd = from.length\n\tvar fromLen = fromEnd - fromStart\n\n\t// Trim any leading backslashes\n\tvar toStart = 1\n\tfor (; toStart < to.length; ++toStart) {\n\t\tif (to.charCodeAt(toStart) !== 47 /*/*/) break\n\t}\n\tvar toEnd = to.length\n\tvar toLen = toEnd - toStart\n\n\t// Compare paths to find the longest common path from root\n\tvar length = fromLen < toLen ? fromLen : toLen\n\tvar lastCommonSep = -1\n\tvar i = 0\n\tfor (; i <= length; ++i) {\n\t\tif (i === length) {\n\t\t\tif (toLen > length) {\n\t\t\t\tif (to.charCodeAt(toStart + i) === 47 /*/*/) {\n\t\t\t\t\t// We get here if `from` is the exact base path for `to`.\n\t\t\t\t\t// For example: from='/foo/bar'; to='/foo/bar/baz'\n\t\t\t\t\treturn to.slice(toStart + i + 1)\n\t\t\t\t} else if (i === 0) {\n\t\t\t\t\t// We get here if `from` is the root\n\t\t\t\t\t// For example: from='/'; to='/foo'\n\t\t\t\t\treturn to.slice(toStart + i)\n\t\t\t\t}\n\t\t\t} else if (fromLen > length) {\n\t\t\t\tif (from.charCodeAt(fromStart + i) === 47 /*/*/) {\n\t\t\t\t\t// We get here if `to` is the exact base path for `from`.\n\t\t\t\t\t// For example: from='/foo/bar/baz'; to='/foo/bar'\n\t\t\t\t\tlastCommonSep = i\n\t\t\t\t} else if (i === 0) {\n\t\t\t\t\t// We get here if `to` is the root.\n\t\t\t\t\t// For example: from='/foo'; to='/'\n\t\t\t\t\tlastCommonSep = 0\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tvar fromCode = from.charCodeAt(fromStart + i)\n\t\tvar toCode = to.charCodeAt(toStart + i)\n\t\tif (fromCode !== toCode) break\n\t\telse if (fromCode === 47 /*/*/) lastCommonSep = i\n\t}\n\n\tvar out = ''\n\t// Generate the relative path based on the path difference between `to`\n\t// and `from`\n\tfor (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n\t\tif (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {\n\t\t\tif (out.length === 0) out += '..'\n\t\t\telse out += '/..'\n\t\t}\n\t}\n\n\t// Lastly, append the rest of the destination (`to`) path that comes after\n\t// the common path parts\n\tif (out.length > 0) return out + to.slice(toStart + lastCommonSep)\n\telse {\n\t\ttoStart += lastCommonSep\n\t\tif (to.charCodeAt(toStart) === 47 /*/*/) ++toStart\n\t\treturn to.slice(toStart)\n\t}\n}\n\nexport const _makeLong = function _makeLong(path) {\n\treturn path\n}\n\nexport const dirname = function dirname(path) {\n\tassertPath(path)\n\tif (path.length === 0) return '.'\n\tvar code = path.charCodeAt(0)\n\tvar hasRoot = code === 47 /*/*/\n\tvar end = -1\n\tvar matchedSlash = true\n\tfor (var i = path.length - 1; i >= 1; --i) {\n\t\tcode = path.charCodeAt(i)\n\t\tif (code === 47 /*/*/) {\n\t\t\tif (!matchedSlash) {\n\t\t\t\tend = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\t// We saw the first non-path separator\n\t\t\tmatchedSlash = false\n\t\t}\n\t}\n\n\tif (end === -1) return hasRoot ? '/' : '.'\n\tif (hasRoot && end === 1) return '//'\n\treturn path.slice(0, end)\n}\n\nexport const basename = function basename(path, ext) {\n\tif (ext !== undefined && typeof ext !== 'string') throw new TypeError('\"ext\" argument must be a string')\n\tassertPath(path)\n\n\tvar start = 0\n\tvar end = -1\n\tvar matchedSlash = true\n\tvar i\n\n\tif (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n\t\tif (ext.length === path.length && ext === path) return ''\n\t\tvar extIdx = ext.length - 1\n\t\tvar firstNonSlashEnd = -1\n\t\tfor (i = path.length - 1; i >= 0; --i) {\n\t\t\tvar code = path.charCodeAt(i)\n\t\t\tif (code === 47 /*/*/) {\n\t\t\t\t// If we reached a path separator that was not part of a set of path\n\t\t\t\t// separators at the end of the string, stop now\n\t\t\t\tif (!matchedSlash) {\n\t\t\t\t\tstart = i + 1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (firstNonSlashEnd === -1) {\n\t\t\t\t\t// We saw the first non-path separator, remember this index in case\n\t\t\t\t\t// we need it if the extension ends up not matching\n\t\t\t\t\tmatchedSlash = false\n\t\t\t\t\tfirstNonSlashEnd = i + 1\n\t\t\t\t}\n\t\t\t\tif (extIdx >= 0) {\n\t\t\t\t\t// Try to match the explicit extension\n\t\t\t\t\tif (code === ext.charCodeAt(extIdx)) {\n\t\t\t\t\t\tif (--extIdx === -1) {\n\t\t\t\t\t\t\t// We matched the extension, so mark this as the end of our path\n\t\t\t\t\t\t\t// component\n\t\t\t\t\t\t\tend = i\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Extension does not match, so our result is the entire path\n\t\t\t\t\t\t// component\n\t\t\t\t\t\textIdx = -1\n\t\t\t\t\t\tend = firstNonSlashEnd\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (start === end) end = firstNonSlashEnd\n\t\telse if (end === -1) end = path.length\n\t\treturn path.slice(start, end)\n\t} else {\n\t\tfor (i = path.length - 1; i >= 0; --i) {\n\t\t\tif (path.charCodeAt(i) === 47 /*/*/) {\n\t\t\t\t// If we reached a path separator that was not part of a set of path\n\t\t\t\t// separators at the end of the string, stop now\n\t\t\t\tif (!matchedSlash) {\n\t\t\t\t\tstart = i + 1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else if (end === -1) {\n\t\t\t\t// We saw the first non-path separator, mark this as the end of our\n\t\t\t\t// path component\n\t\t\t\tmatchedSlash = false\n\t\t\t\tend = i + 1\n\t\t\t}\n\t\t}\n\n\t\tif (end === -1) return ''\n\t\treturn path.slice(start, end)\n\t}\n}\n\nexport const extname = function extname(path) {\n\tassertPath(path)\n\tvar startDot = -1\n\tvar startPart = 0\n\tvar end = -1\n\tvar matchedSlash = true\n\t// Track the state of characters (if any) we see before our first dot and\n\t// after any path separator we find\n\tvar preDotState = 0\n\tfor (var i = path.length - 1; i >= 0; --i) {\n\t\tvar code = path.charCodeAt(i)\n\t\tif (code === 47 /*/*/) {\n\t\t\t// If we reached a path separator that was not part of a set of path\n\t\t\t// separators at the end of the string, stop now\n\t\t\tif (!matchedSlash) {\n\t\t\t\tstartPart = i + 1\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif (end === -1) {\n\t\t\t// We saw the first non-path separator, mark this as the end of our\n\t\t\t// extension\n\t\t\tmatchedSlash = false\n\t\t\tend = i + 1\n\t\t}\n\t\tif (code === 46 /*.*/) {\n\t\t\t// If this is our first dot, mark it as the start of our extension\n\t\t\tif (startDot === -1) startDot = i\n\t\t\telse if (preDotState !== 1) preDotState = 1\n\t\t} else if (startDot !== -1) {\n\t\t\t// We saw a non-dot and non-path separator before our dot, so we should\n\t\t\t// have a good chance at having a non-empty extension\n\t\t\tpreDotState = -1\n\t\t}\n\t}\n\n\tif (\n\t\tstartDot === -1 ||\n\t\tend === -1 ||\n\t\t// We saw a non-dot character immediately before the dot\n\t\tpreDotState === 0 ||\n\t\t// The (right-most) trimmed path component is exactly '..'\n\t\t(preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)\n\t) {\n\t\treturn ''\n\t}\n\treturn path.slice(startDot, end)\n}\n\nexport const format = function format(pathObject) {\n\tif (pathObject === null || typeof pathObject !== 'object') {\n\t\tthrow new TypeError('The \"pathObject\" argument must be of type Object. Received type ' + typeof pathObject)\n\t}\n\treturn _format('/', pathObject)\n}\n\nexport const parse = function parse(path) {\n\tassertPath(path)\n\n\tvar ret = { root: '', dir: '', base: '', ext: '', name: '' }\n\tif (path.length === 0) return ret\n\tvar code = path.charCodeAt(0)\n\tvar isAbsolute = code === 47 /*/*/\n\tvar start\n\tif (isAbsolute) {\n\t\tret.root = '/'\n\t\tstart = 1\n\t} else {\n\t\tstart = 0\n\t}\n\tvar startDot = -1\n\tvar startPart = 0\n\tvar end = -1\n\tvar matchedSlash = true\n\tvar i = path.length - 1\n\n\t// Track the state of characters (if any) we see before our first dot and\n\t// after any path separator we find\n\tvar preDotState = 0\n\n\t// Get non-dir info\n\tfor (; i >= start; --i) {\n\t\tcode = path.charCodeAt(i)\n\t\tif (code === 47 /*/*/) {\n\t\t\t// If we reached a path separator that was not part of a set of path\n\t\t\t// separators at the end of the string, stop now\n\t\t\tif (!matchedSlash) {\n\t\t\t\tstartPart = i + 1\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif (end === -1) {\n\t\t\t// We saw the first non-path separator, mark this as the end of our\n\t\t\t// extension\n\t\t\tmatchedSlash = false\n\t\t\tend = i + 1\n\t\t}\n\t\tif (code === 46 /*.*/) {\n\t\t\t// If this is our first dot, mark it as the start of our extension\n\t\t\tif (startDot === -1) startDot = i\n\t\t\telse if (preDotState !== 1) preDotState = 1\n\t\t} else if (startDot !== -1) {\n\t\t\t// We saw a non-dot and non-path separator before our dot, so we should\n\t\t\t// have a good chance at having a non-empty extension\n\t\t\tpreDotState = -1\n\t\t}\n\t}\n\n\tif (\n\t\tstartDot === -1 ||\n\t\tend === -1 ||\n\t\t// We saw a non-dot character immediately before the dot\n\t\tpreDotState === 0 ||\n\t\t// The (right-most) trimmed path component is exactly '..'\n\t\t(preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)\n\t) {\n\t\tif (end !== -1) {\n\t\t\tif (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end)\n\t\t\telse ret.base = ret.name = path.slice(startPart, end)\n\t\t}\n\t} else {\n\t\tif (startPart === 0 && isAbsolute) {\n\t\t\tret.name = path.slice(1, startDot)\n\t\t\tret.base = path.slice(1, end)\n\t\t} else {\n\t\t\tret.name = path.slice(startPart, startDot)\n\t\t\tret.base = path.slice(startPart, end)\n\t\t}\n\t\tret.ext = path.slice(startDot, end)\n\t}\n\n\tif (startPart > 0) ret.dir = path.slice(0, startPart - 1)\n\telse if (isAbsolute) ret.dir = '/'\n\n\treturn ret\n}\n\nexport const sep = '/'\nexport const delimiter = ':'\nexport const win32 = null\nexport const posix = {\n\tparse,\n\tformat,\n\textname,\n\tbasename,\n\tdirname,\n\t_makeLong,\n\trelative,\n\tjoin,\n\tisAbsolute,\n\tnormalize,\n\tresolve,\n\t_format,\n\tnormalizeStringPosix,\n\tassertPath,\n}"; export default _default;