Edit File by line
/home/barbar84/public_h.../wp-inclu.../js/dist
File: url.js
this["wp"] = this["wp"] || {}; this["wp"]["url"] =
[0] Fix | Delete
/******/ (function(modules) { // webpackBootstrap
[1] Fix | Delete
/******/ // The module cache
[2] Fix | Delete
/******/ var installedModules = {};
[3] Fix | Delete
/******/
[4] Fix | Delete
/******/ // The require function
[5] Fix | Delete
/******/ function __webpack_require__(moduleId) {
[6] Fix | Delete
/******/
[7] Fix | Delete
/******/ // Check if module is in cache
[8] Fix | Delete
/******/ if(installedModules[moduleId]) {
[9] Fix | Delete
/******/ return installedModules[moduleId].exports;
[10] Fix | Delete
/******/ }
[11] Fix | Delete
/******/ // Create a new module (and put it into the cache)
[12] Fix | Delete
/******/ var module = installedModules[moduleId] = {
[13] Fix | Delete
/******/ i: moduleId,
[14] Fix | Delete
/******/ l: false,
[15] Fix | Delete
/******/ exports: {}
[16] Fix | Delete
/******/ };
[17] Fix | Delete
/******/
[18] Fix | Delete
/******/ // Execute the module function
[19] Fix | Delete
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
[20] Fix | Delete
/******/
[21] Fix | Delete
/******/ // Flag the module as loaded
[22] Fix | Delete
/******/ module.l = true;
[23] Fix | Delete
/******/
[24] Fix | Delete
/******/ // Return the exports of the module
[25] Fix | Delete
/******/ return module.exports;
[26] Fix | Delete
/******/ }
[27] Fix | Delete
/******/
[28] Fix | Delete
/******/
[29] Fix | Delete
/******/ // expose the modules object (__webpack_modules__)
[30] Fix | Delete
/******/ __webpack_require__.m = modules;
[31] Fix | Delete
/******/
[32] Fix | Delete
/******/ // expose the module cache
[33] Fix | Delete
/******/ __webpack_require__.c = installedModules;
[34] Fix | Delete
/******/
[35] Fix | Delete
/******/ // define getter function for harmony exports
[36] Fix | Delete
/******/ __webpack_require__.d = function(exports, name, getter) {
[37] Fix | Delete
/******/ if(!__webpack_require__.o(exports, name)) {
[38] Fix | Delete
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
[39] Fix | Delete
/******/ }
[40] Fix | Delete
/******/ };
[41] Fix | Delete
/******/
[42] Fix | Delete
/******/ // define __esModule on exports
[43] Fix | Delete
/******/ __webpack_require__.r = function(exports) {
[44] Fix | Delete
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
[45] Fix | Delete
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
[46] Fix | Delete
/******/ }
[47] Fix | Delete
/******/ Object.defineProperty(exports, '__esModule', { value: true });
[48] Fix | Delete
/******/ };
[49] Fix | Delete
/******/
[50] Fix | Delete
/******/ // create a fake namespace object
[51] Fix | Delete
/******/ // mode & 1: value is a module id, require it
[52] Fix | Delete
/******/ // mode & 2: merge all properties of value into the ns
[53] Fix | Delete
/******/ // mode & 4: return value when already ns object
[54] Fix | Delete
/******/ // mode & 8|1: behave like require
[55] Fix | Delete
/******/ __webpack_require__.t = function(value, mode) {
[56] Fix | Delete
/******/ if(mode & 1) value = __webpack_require__(value);
[57] Fix | Delete
/******/ if(mode & 8) return value;
[58] Fix | Delete
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
[59] Fix | Delete
/******/ var ns = Object.create(null);
[60] Fix | Delete
/******/ __webpack_require__.r(ns);
[61] Fix | Delete
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
[62] Fix | Delete
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
[63] Fix | Delete
/******/ return ns;
[64] Fix | Delete
/******/ };
[65] Fix | Delete
/******/
[66] Fix | Delete
/******/ // getDefaultExport function for compatibility with non-harmony modules
[67] Fix | Delete
/******/ __webpack_require__.n = function(module) {
[68] Fix | Delete
/******/ var getter = module && module.__esModule ?
[69] Fix | Delete
/******/ function getDefault() { return module['default']; } :
[70] Fix | Delete
/******/ function getModuleExports() { return module; };
[71] Fix | Delete
/******/ __webpack_require__.d(getter, 'a', getter);
[72] Fix | Delete
/******/ return getter;
[73] Fix | Delete
/******/ };
[74] Fix | Delete
/******/
[75] Fix | Delete
/******/ // Object.prototype.hasOwnProperty.call
[76] Fix | Delete
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
[77] Fix | Delete
/******/
[78] Fix | Delete
/******/ // __webpack_public_path__
[79] Fix | Delete
/******/ __webpack_require__.p = "";
[80] Fix | Delete
/******/
[81] Fix | Delete
/******/
[82] Fix | Delete
/******/ // Load entry module and return exports
[83] Fix | Delete
/******/ return __webpack_require__(__webpack_require__.s = "lbya");
[84] Fix | Delete
/******/ })
[85] Fix | Delete
/************************************************************************/
[86] Fix | Delete
/******/ ({
[87] Fix | Delete
[88] Fix | Delete
/***/ "BsWD":
[89] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[90] Fix | Delete
[91] Fix | Delete
"use strict";
[92] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
[93] Fix | Delete
/* harmony import */ var _babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a3WO");
[94] Fix | Delete
[95] Fix | Delete
function _unsupportedIterableToArray(o, minLen) {
[96] Fix | Delete
if (!o) return;
[97] Fix | Delete
if (typeof o === "string") return Object(_babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
[98] Fix | Delete
var n = Object.prototype.toString.call(o).slice(8, -1);
[99] Fix | Delete
if (n === "Object" && o.constructor) n = o.constructor.name;
[100] Fix | Delete
if (n === "Map" || n === "Set") return Array.from(o);
[101] Fix | Delete
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
[102] Fix | Delete
}
[103] Fix | Delete
[104] Fix | Delete
/***/ }),
[105] Fix | Delete
[106] Fix | Delete
/***/ "DSFK":
[107] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[108] Fix | Delete
[109] Fix | Delete
"use strict";
[110] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
[111] Fix | Delete
function _arrayWithHoles(arr) {
[112] Fix | Delete
if (Array.isArray(arr)) return arr;
[113] Fix | Delete
}
[114] Fix | Delete
[115] Fix | Delete
/***/ }),
[116] Fix | Delete
[117] Fix | Delete
/***/ "ODXe":
[118] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[119] Fix | Delete
[120] Fix | Delete
"use strict";
[121] Fix | Delete
[122] Fix | Delete
// EXPORTS
[123] Fix | Delete
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; });
[124] Fix | Delete
[125] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
[126] Fix | Delete
var arrayWithHoles = __webpack_require__("DSFK");
[127] Fix | Delete
[128] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
[129] Fix | Delete
function _iterableToArrayLimit(arr, i) {
[130] Fix | Delete
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
[131] Fix | Delete
var _arr = [];
[132] Fix | Delete
var _n = true;
[133] Fix | Delete
var _d = false;
[134] Fix | Delete
var _e = undefined;
[135] Fix | Delete
[136] Fix | Delete
try {
[137] Fix | Delete
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
[138] Fix | Delete
_arr.push(_s.value);
[139] Fix | Delete
[140] Fix | Delete
if (i && _arr.length === i) break;
[141] Fix | Delete
}
[142] Fix | Delete
} catch (err) {
[143] Fix | Delete
_d = true;
[144] Fix | Delete
_e = err;
[145] Fix | Delete
} finally {
[146] Fix | Delete
try {
[147] Fix | Delete
if (!_n && _i["return"] != null) _i["return"]();
[148] Fix | Delete
} finally {
[149] Fix | Delete
if (_d) throw _e;
[150] Fix | Delete
}
[151] Fix | Delete
}
[152] Fix | Delete
[153] Fix | Delete
return _arr;
[154] Fix | Delete
}
[155] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
[156] Fix | Delete
var unsupportedIterableToArray = __webpack_require__("BsWD");
[157] Fix | Delete
[158] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
[159] Fix | Delete
var nonIterableRest = __webpack_require__("PYwp");
[160] Fix | Delete
[161] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
[162] Fix | Delete
[163] Fix | Delete
[164] Fix | Delete
[165] Fix | Delete
[166] Fix | Delete
function _slicedToArray(arr, i) {
[167] Fix | Delete
return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])();
[168] Fix | Delete
}
[169] Fix | Delete
[170] Fix | Delete
/***/ }),
[171] Fix | Delete
[172] Fix | Delete
/***/ "PYwp":
[173] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[174] Fix | Delete
[175] Fix | Delete
"use strict";
[176] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
[177] Fix | Delete
function _nonIterableRest() {
[178] Fix | Delete
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
[179] Fix | Delete
}
[180] Fix | Delete
[181] Fix | Delete
/***/ }),
[182] Fix | Delete
[183] Fix | Delete
/***/ "YLtl":
[184] Fix | Delete
/***/ (function(module, exports) {
[185] Fix | Delete
[186] Fix | Delete
(function() { module.exports = window["lodash"]; }());
[187] Fix | Delete
[188] Fix | Delete
/***/ }),
[189] Fix | Delete
[190] Fix | Delete
/***/ "a3WO":
[191] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[192] Fix | Delete
[193] Fix | Delete
"use strict";
[194] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
[195] Fix | Delete
function _arrayLikeToArray(arr, len) {
[196] Fix | Delete
if (len == null || len > arr.length) len = arr.length;
[197] Fix | Delete
[198] Fix | Delete
for (var i = 0, arr2 = new Array(len); i < len; i++) {
[199] Fix | Delete
arr2[i] = arr[i];
[200] Fix | Delete
}
[201] Fix | Delete
[202] Fix | Delete
return arr2;
[203] Fix | Delete
}
[204] Fix | Delete
[205] Fix | Delete
/***/ }),
[206] Fix | Delete
[207] Fix | Delete
/***/ "lbya":
[208] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[209] Fix | Delete
[210] Fix | Delete
"use strict";
[211] Fix | Delete
// ESM COMPAT FLAG
[212] Fix | Delete
__webpack_require__.r(__webpack_exports__);
[213] Fix | Delete
[214] Fix | Delete
// EXPORTS
[215] Fix | Delete
__webpack_require__.d(__webpack_exports__, "isURL", function() { return /* reexport */ isURL; });
[216] Fix | Delete
__webpack_require__.d(__webpack_exports__, "isEmail", function() { return /* reexport */ isEmail; });
[217] Fix | Delete
__webpack_require__.d(__webpack_exports__, "getProtocol", function() { return /* reexport */ getProtocol; });
[218] Fix | Delete
__webpack_require__.d(__webpack_exports__, "isValidProtocol", function() { return /* reexport */ isValidProtocol; });
[219] Fix | Delete
__webpack_require__.d(__webpack_exports__, "getAuthority", function() { return /* reexport */ getAuthority; });
[220] Fix | Delete
__webpack_require__.d(__webpack_exports__, "isValidAuthority", function() { return /* reexport */ isValidAuthority; });
[221] Fix | Delete
__webpack_require__.d(__webpack_exports__, "getPath", function() { return /* reexport */ getPath; });
[222] Fix | Delete
__webpack_require__.d(__webpack_exports__, "isValidPath", function() { return /* reexport */ isValidPath; });
[223] Fix | Delete
__webpack_require__.d(__webpack_exports__, "getQueryString", function() { return /* reexport */ getQueryString; });
[224] Fix | Delete
__webpack_require__.d(__webpack_exports__, "buildQueryString", function() { return /* reexport */ buildQueryString; });
[225] Fix | Delete
__webpack_require__.d(__webpack_exports__, "isValidQueryString", function() { return /* reexport */ isValidQueryString; });
[226] Fix | Delete
__webpack_require__.d(__webpack_exports__, "getPathAndQueryString", function() { return /* reexport */ getPathAndQueryString; });
[227] Fix | Delete
__webpack_require__.d(__webpack_exports__, "getFragment", function() { return /* reexport */ getFragment; });
[228] Fix | Delete
__webpack_require__.d(__webpack_exports__, "isValidFragment", function() { return /* reexport */ isValidFragment; });
[229] Fix | Delete
__webpack_require__.d(__webpack_exports__, "addQueryArgs", function() { return /* reexport */ addQueryArgs; });
[230] Fix | Delete
__webpack_require__.d(__webpack_exports__, "getQueryArg", function() { return /* reexport */ getQueryArg; });
[231] Fix | Delete
__webpack_require__.d(__webpack_exports__, "getQueryArgs", function() { return /* reexport */ getQueryArgs; });
[232] Fix | Delete
__webpack_require__.d(__webpack_exports__, "hasQueryArg", function() { return /* reexport */ hasQueryArg; });
[233] Fix | Delete
__webpack_require__.d(__webpack_exports__, "removeQueryArgs", function() { return /* reexport */ removeQueryArgs; });
[234] Fix | Delete
__webpack_require__.d(__webpack_exports__, "prependHTTP", function() { return /* reexport */ prependHTTP; });
[235] Fix | Delete
__webpack_require__.d(__webpack_exports__, "safeDecodeURI", function() { return /* reexport */ safeDecodeURI; });
[236] Fix | Delete
__webpack_require__.d(__webpack_exports__, "safeDecodeURIComponent", function() { return /* reexport */ safeDecodeURIComponent; });
[237] Fix | Delete
__webpack_require__.d(__webpack_exports__, "filterURLForDisplay", function() { return /* reexport */ filterURLForDisplay; });
[238] Fix | Delete
__webpack_require__.d(__webpack_exports__, "cleanForSlug", function() { return /* reexport */ cleanForSlug; });
[239] Fix | Delete
[240] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-url.js
[241] Fix | Delete
/**
[242] Fix | Delete
* Determines whether the given string looks like a URL.
[243] Fix | Delete
*
[244] Fix | Delete
* @param {string} url The string to scrutinise.
[245] Fix | Delete
*
[246] Fix | Delete
* @example
[247] Fix | Delete
* ```js
[248] Fix | Delete
* const isURL = isURL( 'https://wordpress.org' ); // true
[249] Fix | Delete
* ```
[250] Fix | Delete
*
[251] Fix | Delete
* @see https://url.spec.whatwg.org/
[252] Fix | Delete
* @see https://url.spec.whatwg.org/#valid-url-string
[253] Fix | Delete
*
[254] Fix | Delete
* @return {boolean} Whether or not it looks like a URL.
[255] Fix | Delete
*/
[256] Fix | Delete
function isURL(url) {
[257] Fix | Delete
// A URL can be considered value if the `URL` constructor is able to parse
[258] Fix | Delete
// it. The constructor throws an error for an invalid URL.
[259] Fix | Delete
try {
[260] Fix | Delete
new URL(url);
[261] Fix | Delete
return true;
[262] Fix | Delete
} catch (_unused) {
[263] Fix | Delete
return false;
[264] Fix | Delete
}
[265] Fix | Delete
}
[266] Fix | Delete
[267] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-email.js
[268] Fix | Delete
var EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;
[269] Fix | Delete
/**
[270] Fix | Delete
* Determines whether the given string looks like an email.
[271] Fix | Delete
*
[272] Fix | Delete
* @param {string} email The string to scrutinise.
[273] Fix | Delete
*
[274] Fix | Delete
* @example
[275] Fix | Delete
* ```js
[276] Fix | Delete
* const isEmail = isEmail( 'hello@wordpress.org' ); // true
[277] Fix | Delete
* ```
[278] Fix | Delete
*
[279] Fix | Delete
* @return {boolean} Whether or not it looks like an email.
[280] Fix | Delete
*/
[281] Fix | Delete
[282] Fix | Delete
function isEmail(email) {
[283] Fix | Delete
return EMAIL_REGEXP.test(email);
[284] Fix | Delete
}
[285] Fix | Delete
[286] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-protocol.js
[287] Fix | Delete
/**
[288] Fix | Delete
* Returns the protocol part of the URL.
[289] Fix | Delete
*
[290] Fix | Delete
* @param {string} url The full URL.
[291] Fix | Delete
*
[292] Fix | Delete
* @example
[293] Fix | Delete
* ```js
[294] Fix | Delete
* const protocol1 = getProtocol( 'tel:012345678' ); // 'tel:'
[295] Fix | Delete
* const protocol2 = getProtocol( 'https://wordpress.org' ); // 'https:'
[296] Fix | Delete
* ```
[297] Fix | Delete
*
[298] Fix | Delete
* @return {string|void} The protocol part of the URL.
[299] Fix | Delete
*/
[300] Fix | Delete
function getProtocol(url) {
[301] Fix | Delete
var matches = /^([^\s:]+:)/.exec(url);
[302] Fix | Delete
[303] Fix | Delete
if (matches) {
[304] Fix | Delete
return matches[1];
[305] Fix | Delete
}
[306] Fix | Delete
}
[307] Fix | Delete
[308] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-protocol.js
[309] Fix | Delete
/**
[310] Fix | Delete
* Tests if a url protocol is valid.
[311] Fix | Delete
*
[312] Fix | Delete
* @param {string} protocol The url protocol.
[313] Fix | Delete
*
[314] Fix | Delete
* @example
[315] Fix | Delete
* ```js
[316] Fix | Delete
* const isValid = isValidProtocol( 'https:' ); // true
[317] Fix | Delete
* const isNotValid = isValidProtocol( 'https :' ); // false
[318] Fix | Delete
* ```
[319] Fix | Delete
*
[320] Fix | Delete
* @return {boolean} True if the argument is a valid protocol (e.g. http:, tel:).
[321] Fix | Delete
*/
[322] Fix | Delete
function isValidProtocol(protocol) {
[323] Fix | Delete
if (!protocol) {
[324] Fix | Delete
return false;
[325] Fix | Delete
}
[326] Fix | Delete
[327] Fix | Delete
return /^[a-z\-.\+]+[0-9]*:$/i.test(protocol);
[328] Fix | Delete
}
[329] Fix | Delete
[330] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-authority.js
[331] Fix | Delete
/**
[332] Fix | Delete
* Returns the authority part of the URL.
[333] Fix | Delete
*
[334] Fix | Delete
* @param {string} url The full URL.
[335] Fix | Delete
*
[336] Fix | Delete
* @example
[337] Fix | Delete
* ```js
[338] Fix | Delete
* const authority1 = getAuthority( 'https://wordpress.org/help/' ); // 'wordpress.org'
[339] Fix | Delete
* const authority2 = getAuthority( 'https://localhost:8080/test/' ); // 'localhost:8080'
[340] Fix | Delete
* ```
[341] Fix | Delete
*
[342] Fix | Delete
* @return {string|void} The authority part of the URL.
[343] Fix | Delete
*/
[344] Fix | Delete
function getAuthority(url) {
[345] Fix | Delete
var matches = /^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(url);
[346] Fix | Delete
[347] Fix | Delete
if (matches) {
[348] Fix | Delete
return matches[1];
[349] Fix | Delete
}
[350] Fix | Delete
}
[351] Fix | Delete
[352] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-authority.js
[353] Fix | Delete
/**
[354] Fix | Delete
* Checks for invalid characters within the provided authority.
[355] Fix | Delete
*
[356] Fix | Delete
* @param {string} authority A string containing the URL authority.
[357] Fix | Delete
*
[358] Fix | Delete
* @example
[359] Fix | Delete
* ```js
[360] Fix | Delete
* const isValid = isValidAuthority( 'wordpress.org' ); // true
[361] Fix | Delete
* const isNotValid = isValidAuthority( 'wordpress#org' ); // false
[362] Fix | Delete
* ```
[363] Fix | Delete
*
[364] Fix | Delete
* @return {boolean} True if the argument contains a valid authority.
[365] Fix | Delete
*/
[366] Fix | Delete
function isValidAuthority(authority) {
[367] Fix | Delete
if (!authority) {
[368] Fix | Delete
return false;
[369] Fix | Delete
}
[370] Fix | Delete
[371] Fix | Delete
return /^[^\s#?]+$/.test(authority);
[372] Fix | Delete
}
[373] Fix | Delete
[374] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-path.js
[375] Fix | Delete
/**
[376] Fix | Delete
* Returns the path part of the URL.
[377] Fix | Delete
*
[378] Fix | Delete
* @param {string} url The full URL.
[379] Fix | Delete
*
[380] Fix | Delete
* @example
[381] Fix | Delete
* ```js
[382] Fix | Delete
* const path1 = getPath( 'http://localhost:8080/this/is/a/test?query=true' ); // 'this/is/a/test'
[383] Fix | Delete
* const path2 = getPath( 'https://wordpress.org/help/faq/' ); // 'help/faq'
[384] Fix | Delete
* ```
[385] Fix | Delete
*
[386] Fix | Delete
* @return {string|void} The path part of the URL.
[387] Fix | Delete
*/
[388] Fix | Delete
function getPath(url) {
[389] Fix | Delete
var matches = /^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(url);
[390] Fix | Delete
[391] Fix | Delete
if (matches) {
[392] Fix | Delete
return matches[1];
[393] Fix | Delete
}
[394] Fix | Delete
}
[395] Fix | Delete
[396] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-path.js
[397] Fix | Delete
/**
[398] Fix | Delete
* Checks for invalid characters within the provided path.
[399] Fix | Delete
*
[400] Fix | Delete
* @param {string} path The URL path.
[401] Fix | Delete
*
[402] Fix | Delete
* @example
[403] Fix | Delete
* ```js
[404] Fix | Delete
* const isValid = isValidPath( 'test/path/' ); // true
[405] Fix | Delete
* const isNotValid = isValidPath( '/invalid?test/path/' ); // false
[406] Fix | Delete
* ```
[407] Fix | Delete
*
[408] Fix | Delete
* @return {boolean} True if the argument contains a valid path
[409] Fix | Delete
*/
[410] Fix | Delete
function isValidPath(path) {
[411] Fix | Delete
if (!path) {
[412] Fix | Delete
return false;
[413] Fix | Delete
}
[414] Fix | Delete
[415] Fix | Delete
return /^[^\s#?]+$/.test(path);
[416] Fix | Delete
}
[417] Fix | Delete
[418] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-query-string.js
[419] Fix | Delete
/**
[420] Fix | Delete
* Returns the query string part of the URL.
[421] Fix | Delete
*
[422] Fix | Delete
* @param {string} url The full URL.
[423] Fix | Delete
*
[424] Fix | Delete
* @example
[425] Fix | Delete
* ```js
[426] Fix | Delete
* const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true'
[427] Fix | Delete
* ```
[428] Fix | Delete
*
[429] Fix | Delete
* @return {string|void} The query string part of the URL.
[430] Fix | Delete
*/
[431] Fix | Delete
function getQueryString(url) {
[432] Fix | Delete
var query;
[433] Fix | Delete
[434] Fix | Delete
try {
[435] Fix | Delete
query = new URL(url, 'http://example.com').search.substring(1);
[436] Fix | Delete
} catch (error) {}
[437] Fix | Delete
[438] Fix | Delete
if (query) {
[439] Fix | Delete
return query;
[440] Fix | Delete
}
[441] Fix | Delete
}
[442] Fix | Delete
[443] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
[444] Fix | Delete
var slicedToArray = __webpack_require__("ODXe");
[445] Fix | Delete
[446] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/build-query-string.js
[447] Fix | Delete
[448] Fix | Delete
[449] Fix | Delete
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
[450] Fix | Delete
[451] Fix | Delete
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
[452] Fix | Delete
[453] Fix | Delete
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
[454] Fix | Delete
[455] Fix | Delete
/**
[456] Fix | Delete
* Generates URL-encoded query string using input query data.
[457] Fix | Delete
*
[458] Fix | Delete
* It is intended to behave equivalent as PHP's `http_build_query`, configured
[459] Fix | Delete
* with encoding type PHP_QUERY_RFC3986 (spaces as `%20`).
[460] Fix | Delete
*
[461] Fix | Delete
* @example
[462] Fix | Delete
* ```js
[463] Fix | Delete
* const queryString = buildQueryString( {
[464] Fix | Delete
* simple: 'is ok',
[465] Fix | Delete
* arrays: [ 'are', 'fine', 'too' ],
[466] Fix | Delete
* objects: {
[467] Fix | Delete
* evenNested: {
[468] Fix | Delete
* ok: 'yes',
[469] Fix | Delete
* },
[470] Fix | Delete
* },
[471] Fix | Delete
* } );
[472] Fix | Delete
* // "simple=is%20ok&arrays%5B0%5D=are&arrays%5B1%5D=fine&arrays%5B2%5D=too&objects%5BevenNested%5D%5Bok%5D=yes"
[473] Fix | Delete
* ```
[474] Fix | Delete
*
[475] Fix | Delete
* @param {Record<string,*>} data Data to encode.
[476] Fix | Delete
*
[477] Fix | Delete
* @return {string} Query string.
[478] Fix | Delete
*/
[479] Fix | Delete
function buildQueryString(data) {
[480] Fix | Delete
var string = '';
[481] Fix | Delete
var stack = Object.entries(data);
[482] Fix | Delete
var pair;
[483] Fix | Delete
[484] Fix | Delete
while (pair = stack.shift()) {
[485] Fix | Delete
var _pair = pair,
[486] Fix | Delete
_pair2 = Object(slicedToArray["a" /* default */])(_pair, 2),
[487] Fix | Delete
key = _pair2[0],
[488] Fix | Delete
value = _pair2[1]; // Support building deeply nested data, from array or object values.
[489] Fix | Delete
[490] Fix | Delete
[491] Fix | Delete
var hasNestedData = Array.isArray(value) || value && value.constructor === Object;
[492] Fix | Delete
[493] Fix | Delete
if (hasNestedData) {
[494] Fix | Delete
// Push array or object values onto the stack as composed of their
[495] Fix | Delete
// original key and nested index or key, retaining order by a
[496] Fix | Delete
// combination of Array#reverse and Array#unshift onto the stack.
[497] Fix | Delete
var valuePairs = Object.entries(value).reverse();
[498] Fix | Delete
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function