mirror of
https://kevinblog.sytes.net/Code/Jibo-Revival-Group/RoboCommander.git
synced 2026-06-15 17:56:02 +00:00
Initial commit
This commit is contained in:
134
node_modules/resolve-pathname/umd/resolve-pathname.js
generated
vendored
Normal file
134
node_modules/resolve-pathname/umd/resolve-pathname.js
generated
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory();
|
||||
else if(typeof define === 'function' && define.amd)
|
||||
define([], factory);
|
||||
else if(typeof exports === 'object')
|
||||
exports["resolvePathname"] = factory();
|
||||
else
|
||||
root["resolvePathname"] = factory();
|
||||
})(this, function() {
|
||||
return /******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId])
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ exports: {},
|
||||
/******/ id: moduleId,
|
||||
/******/ loaded: false
|
||||
/******/ };
|
||||
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.loaded = true;
|
||||
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
|
||||
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
function isAbsolute(pathname) {
|
||||
return pathname.charAt(0) === '/';
|
||||
}
|
||||
|
||||
// About 1.5x faster than the two-arg version of Array#splice()
|
||||
function spliceOne(list, index) {
|
||||
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
|
||||
list[i] = list[k];
|
||||
}
|
||||
|
||||
list.pop();
|
||||
}
|
||||
|
||||
// This implementation is based heavily on node's url.parse
|
||||
function resolvePathname(to) {
|
||||
var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
||||
|
||||
var toParts = to && to.split('/') || [];
|
||||
var fromParts = from && from.split('/') || [];
|
||||
|
||||
var isToAbs = to && isAbsolute(to);
|
||||
var isFromAbs = from && isAbsolute(from);
|
||||
var mustEndAbs = isToAbs || isFromAbs;
|
||||
|
||||
if (to && isAbsolute(to)) {
|
||||
// to is absolute
|
||||
fromParts = toParts;
|
||||
} else if (toParts.length) {
|
||||
// to is relative, drop the filename
|
||||
fromParts.pop();
|
||||
fromParts = fromParts.concat(toParts);
|
||||
}
|
||||
|
||||
if (!fromParts.length) return '/';
|
||||
|
||||
var hasTrailingSlash = void 0;
|
||||
if (fromParts.length) {
|
||||
var last = fromParts[fromParts.length - 1];
|
||||
hasTrailingSlash = last === '.' || last === '..' || last === '';
|
||||
} else {
|
||||
hasTrailingSlash = false;
|
||||
}
|
||||
|
||||
var up = 0;
|
||||
for (var i = fromParts.length; i >= 0; i--) {
|
||||
var part = fromParts[i];
|
||||
|
||||
if (part === '.') {
|
||||
spliceOne(fromParts, i);
|
||||
} else if (part === '..') {
|
||||
spliceOne(fromParts, i);
|
||||
up++;
|
||||
} else if (up) {
|
||||
spliceOne(fromParts, i);
|
||||
up--;
|
||||
}
|
||||
}
|
||||
|
||||
if (!mustEndAbs) for (; up--; up) {
|
||||
fromParts.unshift('..');
|
||||
}if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');
|
||||
|
||||
var result = fromParts.join('/');
|
||||
|
||||
if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
exports.default = resolvePathname;
|
||||
|
||||
/***/ })
|
||||
/******/ ])
|
||||
});
|
||||
;
|
||||
1
node_modules/resolve-pathname/umd/resolve-pathname.min.js
generated
vendored
Normal file
1
node_modules/resolve-pathname/umd/resolve-pathname.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.resolvePathname=t():e.resolvePathname=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t){"use strict";function n(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,o=n+1,r=e.length;o<r;n+=1,o+=1)e[n]=e[o];e.pop()}function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e&&e.split("/")||[],f=t&&t.split("/")||[],i=e&&n(e),u=t&&n(t),s=i||u;if(e&&n(e)?f=r:r.length&&(f.pop(),f=f.concat(r)),!f.length)return"/";var a=void 0;if(f.length){var l=f[f.length-1];a="."===l||".."===l||""===l}else a=!1;for(var p=0,c=f.length;c>=0;c--){var d=f[c];"."===d?o(f,c):".."===d?(o(f,c),p++):p&&(o(f,c),p--)}if(!s)for(;p--;p)f.unshift("..");!s||""===f[0]||f[0]&&n(f[0])||f.unshift("");var h=f.join("/");return a&&"/"!==h.substr(-1)&&(h+="/"),h}t.__esModule=!0,t.default=r}])});
|
||||
Reference in New Issue
Block a user