Greasy Fork is available in English.

path-umd

UMD version of the nodejs path library

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greatest.deepsurf.us/scripts/481190/1289097/path-umd.js

  1. (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.path = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
  2. // shim for using process in browser
  3. var process = module.exports = {};
  4.  
  5. // cached from whatever global is present so that test runners that stub it
  6. // don't break things. But we need to wrap it in a try catch in case it is
  7. // wrapped in strict mode code which doesn't define any globals. It's inside a
  8. // function because try/catches deoptimize in certain engines.
  9.  
  10. var cachedSetTimeout;
  11. var cachedClearTimeout;
  12.  
  13. function defaultSetTimout() {
  14. throw new Error('setTimeout has not been defined');
  15. }
  16. function defaultClearTimeout () {
  17. throw new Error('clearTimeout has not been defined');
  18. }
  19. (function () {
  20. try {
  21. if (typeof setTimeout === 'function') {
  22. cachedSetTimeout = setTimeout;
  23. } else {
  24. cachedSetTimeout = defaultSetTimout;
  25. }
  26. } catch (e) {
  27. cachedSetTimeout = defaultSetTimout;
  28. }
  29. try {
  30. if (typeof clearTimeout === 'function') {
  31. cachedClearTimeout = clearTimeout;
  32. } else {
  33. cachedClearTimeout = defaultClearTimeout;
  34. }
  35. } catch (e) {
  36. cachedClearTimeout = defaultClearTimeout;
  37. }
  38. } ())
  39. function runTimeout(fun) {
  40. if (cachedSetTimeout === setTimeout) {
  41. //normal enviroments in sane situations
  42. return setTimeout(fun, 0);
  43. }
  44. // if setTimeout wasn't available but was latter defined
  45. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  46. cachedSetTimeout = setTimeout;
  47. return setTimeout(fun, 0);
  48. }
  49. try {
  50. // when when somebody has screwed with setTimeout but no I.E. maddness
  51. return cachedSetTimeout(fun, 0);
  52. } catch(e){
  53. try {
  54. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  55. return cachedSetTimeout.call(null, fun, 0);
  56. } catch(e){
  57. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  58. return cachedSetTimeout.call(this, fun, 0);
  59. }
  60. }
  61.  
  62.  
  63. }
  64. function runClearTimeout(marker) {
  65. if (cachedClearTimeout === clearTimeout) {
  66. //normal enviroments in sane situations
  67. return clearTimeout(marker);
  68. }
  69. // if clearTimeout wasn't available but was latter defined
  70. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  71. cachedClearTimeout = clearTimeout;
  72. return clearTimeout(marker);
  73. }
  74. try {
  75. // when when somebody has screwed with setTimeout but no I.E. maddness
  76. return cachedClearTimeout(marker);
  77. } catch (e){
  78. try {
  79. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  80. return cachedClearTimeout.call(null, marker);
  81. } catch (e){
  82. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  83. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  84. return cachedClearTimeout.call(this, marker);
  85. }
  86. }
  87.  
  88.  
  89.  
  90. }
  91. var queue = [];
  92. var draining = false;
  93. var currentQueue;
  94. var queueIndex = -1;
  95.  
  96. function cleanUpNextTick() {
  97. if (!draining || !currentQueue) {
  98. return;
  99. }
  100. draining = false;
  101. if (currentQueue.length) {
  102. queue = currentQueue.concat(queue);
  103. } else {
  104. queueIndex = -1;
  105. }
  106. if (queue.length) {
  107. drainQueue();
  108. }
  109. }
  110.  
  111. function drainQueue() {
  112. if (draining) {
  113. return;
  114. }
  115. var timeout = runTimeout(cleanUpNextTick);
  116. draining = true;
  117.  
  118. var len = queue.length;
  119. while(len) {
  120. currentQueue = queue;
  121. queue = [];
  122. while (++queueIndex < len) {
  123. if (currentQueue) {
  124. currentQueue[queueIndex].run();
  125. }
  126. }
  127. queueIndex = -1;
  128. len = queue.length;
  129. }
  130. currentQueue = null;
  131. draining = false;
  132. runClearTimeout(timeout);
  133. }
  134.  
  135. process.nextTick = function (fun) {
  136. var args = new Array(arguments.length - 1);
  137. if (arguments.length > 1) {
  138. for (var i = 1; i < arguments.length; i++) {
  139. args[i - 1] = arguments[i];
  140. }
  141. }
  142. queue.push(new Item(fun, args));
  143. if (queue.length === 1 && !draining) {
  144. runTimeout(drainQueue);
  145. }
  146. };
  147.  
  148. // v8 likes predictible objects
  149. function Item(fun, array) {
  150. this.fun = fun;
  151. this.array = array;
  152. }
  153. Item.prototype.run = function () {
  154. this.fun.apply(null, this.array);
  155. };
  156. process.title = 'browser';
  157. process.browser = true;
  158. process.env = {};
  159. process.argv = [];
  160. process.version = ''; // empty string to avoid regexp issues
  161. process.versions = {};
  162.  
  163. function noop() {}
  164.  
  165. process.on = noop;
  166. process.addListener = noop;
  167. process.once = noop;
  168. process.off = noop;
  169. process.removeListener = noop;
  170. process.removeAllListeners = noop;
  171. process.emit = noop;
  172. process.prependListener = noop;
  173. process.prependOnceListener = noop;
  174.  
  175. process.listeners = function (name) { return [] }
  176.  
  177. process.binding = function (name) {
  178. throw new Error('process.binding is not supported');
  179. };
  180.  
  181. process.cwd = function () { return '/' };
  182. process.chdir = function (dir) {
  183. throw new Error('process.chdir is not supported');
  184. };
  185. process.umask = function() { return 0; };
  186.  
  187. },{}],"path":[function(require,module,exports){
  188. (function (process){(function (){
  189. // 'path' module extracted from Node.js v8.11.1 (only the posix part)
  190. // transplited with Babel
  191.  
  192. // Copyright Joyent, Inc. and other Node contributors.
  193. //
  194. // Permission is hereby granted, free of charge, to any person obtaining a
  195. // copy of this software and associated documentation files (the
  196. // "Software"), to deal in the Software without restriction, including
  197. // without limitation the rights to use, copy, modify, merge, publish,
  198. // distribute, sublicense, and/or sell copies of the Software, and to permit
  199. // persons to whom the Software is furnished to do so, subject to the
  200. // following conditions:
  201. //
  202. // The above copyright notice and this permission notice shall be included
  203. // in all copies or substantial portions of the Software.
  204. //
  205. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  206. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  207. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  208. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  209. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  210. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  211. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  212.  
  213. 'use strict';
  214.  
  215. function assertPath(path) {
  216. if (typeof path !== 'string') {
  217. throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));
  218. }
  219. }
  220.  
  221. // Resolves . and .. elements in a path with directory names
  222. function normalizeStringPosix(path, allowAboveRoot) {
  223. var res = '';
  224. var lastSegmentLength = 0;
  225. var lastSlash = -1;
  226. var dots = 0;
  227. var code;
  228. for (var i = 0; i <= path.length; ++i) {
  229. if (i < path.length)
  230. code = path.charCodeAt(i);
  231. else if (code === 47 /*/*/)
  232. break;
  233. else
  234. code = 47 /*/*/;
  235. if (code === 47 /*/*/) {
  236. if (lastSlash === i - 1 || dots === 1) {
  237. // NOOP
  238. } else if (lastSlash !== i - 1 && dots === 2) {
  239. if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {
  240. if (res.length > 2) {
  241. var lastSlashIndex = res.lastIndexOf('/');
  242. if (lastSlashIndex !== res.length - 1) {
  243. if (lastSlashIndex === -1) {
  244. res = '';
  245. lastSegmentLength = 0;
  246. } else {
  247. res = res.slice(0, lastSlashIndex);
  248. lastSegmentLength = res.length - 1 - res.lastIndexOf('/');
  249. }
  250. lastSlash = i;
  251. dots = 0;
  252. continue;
  253. }
  254. } else if (res.length === 2 || res.length === 1) {
  255. res = '';
  256. lastSegmentLength = 0;
  257. lastSlash = i;
  258. dots = 0;
  259. continue;
  260. }
  261. }
  262. if (allowAboveRoot) {
  263. if (res.length > 0)
  264. res += '/..';
  265. else
  266. res = '..';
  267. lastSegmentLength = 2;
  268. }
  269. } else {
  270. if (res.length > 0)
  271. res += '/' + path.slice(lastSlash + 1, i);
  272. else
  273. res = path.slice(lastSlash + 1, i);
  274. lastSegmentLength = i - lastSlash - 1;
  275. }
  276. lastSlash = i;
  277. dots = 0;
  278. } else if (code === 46 /*.*/ && dots !== -1) {
  279. ++dots;
  280. } else {
  281. dots = -1;
  282. }
  283. }
  284. return res;
  285. }
  286.  
  287. function _format(sep, pathObject) {
  288. var dir = pathObject.dir || pathObject.root;
  289. var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');
  290. if (!dir) {
  291. return base;
  292. }
  293. if (dir === pathObject.root) {
  294. return dir + base;
  295. }
  296. return dir + sep + base;
  297. }
  298.  
  299. var posix = {
  300. // path.resolve([from ...], to)
  301. resolve: function resolve() {
  302. var resolvedPath = '';
  303. var resolvedAbsolute = false;
  304. var cwd;
  305.  
  306. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  307. var path;
  308. if (i >= 0)
  309. path = arguments[i];
  310. else {
  311. if (cwd === undefined)
  312. cwd = process.cwd();
  313. path = cwd;
  314. }
  315.  
  316. assertPath(path);
  317.  
  318. // Skip empty entries
  319. if (path.length === 0) {
  320. continue;
  321. }
  322.  
  323. resolvedPath = path + '/' + resolvedPath;
  324. resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;
  325. }
  326.  
  327. // At this point the path should be resolved to a full absolute path, but
  328. // handle relative paths to be safe (might happen when process.cwd() fails)
  329.  
  330. // Normalize the path
  331. resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
  332.  
  333. if (resolvedAbsolute) {
  334. if (resolvedPath.length > 0)
  335. return '/' + resolvedPath;
  336. else
  337. return '/';
  338. } else if (resolvedPath.length > 0) {
  339. return resolvedPath;
  340. } else {
  341. return '.';
  342. }
  343. },
  344.  
  345. normalize: function normalize(path) {
  346. assertPath(path);
  347.  
  348. if (path.length === 0) return '.';
  349.  
  350. var isAbsolute = path.charCodeAt(0) === 47 /*/*/;
  351. var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;
  352.  
  353. // Normalize the path
  354. path = normalizeStringPosix(path, !isAbsolute);
  355.  
  356. if (path.length === 0 && !isAbsolute) path = '.';
  357. if (path.length > 0 && trailingSeparator) path += '/';
  358.  
  359. if (isAbsolute) return '/' + path;
  360. return path;
  361. },
  362.  
  363. isAbsolute: function isAbsolute(path) {
  364. assertPath(path);
  365. return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;
  366. },
  367.  
  368. join: function join() {
  369. if (arguments.length === 0)
  370. return '.';
  371. var joined;
  372. for (var i = 0; i < arguments.length; ++i) {
  373. var arg = arguments[i];
  374. assertPath(arg);
  375. if (arg.length > 0) {
  376. if (joined === undefined)
  377. joined = arg;
  378. else
  379. joined += '/' + arg;
  380. }
  381. }
  382. if (joined === undefined)
  383. return '.';
  384. return posix.normalize(joined);
  385. },
  386.  
  387. relative: function relative(from, to) {
  388. assertPath(from);
  389. assertPath(to);
  390.  
  391. if (from === to) return '';
  392.  
  393. from = posix.resolve(from);
  394. to = posix.resolve(to);
  395.  
  396. if (from === to) return '';
  397.  
  398. // Trim any leading backslashes
  399. var fromStart = 1;
  400. for (; fromStart < from.length; ++fromStart) {
  401. if (from.charCodeAt(fromStart) !== 47 /*/*/)
  402. break;
  403. }
  404. var fromEnd = from.length;
  405. var fromLen = fromEnd - fromStart;
  406.  
  407. // Trim any leading backslashes
  408. var toStart = 1;
  409. for (; toStart < to.length; ++toStart) {
  410. if (to.charCodeAt(toStart) !== 47 /*/*/)
  411. break;
  412. }
  413. var toEnd = to.length;
  414. var toLen = toEnd - toStart;
  415.  
  416. // Compare paths to find the longest common path from root
  417. var length = fromLen < toLen ? fromLen : toLen;
  418. var lastCommonSep = -1;
  419. var i = 0;
  420. for (; i <= length; ++i) {
  421. if (i === length) {
  422. if (toLen > length) {
  423. if (to.charCodeAt(toStart + i) === 47 /*/*/) {
  424. // We get here if `from` is the exact base path for `to`.
  425. // For example: from='/foo/bar'; to='/foo/bar/baz'
  426. return to.slice(toStart + i + 1);
  427. } else if (i === 0) {
  428. // We get here if `from` is the root
  429. // For example: from='/'; to='/foo'
  430. return to.slice(toStart + i);
  431. }
  432. } else if (fromLen > length) {
  433. if (from.charCodeAt(fromStart + i) === 47 /*/*/) {
  434. // We get here if `to` is the exact base path for `from`.
  435. // For example: from='/foo/bar/baz'; to='/foo/bar'
  436. lastCommonSep = i;
  437. } else if (i === 0) {
  438. // We get here if `to` is the root.
  439. // For example: from='/foo'; to='/'
  440. lastCommonSep = 0;
  441. }
  442. }
  443. break;
  444. }
  445. var fromCode = from.charCodeAt(fromStart + i);
  446. var toCode = to.charCodeAt(toStart + i);
  447. if (fromCode !== toCode)
  448. break;
  449. else if (fromCode === 47 /*/*/)
  450. lastCommonSep = i;
  451. }
  452.  
  453. var out = '';
  454. // Generate the relative path based on the path difference between `to`
  455. // and `from`
  456. for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
  457. if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {
  458. if (out.length === 0)
  459. out += '..';
  460. else
  461. out += '/..';
  462. }
  463. }
  464.  
  465. // Lastly, append the rest of the destination (`to`) path that comes after
  466. // the common path parts
  467. if (out.length > 0)
  468. return out + to.slice(toStart + lastCommonSep);
  469. else {
  470. toStart += lastCommonSep;
  471. if (to.charCodeAt(toStart) === 47 /*/*/)
  472. ++toStart;
  473. return to.slice(toStart);
  474. }
  475. },
  476.  
  477. _makeLong: function _makeLong(path) {
  478. return path;
  479. },
  480.  
  481. dirname: function dirname(path) {
  482. assertPath(path);
  483. if (path.length === 0) return '.';
  484. var code = path.charCodeAt(0);
  485. var hasRoot = code === 47 /*/*/;
  486. var end = -1;
  487. var matchedSlash = true;
  488. for (var i = path.length - 1; i >= 1; --i) {
  489. code = path.charCodeAt(i);
  490. if (code === 47 /*/*/) {
  491. if (!matchedSlash) {
  492. end = i;
  493. break;
  494. }
  495. } else {
  496. // We saw the first non-path separator
  497. matchedSlash = false;
  498. }
  499. }
  500.  
  501. if (end === -1) return hasRoot ? '/' : '.';
  502. if (hasRoot && end === 1) return '//';
  503. return path.slice(0, end);
  504. },
  505.  
  506. basename: function basename(path, ext) {
  507. if (ext !== undefined && typeof ext !== 'string') throw new TypeError('"ext" argument must be a string');
  508. assertPath(path);
  509.  
  510. var start = 0;
  511. var end = -1;
  512. var matchedSlash = true;
  513. var i;
  514.  
  515. if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
  516. if (ext.length === path.length && ext === path) return '';
  517. var extIdx = ext.length - 1;
  518. var firstNonSlashEnd = -1;
  519. for (i = path.length - 1; i >= 0; --i) {
  520. var code = path.charCodeAt(i);
  521. if (code === 47 /*/*/) {
  522. // If we reached a path separator that was not part of a set of path
  523. // separators at the end of the string, stop now
  524. if (!matchedSlash) {
  525. start = i + 1;
  526. break;
  527. }
  528. } else {
  529. if (firstNonSlashEnd === -1) {
  530. // We saw the first non-path separator, remember this index in case
  531. // we need it if the extension ends up not matching
  532. matchedSlash = false;
  533. firstNonSlashEnd = i + 1;
  534. }
  535. if (extIdx >= 0) {
  536. // Try to match the explicit extension
  537. if (code === ext.charCodeAt(extIdx)) {
  538. if (--extIdx === -1) {
  539. // We matched the extension, so mark this as the end of our path
  540. // component
  541. end = i;
  542. }
  543. } else {
  544. // Extension does not match, so our result is the entire path
  545. // component
  546. extIdx = -1;
  547. end = firstNonSlashEnd;
  548. }
  549. }
  550. }
  551. }
  552.  
  553. if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;
  554. return path.slice(start, end);
  555. } else {
  556. for (i = path.length - 1; i >= 0; --i) {
  557. if (path.charCodeAt(i) === 47 /*/*/) {
  558. // If we reached a path separator that was not part of a set of path
  559. // separators at the end of the string, stop now
  560. if (!matchedSlash) {
  561. start = i + 1;
  562. break;
  563. }
  564. } else if (end === -1) {
  565. // We saw the first non-path separator, mark this as the end of our
  566. // path component
  567. matchedSlash = false;
  568. end = i + 1;
  569. }
  570. }
  571.  
  572. if (end === -1) return '';
  573. return path.slice(start, end);
  574. }
  575. },
  576.  
  577. extname: function extname(path) {
  578. assertPath(path);
  579. var startDot = -1;
  580. var startPart = 0;
  581. var end = -1;
  582. var matchedSlash = true;
  583. // Track the state of characters (if any) we see before our first dot and
  584. // after any path separator we find
  585. var preDotState = 0;
  586. for (var i = path.length - 1; i >= 0; --i) {
  587. var code = path.charCodeAt(i);
  588. if (code === 47 /*/*/) {
  589. // If we reached a path separator that was not part of a set of path
  590. // separators at the end of the string, stop now
  591. if (!matchedSlash) {
  592. startPart = i + 1;
  593. break;
  594. }
  595. continue;
  596. }
  597. if (end === -1) {
  598. // We saw the first non-path separator, mark this as the end of our
  599. // extension
  600. matchedSlash = false;
  601. end = i + 1;
  602. }
  603. if (code === 46 /*.*/) {
  604. // If this is our first dot, mark it as the start of our extension
  605. if (startDot === -1)
  606. startDot = i;
  607. else if (preDotState !== 1)
  608. preDotState = 1;
  609. } else if (startDot !== -1) {
  610. // We saw a non-dot and non-path separator before our dot, so we should
  611. // have a good chance at having a non-empty extension
  612. preDotState = -1;
  613. }
  614. }
  615.  
  616. if (startDot === -1 || end === -1 ||
  617. // We saw a non-dot character immediately before the dot
  618. preDotState === 0 ||
  619. // The (right-most) trimmed path component is exactly '..'
  620. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  621. return '';
  622. }
  623. return path.slice(startDot, end);
  624. },
  625.  
  626. format: function format(pathObject) {
  627. if (pathObject === null || typeof pathObject !== 'object') {
  628. throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
  629. }
  630. return _format('/', pathObject);
  631. },
  632.  
  633. parse: function parse(path) {
  634. assertPath(path);
  635.  
  636. var ret = { root: '', dir: '', base: '', ext: '', name: '' };
  637. if (path.length === 0) return ret;
  638. var code = path.charCodeAt(0);
  639. var isAbsolute = code === 47 /*/*/;
  640. var start;
  641. if (isAbsolute) {
  642. ret.root = '/';
  643. start = 1;
  644. } else {
  645. start = 0;
  646. }
  647. var startDot = -1;
  648. var startPart = 0;
  649. var end = -1;
  650. var matchedSlash = true;
  651. var i = path.length - 1;
  652.  
  653. // Track the state of characters (if any) we see before our first dot and
  654. // after any path separator we find
  655. var preDotState = 0;
  656.  
  657. // Get non-dir info
  658. for (; i >= start; --i) {
  659. code = path.charCodeAt(i);
  660. if (code === 47 /*/*/) {
  661. // If we reached a path separator that was not part of a set of path
  662. // separators at the end of the string, stop now
  663. if (!matchedSlash) {
  664. startPart = i + 1;
  665. break;
  666. }
  667. continue;
  668. }
  669. if (end === -1) {
  670. // We saw the first non-path separator, mark this as the end of our
  671. // extension
  672. matchedSlash = false;
  673. end = i + 1;
  674. }
  675. if (code === 46 /*.*/) {
  676. // If this is our first dot, mark it as the start of our extension
  677. if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;
  678. } else if (startDot !== -1) {
  679. // We saw a non-dot and non-path separator before our dot, so we should
  680. // have a good chance at having a non-empty extension
  681. preDotState = -1;
  682. }
  683. }
  684.  
  685. if (startDot === -1 || end === -1 ||
  686. // We saw a non-dot character immediately before the dot
  687. preDotState === 0 ||
  688. // The (right-most) trimmed path component is exactly '..'
  689. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  690. if (end !== -1) {
  691. if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);
  692. }
  693. } else {
  694. if (startPart === 0 && isAbsolute) {
  695. ret.name = path.slice(1, startDot);
  696. ret.base = path.slice(1, end);
  697. } else {
  698. ret.name = path.slice(startPart, startDot);
  699. ret.base = path.slice(startPart, end);
  700. }
  701. ret.ext = path.slice(startDot, end);
  702. }
  703.  
  704. if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';
  705.  
  706. return ret;
  707. },
  708.  
  709. sep: '/',
  710. delimiter: ':',
  711. win32: null,
  712. posix: null
  713. };
  714.  
  715. posix.posix = posix;
  716.  
  717. module.exports = posix;
  718.  
  719. }).call(this)}).call(this,require('_process'))
  720. },{"_process":1}]},{},[])("path")
  721. });