mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-20 19:56:49 +01:00
This updates the 4.0 branch to support the latest LTS version of NodeJS (currently 14.x), allowing the same version to be used across all WordPress branches that receive security updates as a courtesy. Because older branches use (really) old versions of NodeJS, the local Docker environment cannot be backported since the needed dependencies will not run on these older versions (see #48301). This also blocks the ability to move automated testing over to GitHub Actions (see #50401). This change also introduces a `packager-lock.json` file to the branch. In addition to backporting the package updates that happened after branching 4.0, dependencies that were removed in future releases have also been updated to their latest versions. Props desrosj, dd32, netweb, jorbin. Merges [30059-30063,30066-30067,31425,31504,31557,31648,31649-31650,32356-32357,32988,33726,35363,35513,35521,35538-35541,35859,36861-36865,37017,37019-37020,37212,37612,38111,39110,39113,39115-39117,39478,41835,42460-42461,42463,42887,43320,43323,43977,44219,44233,45321,45765,46404,46408-46409,47404,47867,47872-47873,48705,49636,49933,49937,49939,50126,50176,50185,50192] to the 4.0 branch. See #52341. Built from https://develop.svn.wordpress.org/branches/4.0@50218 git-svn-id: http://core.svn.wordpress.org/branches/4.0@49885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
(function(){var n=this,t=n._,o={},u=Array.prototype,r=Object.prototype,e=Function.prototype,i=u.push,c=u.slice,a=u.concat,s=r.toString,l=r.hasOwnProperty,f=u.forEach,p=u.map,h=u.reduce,v=u.reduceRight,y=u.filter,d=u.every,g=u.some,m=u.indexOf,b=u.lastIndexOf,r=Array.isArray,x=Object.keys,w=e.bind,_=function(n){return n instanceof _?n:this instanceof _?void(this._wrapped=n):new _(n)};"undefined"!=typeof exports?(exports="undefined"!=typeof module&&module.exports?module.exports=_:exports)._=_:n._=_,_.VERSION="1.6.0";var j=_.each=_.forEach=function(n,t,r){if(null==n)return n;if(f&&n.forEach===f)n.forEach(t,r);else if(n.length===+n.length){for(var e=0,u=n.length;e<u;e++)if(t.call(r,n[e],e,n)===o)return}else for(var i=_.keys(n),e=0,u=i.length;e<u;e++)if(t.call(r,n[i[e]],i[e],n)===o)return;return n};_.map=_.collect=function(n,e,u){var i=[];return null==n?i:p&&n.map===p?n.map(e,u):(j(n,function(n,t,r){i.push(e.call(u,n,t,r))}),i)};var A="Reduce of empty array with no initial value";_.reduce=_.foldl=_.inject=function(n,e,u,i){var o=2<arguments.length;if(null==n&&(n=[]),h&&n.reduce===h)return i&&(e=_.bind(e,i)),o?n.reduce(e,u):n.reduce(e);if(j(n,function(n,t,r){o?u=e.call(i,u,n,t,r):(u=n,o=!0)}),!o)throw new TypeError(A);return u},_.reduceRight=_.foldr=function(e,u,i,o){var c=2<arguments.length;if(null==e&&(e=[]),v&&e.reduceRight===v)return o&&(u=_.bind(u,o)),c?e.reduceRight(u,i):e.reduceRight(u);var a,l=e.length;if(l!==+l&&(a=_.keys(e),l=a.length),j(e,function(n,t,r){t=a?a[--l]:--l,c?i=u.call(o,i,e[t],t,r):(i=e[t],c=!0)}),!c)throw new TypeError(A);return i},_.find=_.detect=function(n,e,u){var i;return O(n,function(n,t,r){if(e.call(u,n,t,r))return i=n,!0}),i},_.filter=_.select=function(n,e,u){var i=[];return null==n?i:y&&n.filter===y?n.filter(e,u):(j(n,function(n,t,r){e.call(u,n,t,r)&&i.push(n)}),i)},_.reject=function(n,e,u){return _.filter(n,function(n,t,r){return!e.call(u,n,t,r)},u)},_.every=_.all=function(n,e,u){e=e||_.identity;var i=!0;return null==n?i:d&&n.every===d?n.every(e,u):(j(n,function(n,t,r){if(!(i=i&&e.call(u,n,t,r)))return o}),!!i)};var O=_.some=_.any=function(n,e,u){e=e||_.identity;var i=!1;return null==n?i:g&&n.some===g?n.some(e,u):(j(n,function(n,t,r){if(i=i||e.call(u,n,t,r))return o}),!!i)};_.contains=_.include=function(n,t){return null!=n&&(m&&n.indexOf===m?-1!=n.indexOf(t):O(n,function(n){return n===t}))},_.invoke=function(n,t){var r=c.call(arguments,2),e=_.isFunction(t);return _.map(n,function(n){return(e?t:n[t]).apply(n,r)})},_.pluck=function(n,t){return _.map(n,_.property(t))},_.where=function(n,t){return _.filter(n,_.matches(t))},_.findWhere=function(n,t){return _.find(n,_.matches(t))},_.max=function(n,e,u){if(!e&&_.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);var i=-1/0,o=-1/0;return j(n,function(n,t,r){r=e?e.call(u,n,t,r):n;o<r&&(i=n,o=r)}),i},_.min=function(n,e,u){if(!e&&_.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);var i=1/0,o=1/0;return j(n,function(n,t,r){r=e?e.call(u,n,t,r):n;r<o&&(i=n,o=r)}),i},_.shuffle=function(n){var t,r=0,e=[];return j(n,function(n){t=_.random(r++),e[r-1]=e[t],e[t]=n}),e},_.sample=function(n,t,r){return null==t||r?(n=n.length!==+n.length?_.values(n):n)[_.random(n.length-1)]:_.shuffle(n).slice(0,Math.max(0,t))};function k(n){return null==n?_.identity:_.isFunction(n)?n:_.property(n)}_.sortBy=function(n,e,u){return e=k(e),_.pluck(_.map(n,function(n,t,r){return{value:n,index:t,criteria:e.call(u,n,t,r)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(e<r||void 0===r)return 1;if(r<e||void 0===e)return-1}return n.index-t.index}),"value")};e=function(o){return function(r,e,u){var i={};return e=k(e),j(r,function(n,t){t=e.call(u,n,t,r);o(i,t,n)}),i}};_.groupBy=e(function(n,t,r){_.has(n,t)?n[t].push(r):n[t]=[r]}),_.indexBy=e(function(n,t,r){n[t]=r}),_.countBy=e(function(n,t){_.has(n,t)?n[t]++:n[t]=1}),_.sortedIndex=function(n,t,r,e){for(var u=(r=k(r)).call(e,t),i=0,o=n.length;i<o;){var c=i+o>>>1;r.call(e,n[c])<u?i=1+c:o=c}return i},_.toArray=function(n){return n?_.isArray(n)?c.call(n):n.length===+n.length?_.map(n,_.identity):_.values(n):[]},_.size=function(n){return null==n?0:(n.length===+n.length?n:_.keys(n)).length},_.first=_.head=_.take=function(n,t,r){if(null!=n)return null==t||r?n[0]:t<0?[]:c.call(n,0,t)},_.initial=function(n,t,r){return c.call(n,0,n.length-(null==t||r?1:t))},_.last=function(n,t,r){if(null!=n)return null==t||r?n[n.length-1]:c.call(n,Math.max(n.length-t,0))},_.rest=_.tail=_.drop=function(n,t,r){return c.call(n,null==t||r?1:t)},_.compact=function(n){return _.filter(n,_.identity)};var E=function(n,t,r){return t&&_.every(n,_.isArray)?a.apply(r,n):(j(n,function(n){_.isArray(n)||_.isArguments(n)?t?i.apply(r,n):E(n,t,r):r.push(n)}),r)};_.flatten=function(n,t){return E(n,t,[])},_.without=function(n){return _.difference(n,c.call(arguments,1))},_.partition=function(n,t){var r=[],e=[];return j(n,function(n){(t(n)?r:e).push(n)}),[r,e]},_.uniq=_.unique=function(r,e,n,t){_.isFunction(e)&&(t=n,n=e,e=!1);var t=n?_.map(r,n,t):r,u=[],i=[];return j(t,function(n,t){(e?t&&i[i.length-1]===n:_.contains(i,n))||(i.push(n),u.push(r[t]))}),u},_.union=function(){return _.uniq(_.flatten(arguments,!0))},_.intersection=function(n){var r=c.call(arguments,1);return _.filter(_.uniq(n),function(t){return _.every(r,function(n){return _.contains(n,t)})})},_.difference=function(n){var t=a.apply(u,c.call(arguments,1));return _.filter(n,function(n){return!_.contains(t,n)})},_.zip=function(){for(var n=_.max(_.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;r<n;r++)t[r]=_.pluck(arguments,""+r);return t},_.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;e<u;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},_.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return n[e=_.sortedIndex(n,t)]===t?e:-1;e=r<0?Math.max(0,u+r):r}if(m&&n.indexOf===m)return n.indexOf(t,r);for(;e<u;e++)if(n[e]===t)return e;return-1},_.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},_.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);u<e;)i[u++]=n,n+=r;return i};function F(){}_.bind=function(r,e){var u,i;if(w&&r.bind===w)return w.apply(r,c.call(arguments,1));if(!_.isFunction(r))throw new TypeError;return u=c.call(arguments,2),i=function(){if(!(this instanceof i))return r.apply(e,u.concat(c.call(arguments)));F.prototype=r.prototype;var n=new F;F.prototype=null;var t=r.apply(n,u.concat(c.call(arguments)));return Object(t)===t?t:n}},_.partial=function(u){var i=c.call(arguments,1);return function(){for(var n=0,t=i.slice(),r=0,e=t.length;r<e;r++)t[r]===_&&(t[r]=arguments[n++]);for(;n<arguments.length;)t.push(arguments[n++]);return u.apply(this,t)}},_.bindAll=function(t){var n=c.call(arguments,1);if(0===n.length)throw new Error("bindAll must be passed function names");return j(n,function(n){t[n]=_.bind(t[n],t)}),t},_.memoize=function(t,r){var e={};return r=r||_.identity,function(){var n=r.apply(this,arguments);return _.has(e,n)?e[n]:e[n]=t.apply(this,arguments)}},_.delay=function(n,t){var r=c.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},_.defer=function(n){return _.delay.apply(_,[n,1].concat(c.call(arguments,1)))},_.throttle=function(r,e,u){var i,o,c,a=null,l=0;u=u||{};function f(){l=!1===u.leading?0:_.now(),a=null,c=r.apply(i,o),i=o=null}return function(){var n=_.now();l||!1!==u.leading||(l=n);var t=e-(n-l);return i=this,o=arguments,t<=0?(clearTimeout(a),a=null,l=n,c=r.apply(i,o),i=o=null):a||!1===u.trailing||(a=setTimeout(f,t)),c}},_.debounce=function(t,r,e){var u,i,o,c,a,l=function(){var n=_.now()-c;n<r?u=setTimeout(l,r-n):(u=null,e||(a=t.apply(o,i),o=i=null))};return function(){o=this,i=arguments,c=_.now();var n=e&&!u;return u=u||setTimeout(l,r),n&&(a=t.apply(o,i),o=i=null),a}},_.once=function(n){var t,r=!1;return function(){return r||(r=!0,t=n.apply(this,arguments),n=null),t}},_.wrap=function(n,t){return _.partial(t,n)},_.compose=function(){var r=arguments;return function(){for(var n=arguments,t=r.length-1;0<=t;t--)n=[r[t].apply(this,n)];return n[0]}},_.after=function(n,t){return function(){if(--n<1)return t.apply(this,arguments)}},_.keys=function(n){if(!_.isObject(n))return[];if(x)return x(n);var t,r=[];for(t in n)_.has(n,t)&&r.push(t);return r},_.values=function(n){for(var t=_.keys(n),r=t.length,e=new Array(r),u=0;u<r;u++)e[u]=n[t[u]];return e},_.pairs=function(n){for(var t=_.keys(n),r=t.length,e=new Array(r),u=0;u<r;u++)e[u]=[t[u],n[t[u]]];return e},_.invert=function(n){for(var t={},r=_.keys(n),e=0,u=r.length;e<u;e++)t[n[r[e]]]=r[e];return t},_.functions=_.methods=function(n){var t,r=[];for(t in n)_.isFunction(n[t])&&r.push(t);return r.sort()},_.extend=function(r){return j(c.call(arguments,1),function(n){if(n)for(var t in n)r[t]=n[t]}),r},_.pick=function(t){var r={},n=a.apply(u,c.call(arguments,1));return j(n,function(n){n in t&&(r[n]=t[n])}),r},_.omit=function(n){var t,r={},e=a.apply(u,c.call(arguments,1));for(t in n)_.contains(e,t)||(r[t]=n[t]);return r},_.defaults=function(r){return j(c.call(arguments,1),function(n){if(n)for(var t in n)void 0===r[t]&&(r[t]=n[t])}),r},_.clone=function(n){return _.isObject(n)?_.isArray(n)?n.slice():_.extend({},n):n},_.tap=function(n,t){return t(n),n};var M=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof _&&(n=n._wrapped),t instanceof _&&(t=t._wrapped);var u=s.call(n);if(u!=s.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var o=n.constructor,c=t.constructor;if(o!==c&&!(_.isFunction(o)&&o instanceof o&&_.isFunction(c)&&c instanceof c)&&"constructor"in n&&"constructor"in t)return!1;r.push(n),e.push(t);var a=0,l=!0;if("[object Array]"==u){if(l=(a=n.length)==t.length)for(;a--&&(l=M(n[a],t[a],r,e)););}else{for(var f in n)if(_.has(n,f)&&(a++,!(l=_.has(t,f)&&M(n[f],t[f],r,e))))break;if(l){for(f in t)if(_.has(t,f)&&!a--)break;l=!a}}return r.pop(),e.pop(),l};_.isEqual=function(n,t){return M(n,t,[],[])},_.isEmpty=function(n){if(null==n)return!0;if(_.isArray(n)||_.isString(n))return 0===n.length;for(var t in n)if(_.has(n,t))return!1;return!0},_.isElement=function(n){return!(!n||1!==n.nodeType)},_.isArray=r||function(n){return"[object Array]"==s.call(n)},_.isObject=function(n){return n===Object(n)},j(["Arguments","Function","String","Number","Date","RegExp"],function(t){_["is"+t]=function(n){return s.call(n)=="[object "+t+"]"}}),_.isArguments(arguments)||(_.isArguments=function(n){return!(!n||!_.has(n,"callee"))}),"function"!=typeof/./&&(_.isFunction=function(n){return"function"==typeof n}),_.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},_.isNaN=function(n){return _.isNumber(n)&&n!=+n},_.isBoolean=function(n){return!0===n||!1===n||"[object Boolean]"==s.call(n)},_.isNull=function(n){return null===n},_.isUndefined=function(n){return void 0===n},_.has=function(n,t){return l.call(n,t)},_.noConflict=function(){return n._=t,this},_.identity=function(n){return n},_.constant=function(n){return function(){return n}},_.property=function(t){return function(n){return n[t]}},_.matches=function(r){return function(n){if(n===r)return!0;for(var t in r)if(r[t]!==n[t])return!1;return!0}},_.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;u<n;u++)e[u]=t.call(r,u);return e},_.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},_.now=Date.now||function(){return(new Date).getTime()};var R={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};R.unescape=_.invert(R.escape);var S={escape:new RegExp("["+_.keys(R.escape).join("")+"]","g"),unescape:new RegExp("("+_.keys(R.unescape).join("|")+")","g")};_.each(["escape","unescape"],function(t){_[t]=function(n){return null==n?"":(""+n).replace(S[t],function(n){return R[t][n]})}}),_.result=function(n,t){if(null!=n){t=n[t];return _.isFunction(t)?t.call(n):t}},_.mixin=function(r){j(_.functions(r),function(n){var t=_[n]=r[n];_.prototype[n]=function(){var n=[this._wrapped];return i.apply(n,arguments),B.call(this,t.apply(_,n))}})};var T=0;_.uniqueId=function(n){var t=++T+"";return n?n+t:t},_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var I=/(.)^/,N={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},q=/\\|'|\r|\n|\t|\u2028|\u2029/g;_.template=function(i,n,t){var r;t=_.defaults({},t,_.templateSettings);var e=new RegExp([(t.escape||I).source,(t.interpolate||I).source,(t.evaluate||I).source].join("|")+"|$","g"),o=0,c="__p+='";i.replace(e,function(n,t,r,e,u){return c+=i.slice(o,u).replace(q,function(n){return"\\"+N[n]}),t&&(c+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'"),r&&(c+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),e&&(c+="';\n"+e+"\n__p+='"),o=u+n.length,n}),c+="';\n",c="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+(c=!t.variable?"with(obj||{}){\n"+c+"}\n":c)+"return __p;\n";try{r=new Function(t.variable||"obj","_",c)}catch(n){throw n.source=c,n}if(n)return r(n,_);n=function(n){return r.call(this,n,_)};return n.source="function("+(t.variable||"obj")+"){\n"+c+"}",n},_.chain=function(n){return _(n).chain()};var B=function(n){return this._chain?_(n).chain():n};_.mixin(_),j(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var r=u[t];_.prototype[t]=function(){var n=this._wrapped;return r.apply(n,arguments),"shift"!=t&&"splice"!=t||0!==n.length||delete n[0],B.call(this,n)}}),j(["concat","join","slice"],function(n){var t=u[n];_.prototype[n]=function(){return B.call(this,t.apply(this._wrapped,arguments))}}),_.extend(_.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return _})}).call(this); |