jquery-migrate
Advanced tools
Comparing version
@@ -5,17 +5,65 @@ /** | ||
"use strict"; | ||
import path from "node:path"; | ||
import { mkdir, readFile, writeFile } from "node:fs/promises"; | ||
import * as rollup from "rollup"; | ||
import { minify } from "./minify.js"; | ||
import { getTimestamp } from "./lib/getTimestamp.js"; | ||
import { compareSize } from "./compare_size.js"; | ||
import util from "node:util"; | ||
import { exec as nodeExec } from "node:child_process"; | ||
import { isCleanWorkingDir } from "./lib/isCleanWorkingDir.js"; | ||
module.exports = function( grunt ) { | ||
const path = require( "path" ); | ||
const rollup = require( "rollup" ); | ||
const rootFolder = path.resolve( `${ __dirname }/../..` ); | ||
const srcFolder = path.resolve( `${ rootFolder }/src` ); | ||
const read = function( fileName ) { | ||
return grunt.file.read( `${ srcFolder }/${ fileName }` ); | ||
}; | ||
const exec = util.promisify( nodeExec ); | ||
function read( filename ) { | ||
return readFile( filename, "utf8" ); | ||
} | ||
async function readJSON( filename ) { | ||
return JSON.parse( await read( filename ) ); | ||
} | ||
async function writeCompiled( { code, dir, filename, version } ) { | ||
const compiledContents = code | ||
// Embed Version | ||
.replace( /@VERSION/g, version ) | ||
// Embed Date | ||
// yyyy-mm-ddThh:mmZ | ||
.replace( /@DATE/g, new Date().toISOString().replace( /:\d+\.\d+Z$/, "Z" ) ); | ||
await writeFile( path.join( dir, filename ), compiledContents ); | ||
console.log( `[${ getTimestamp() }] ${ filename } v${ version } created.` ); | ||
await minify( { dir, filename, version } ); | ||
} | ||
export async function build( { | ||
dir = "dist", | ||
filename = "jquery-migrate.js", | ||
watch = false, | ||
version | ||
} = {} ) { | ||
const pkg = await readJSON( "package.json" ); | ||
// Add the short commit hash to the version string | ||
// when the version is not for a release. | ||
if ( !version ) { | ||
const { stdout } = await exec( "git rev-parse --short HEAD" ); | ||
const isClean = await isCleanWorkingDir(); | ||
// "+SHA" is semantically correct | ||
// Add ".dirty" as well if the working dir is not clean | ||
version = `${ pkg.version }+${ stdout.trim() }${ | ||
isClean ? "" : ".dirty" | ||
}`; | ||
} | ||
// Catch `// @CODE` and subsequent comment lines event if they don't start | ||
// in the first column. | ||
const wrapper = read( "wrapper.js" ) | ||
.split( /[\x20\t]*\/\/ @CODE\n(?:[\x20\t]*\/\/[^\n]+\n)*/ ); | ||
const wrapperSrc = await read( "src/wrapper.js" ); | ||
const wrapper = wrapperSrc.split( | ||
/[\x20\t]*\/\/ @CODE\n(?:[\x20\t]*\/\/[^\n]+\n)*/ | ||
); | ||
@@ -30,45 +78,55 @@ const inputRollupOptions = {}; | ||
intro: wrapper[ 0 ] | ||
.replace( /\n*$/, "" ), | ||
outro: wrapper[ 1 ] | ||
.replace( /^\n*/, "" ) | ||
intro: wrapper[ 0 ].replace( /\n*$/, "" ), | ||
outro: wrapper[ 1 ].replace( /^\n*/, "" ) | ||
}; | ||
const src = "src/migrate.js"; | ||
grunt.registerMultiTask( | ||
"build", | ||
"Build jQuery Migrate ECMAScript modules, embed date/version", | ||
async function() { | ||
const done = this.async(); | ||
inputRollupOptions.input = path.resolve( src ); | ||
try { | ||
const version = grunt.config( "pkg.version" ); | ||
const dest = this.files[ 0 ].dest; | ||
const src = this.files[ 0 ].src[ 0 ]; | ||
await mkdir( dir, { recursive: true } ); | ||
inputRollupOptions.input = path.resolve( `${ rootFolder }/${ src }` ); | ||
if ( watch ) { | ||
const watcher = rollup.watch( { | ||
...inputRollupOptions, | ||
output: [ outputRollupOptions ], | ||
watch: { | ||
include: "src/**", | ||
skipWrite: true | ||
} | ||
} ); | ||
const bundle = await rollup.rollup( inputRollupOptions ); | ||
watcher.on( "event", async( event ) => { | ||
switch ( event.code ) { | ||
case "ERROR": | ||
console.error( event.error ); | ||
break; | ||
case "BUNDLE_END": | ||
const { | ||
output: [ { code } ] | ||
} = await event.result.generate( outputRollupOptions ); | ||
const { output: [ { code } ] } = await bundle.generate( outputRollupOptions ); | ||
await writeCompiled( { | ||
code, | ||
dir, | ||
filename, | ||
version | ||
} ); | ||
break; | ||
} | ||
} ); | ||
const compiledContents = code | ||
return watcher; | ||
} else { | ||
const bundle = await rollup.rollup( inputRollupOptions ); | ||
// Embed Version | ||
.replace( /@VERSION/g, version ) | ||
const { | ||
output: [ { code } ] | ||
} = await bundle.generate( outputRollupOptions ); | ||
// Embed Date | ||
// yyyy-mm-ddThh:mmZ | ||
.replace( | ||
/@DATE/g, | ||
( new Date() ).toISOString() | ||
.replace( /:\d+\.\d+Z$/, "Z" ) | ||
); | ||
await writeCompiled( { code, dir, filename, version } ); | ||
grunt.file.write( `${ rootFolder }/${ dest }`, compiledContents ); | ||
grunt.log.ok( `File '${ dest }' created.` ); | ||
done(); | ||
} catch ( err ) { | ||
done( err ); | ||
} | ||
} ); | ||
}; | ||
return compareSize( { | ||
files: [ "dist/jquery-migrate.min.js" ] | ||
} ); | ||
} | ||
} |
@@ -71,8 +71,5 @@ # Contributing to jQuery | ||
* Some kind of localhost server(any will do) | ||
* Node.js | ||
* NPM (comes with the latest version of Node.js) | ||
* Grunt (install with: `npm install grunt -g`) | ||
### Build a Local Copy of the plugin | ||
@@ -112,10 +109,16 @@ | ||
Run the Grunt tools: | ||
Run the build and rebuild when source files change: | ||
```bash | ||
$ grunt && grunt watch | ||
$ npm start | ||
``` | ||
Now open the jQuery test suite in a browser at http://localhost/test. If there is a port, be sure to include it. | ||
In another terminal, run the test server: | ||
```bash | ||
$ npm run test:server | ||
``` | ||
Now open the jQuery test suite in a browser at http://localhost:3000/test/. | ||
Success! You just built and tested jQuery! | ||
@@ -122,0 +125,0 @@ |
/*! | ||
* jQuery Migrate - v3.4.1 - 2023-02-23T15:31Z | ||
* jQuery Migrate - v3.5.0 - 2024-07-12T21:46Z | ||
* Copyright OpenJS Foundation and other contributors | ||
@@ -27,3 +27,3 @@ */ | ||
jQuery.migrateVersion = "3.4.1"; | ||
jQuery.migrateVersion = "3.5.0"; | ||
@@ -88,22 +88,22 @@ // Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2 | ||
// Support: IE9 only | ||
// IE9 only creates console object when dev tools are first opened | ||
// IE9 console is a host object, callable but doesn't have .apply() | ||
if ( !window.console || !window.console.log ) { | ||
return; | ||
} | ||
// Support: IE9 only | ||
// IE9 only creates console object when dev tools are first opened | ||
// IE9 console is a host object, callable but doesn't have .apply() | ||
if ( !window.console || !window.console.log ) { | ||
return; | ||
} | ||
// Need jQuery 3.x-4.x and no older Migrate loaded | ||
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) || | ||
jQueryVersionSince( "5.0.0" ) ) { | ||
window.console.log( "JQMIGRATE: jQuery 3.x-4.x REQUIRED" ); | ||
} | ||
if ( jQuery.migrateWarnings ) { | ||
window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" ); | ||
} | ||
// Need jQuery 3.x-4.x and no older Migrate loaded | ||
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) || | ||
jQueryVersionSince( "5.0.0" ) ) { | ||
window.console.log( "JQMIGRATE: jQuery 3.x-4.x REQUIRED" ); | ||
} | ||
if ( jQuery.migrateWarnings ) { | ||
window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" ); | ||
} | ||
// Show a message on the console so devs know we're active | ||
window.console.log( "JQMIGRATE: Migrate is installed" + | ||
( jQuery.migrateMute ? "" : " with logging active" ) + | ||
", version " + jQuery.migrateVersion ); | ||
// Show a message on the console so devs know we're active | ||
window.console.log( "JQMIGRATE: Migrate is installed" + | ||
( jQuery.migrateMute ? "" : " with logging active" ) + | ||
", version " + jQuery.migrateVersion ); | ||
@@ -325,3 +325,4 @@ } )(); | ||
migratePatchAndWarnFunc( jQuery, "isNumeric", function( obj ) { | ||
migratePatchAndWarnFunc( jQuery, "isNumeric", | ||
function( obj ) { | ||
@@ -423,2 +424,3 @@ // As of jQuery 3.0, isNumeric is limited to | ||
oldToggleClass = jQuery.fn.toggleClass, | ||
rbooleans = /^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i, | ||
rmatchNonSpace = /\S+/g; | ||
@@ -431,3 +433,3 @@ | ||
jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) { | ||
if ( jQuery.expr.match.bool.test( attr ) ) { | ||
if ( rbooleans.test( attr ) ) { | ||
@@ -480,4 +482,4 @@ // Only warn if at least a single node had the property set to | ||
className || state === false ? | ||
"" : | ||
jQuery.data( this, "__className__" ) || "" | ||
"" : | ||
jQuery.data( this, "__className__" ) || "" | ||
); | ||
@@ -573,3 +575,3 @@ } | ||
// In jQuery >=4 where jQuery.cssNumber is missing fill it with the latest 3.x version: | ||
// https://github.com/jquery/jquery/blob/3.6.0/src/css.js#L212-L233 | ||
// https://github.com/jquery/jquery/blob/3.7.1/src/css.js#L216-L246 | ||
// This way, number values for the CSS properties below won't start triggering | ||
@@ -583,4 +585,5 @@ // Migrate warnings when jQuery gets updated to >=4.0.0 (gh-438). | ||
animationIterationCount: true, | ||
aspectRatio: true, | ||
borderImageSlice: true, | ||
columnCount: true, | ||
fillOpacity: true, | ||
flexGrow: true, | ||
@@ -600,5 +603,13 @@ flexShrink: true, | ||
orphans: true, | ||
scale: true, | ||
widows: true, | ||
zIndex: true, | ||
zoom: true | ||
zoom: true, | ||
// SVG-related | ||
fillOpacity: true, | ||
floodOpacity: true, | ||
stopOpacity: true, | ||
strokeMiterlimit: true, | ||
strokeOpacity: true | ||
}; | ||
@@ -849,3 +860,3 @@ | ||
"change select submit keydown keypress keyup contextmenu" ).split( " " ), | ||
function( _i, name ) { | ||
function( _i, name ) { | ||
@@ -857,5 +868,5 @@ // Handle event binding | ||
this.trigger( name ); | ||
}, | ||
"shorthand-deprecated-v3", | ||
"jQuery.fn." + name + "() event shorthand is deprecated" ); | ||
}, | ||
"shorthand-deprecated-v3", | ||
"jQuery.fn." + name + "() event shorthand is deprecated" ); | ||
} ); | ||
@@ -912,5 +923,7 @@ | ||
*/ | ||
jQuery.UNSAFE_restoreLegacyHtmlPrefilter = function() { | ||
migratePatchAndWarnFunc( jQuery, "UNSAFE_restoreLegacyHtmlPrefilter", function() { | ||
jQuery.migrateEnablePatches( "self-closed-tags" ); | ||
}; | ||
}, "legacy-self-closed-tags", | ||
"jQuery.UNSAFE_restoreLegacyHtmlPrefilter deprecated; use " + | ||
"`jQuery.migrateEnablePatches( \"self-closed-tags\" )`" ); | ||
@@ -917,0 +930,0 @@ migratePatchFunc( jQuery, "htmlPrefilter", function( html ) { |
@@ -1,3 +0,3 @@ | ||
/*! jQuery Migrate v3.4.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ | ||
"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],a=1;a<=3;a++){if(+o[a]<+n[a])return 1;if(+n[a]<+o[a])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.4.1";var t=Object.create(null);s.migrateDisablePatches=function(){for(var e=0;e<arguments.length;e++)t[arguments[e]]=!0},s.migrateEnablePatches=function(){for(var e=0;e<arguments.length;e++)delete t[arguments[e]]},s.migrateIsPatchEnabled=function(e){return!t[e]},n.console&&n.console.log&&(s&&e("3.0.0")&&!e("5.0.0")||n.console.log("JQMIGRATE: jQuery 3.x-4.x REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion));var o={};function u(e,t){var r=n.console;!s.migrateIsPatchEnabled(e)||s.migrateDeduplicateWarnings&&o[t]||(o[t]=!0,s.migrateWarnings.push(t+" ["+e+"]"),r&&r.warn&&!s.migrateMute&&(r.warn("JQMIGRATE: "+t),s.migrateTrace&&r.trace&&r.trace()))}function r(e,t,r,n,o){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return u(n,o),r},set:function(e){u(n,o),r=e}})}function a(e,t,r,n,o){var a=e[t];e[t]=function(){return o&&u(n,o),(s.migrateIsPatchEnabled(n)?r:a||s.noop).apply(this,arguments)}}function c(e,t,r,n,o){if(!o)throw new Error("No warning message provided");return a(e,t,r,n,o),0}function i(e,t,r,n){return a(e,t,r,n),0}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){o={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&u("quirks","jQuery is not compatible with Quirks Mode");var d,l,p,f={},m=s.fn.init,y=s.find,h=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,g=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,v=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;for(d in i(s.fn,"init",function(e){var t=Array.prototype.slice.call(arguments);return s.migrateIsPatchEnabled("selector-empty-id")&&"string"==typeof e&&"#"===e&&(u("selector-empty-id","jQuery( '#' ) is not a valid selector"),t[0]=[]),m.apply(this,t)},"selector-empty-id"),s.fn.init.prototype=s.fn,i(s,"find",function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&h.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(g,function(e,t,r,n){return"["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),u("selector-hash","Attribute selector with '#' must be quoted: "+r[0]),r[0]=t}catch(e){u("selector-hash","Attribute selector with '#' was not fixed: "+r[0])}}return y.apply(this,r)},"selector-hash"),y)Object.prototype.hasOwnProperty.call(y,d)&&(s.find[d]=y[d]);c(s.fn,"size",function(){return this.length},"size","jQuery.fn.size() is deprecated and removed; use the .length property"),c(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"parseJSON","jQuery.parseJSON is deprecated; use JSON.parse"),c(s,"holdReady",s.holdReady,"holdReady","jQuery.holdReady is deprecated"),c(s,"unique",s.uniqueSort,"unique","jQuery.unique is deprecated; use jQuery.uniqueSort"),r(s.expr,"filters",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),r(s.expr,":",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&c(s,"trim",function(e){return null==e?"":(e+"").replace(v,"$1")},"trim","jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(c(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"nodeName","jQuery.nodeName is deprecated"),c(s,"isArray",Array.isArray,"isArray","jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(c(s,"isNumeric",function(e){var t=typeof e;return("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"isNumeric","jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){f["[object "+t+"]"]=t.toLowerCase()}),c(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[Object.prototype.toString.call(e)]||"object":typeof e},"type","jQuery.type is deprecated"),c(s,"isFunction",function(e){return"function"==typeof e},"isFunction","jQuery.isFunction() is deprecated"),c(s,"isWindow",function(e){return null!=e&&e===e.window},"isWindow","jQuery.isWindow() is deprecated")),s.ajax&&(l=s.ajax,p=/(=)\?(?=&|$)|\?\?/,i(s,"ajax",function(){var e=l.apply(this,arguments);return e.promise&&(c(e,"success",e.done,"jqXHR-methods","jQXHR.success is deprecated and removed"),c(e,"error",e.fail,"jqXHR-methods","jQXHR.error is deprecated and removed"),c(e,"complete",e.always,"jqXHR-methods","jQXHR.complete is deprecated and removed")),e},"jqXHR-methods"),e("4.0.0")||s.ajaxPrefilter("+json",function(e){!1!==e.jsonp&&(p.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&p.test(e.data))&&u("jsonp-promotion","JSON-to-JSONP auto-promotion is deprecated")}));var j=s.fn.removeAttr,b=s.fn.toggleClass,w=/\S+/g;function x(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}i(s.fn,"removeAttr",function(e){var r=this,n=!1;return s.each(e.match(w),function(e,t){s.expr.match.bool.test(t)&&r.each(function(){if(!1!==s(this).prop(t))return!(n=!0)}),n&&(u("removeAttr-bool","jQuery.fn.removeAttr no longer sets boolean properties: "+t),r.prop(t,!1))}),j.apply(this,arguments)},"removeAttr-bool"),i(s.fn,"toggleClass",function(t){return void 0!==t&&"boolean"!=typeof t?b.apply(this,arguments):(u("toggleClass-bool","jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==t&&s.data(this,"__className__")||"")}))},"toggleClass-bool");var Q,A,R=!1,C=/^[a-z]/,N=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var r=s.cssHooks[t]&&s.cssHooks[t].get;r&&(s.cssHooks[t].get=function(){var e;return R=!0,e=r.apply(this,arguments),R=!1,e})}),i(s,"swap",function(e,t,r,n){var o,a,i={};for(a in R||u("swap","jQuery.swap() is undocumented and deprecated"),t)i[a]=e.style[a],e.style[a]=t[a];for(a in o=r.apply(e,n||[]),t)e.style[a]=i[a];return o},"swap"),e("3.4.0")&&"undefined"!=typeof Proxy&&(s.cssProps=new Proxy(s.cssProps||{},{set:function(){return u("cssProps","jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}})),e("4.0.0")?(A={animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},"undefined"!=typeof Proxy?s.cssNumber=new Proxy(A,{get:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.get.apply(this,arguments)},set:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.set.apply(this,arguments)}}):s.cssNumber=A):A=s.cssNumber,Q=s.fn.css,i(s.fn,"css",function(e,t){var r,n,o=this;return e&&"object"==typeof e&&!Array.isArray(e)?(s.each(e,function(e,t){s.fn.css.call(o,e,t)}),this):("number"==typeof t&&(r=x(e),n=r,C.test(n)&&N.test(n[0].toUpperCase()+n.slice(1))||A[r]||u("css-number",'Number-typed values are deprecated for jQuery.fn.css( "'+e+'", value )')),Q.apply(this,arguments))},"css-number");var S,P,k,H,E=s.data;i(s,"data",function(e,t,r){var n,o,a;if(t&&"object"==typeof t&&2===arguments.length){for(a in n=s.hasData(e)&&E.call(this,e),o={},t)a!==x(a)?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+a),n[a]=t[a]):o[a]=t[a];return E.call(this,e,o),t}return t&&"string"==typeof t&&t!==x(t)&&(n=s.hasData(e)&&E.call(this,e))&&t in n?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+t),2<arguments.length&&(n[t]=r),n[t]):E.apply(this,arguments)},"data-camelCase"),s.fx&&(k=s.Tween.prototype.run,H=function(e){return e},i(s.Tween.prototype,"run",function(){1<s.easing[this.easing].length&&(u("easing-one-arg","'jQuery.easing."+this.easing.toString()+"' should use only one argument"),s.easing[this.easing]=H),k.apply(this,arguments)},"easing-one-arg"),S=s.fx.interval,P="jQuery.fx.interval is deprecated",n.requestAnimationFrame&&Object.defineProperty(s.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return n.document.hidden||u("fx-interval",P),s.migrateIsPatchEnabled("fx-interval")&&void 0===S?13:S},set:function(e){u("fx-interval",P),S=e}}));var M=s.fn.load,q=s.event.add,O=s.event.fix;s.event.props=[],s.event.fixHooks={},r(s.event.props,"concat",s.event.props.concat,"event-old-patch","jQuery.event.props.concat() is deprecated and removed"),i(s.event,"fix",function(e){var t,r=e.type,n=this.fixHooks[r],o=s.event.props;if(o.length){u("event-old-patch","jQuery.event.props are deprecated and removed: "+o.join());while(o.length)s.event.addProp(o.pop())}if(n&&!n._migrated_&&(n._migrated_=!0,u("event-old-patch","jQuery.event.fixHooks are deprecated and removed: "+r),(o=n.props)&&o.length))while(o.length)s.event.addProp(o.pop());return t=O.call(this,e),n&&n.filter?n.filter(t,e):t},"event-old-patch"),i(s.event,"add",function(e,t){return e===n&&"load"===t&&"complete"===n.document.readyState&&u("load-after-event","jQuery(window).on('load'...) called after load event occurred"),q.apply(this,arguments)},"load-after-event"),s.each(["load","unload","error"],function(e,t){i(s.fn,t,function(){var e=Array.prototype.slice.call(arguments,0);return"load"===t&&"string"==typeof e[0]?M.apply(this,e):(u("shorthand-removed-v3","jQuery.fn."+t+"() is deprecated"),e.splice(0,0,t),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))},"shorthand-removed-v3")}),s.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,r){c(s.fn,r,function(e,t){return 0<arguments.length?this.on(r,null,e,t):this.trigger(r)},"shorthand-deprecated-v3","jQuery.fn."+r+"() event shorthand is deprecated")}),s(function(){s(n.document).triggerHandler("ready")}),s.event.special.ready={setup:function(){this===n.document&&u("ready-event","'ready' event is deprecated")}},c(s.fn,"bind",function(e,t,r){return this.on(e,null,t,r)},"pre-on-methods","jQuery.fn.bind() is deprecated"),c(s.fn,"unbind",function(e,t){return this.off(e,null,t)},"pre-on-methods","jQuery.fn.unbind() is deprecated"),c(s.fn,"delegate",function(e,t,r,n){return this.on(t,e,r,n)},"pre-on-methods","jQuery.fn.delegate() is deprecated"),c(s.fn,"undelegate",function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)},"pre-on-methods","jQuery.fn.undelegate() is deprecated"),c(s.fn,"hover",function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)},"pre-on-methods","jQuery.fn.hover() is deprecated");function T(e){var t=n.document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body&&t.body.innerHTML}var F=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi;s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.migrateEnablePatches("self-closed-tags")},i(s,"htmlPrefilter",function(e){var t,r;return(r=(t=e).replace(F,"<$1></$2>"))!==t&&T(t)!==T(r)&&u("self-closed-tags","HTML tags must be properly nested and closed: "+t),e.replace(F,"<$1></$2>")},"self-closed-tags"),s.migrateDisablePatches("self-closed-tags");var D,W,_,I=s.fn.offset;return i(s.fn,"offset",function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?I.apply(this,arguments):(u("offset-valid-elem","jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},"offset-valid-elem"),s.ajax&&(D=s.param,i(s,"param",function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("param-ajax-traditional","jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),D.call(this,e,t)},"param-ajax-traditional")),c(s.fn,"andSelf",s.fn.addBack,"andSelf","jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),s.Deferred&&(W=s.Deferred,_=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],i(s,"Deferred",function(e){var a=W(),i=a.promise();function t(){var o=arguments;return s.Deferred(function(n){s.each(_,function(e,t){var r="function"==typeof o[e]&&o[e];a[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===i?n.promise():this,r?[e]:arguments)})}),o=null}).promise()}return c(a,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),c(i,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),e&&e.call(a,a),a},"deferred-pipe"),s.Deferred.exceptionHook=W.exceptionHook),s}); | ||
/*! jQuery Migrate v3.5.0 | (c) OpenJS Foundation and other contributors | jquery.com/license */ | ||
"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],a=1;a<=3;a++){if(+o[a]<+n[a])return 1;if(+n[a]<+o[a])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.5.0";var t=Object.create(null);s.migrateDisablePatches=function(){for(var e=0;e<arguments.length;e++)t[arguments[e]]=!0},s.migrateEnablePatches=function(){for(var e=0;e<arguments.length;e++)delete t[arguments[e]]},s.migrateIsPatchEnabled=function(e){return!t[e]},n.console&&n.console.log&&(s&&e("3.0.0")&&!e("5.0.0")||n.console.log("JQMIGRATE: jQuery 3.x-4.x REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion));var o={};function u(e,t){var r=n.console;!s.migrateIsPatchEnabled(e)||s.migrateDeduplicateWarnings&&o[t]||(o[t]=!0,s.migrateWarnings.push(t+" ["+e+"]"),r&&r.warn&&!s.migrateMute&&(r.warn("JQMIGRATE: "+t),s.migrateTrace&&r.trace&&r.trace()))}function r(e,t,r,n,o){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return u(n,o),r},set:function(e){u(n,o),r=e}})}function a(e,t,r,n,o){var a=e[t];e[t]=function(){return o&&u(n,o),(s.migrateIsPatchEnabled(n)?r:a||s.noop).apply(this,arguments)}}function c(e,t,r,n,o){if(!o)throw new Error("No warning message provided");return a(e,t,r,n,o),0}function i(e,t,r,n){return a(e,t,r,n),0}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){o={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&u("quirks","jQuery is not compatible with Quirks Mode");var d,l,p,f={},m=s.fn.init,y=s.find,g=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,h=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,v=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;for(d in i(s.fn,"init",function(e){var t=Array.prototype.slice.call(arguments);return s.migrateIsPatchEnabled("selector-empty-id")&&"string"==typeof e&&"#"===e&&(u("selector-empty-id","jQuery( '#' ) is not a valid selector"),t[0]=[]),m.apply(this,t)},"selector-empty-id"),s.fn.init.prototype=s.fn,i(s,"find",function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&g.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(h,function(e,t,r,n){return"["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),u("selector-hash","Attribute selector with '#' must be quoted: "+r[0]),r[0]=t}catch(e){u("selector-hash","Attribute selector with '#' was not fixed: "+r[0])}}return y.apply(this,r)},"selector-hash"),y)Object.prototype.hasOwnProperty.call(y,d)&&(s.find[d]=y[d]);c(s.fn,"size",function(){return this.length},"size","jQuery.fn.size() is deprecated and removed; use the .length property"),c(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"parseJSON","jQuery.parseJSON is deprecated; use JSON.parse"),c(s,"holdReady",s.holdReady,"holdReady","jQuery.holdReady is deprecated"),c(s,"unique",s.uniqueSort,"unique","jQuery.unique is deprecated; use jQuery.uniqueSort"),r(s.expr,"filters",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),r(s.expr,":",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&c(s,"trim",function(e){return null==e?"":(e+"").replace(v,"$1")},"trim","jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(c(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"nodeName","jQuery.nodeName is deprecated"),c(s,"isArray",Array.isArray,"isArray","jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(c(s,"isNumeric",function(e){var t=typeof e;return("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"isNumeric","jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){f["[object "+t+"]"]=t.toLowerCase()}),c(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[Object.prototype.toString.call(e)]||"object":typeof e},"type","jQuery.type is deprecated"),c(s,"isFunction",function(e){return"function"==typeof e},"isFunction","jQuery.isFunction() is deprecated"),c(s,"isWindow",function(e){return null!=e&&e===e.window},"isWindow","jQuery.isWindow() is deprecated")),s.ajax&&(l=s.ajax,p=/(=)\?(?=&|$)|\?\?/,i(s,"ajax",function(){var e=l.apply(this,arguments);return e.promise&&(c(e,"success",e.done,"jqXHR-methods","jQXHR.success is deprecated and removed"),c(e,"error",e.fail,"jqXHR-methods","jQXHR.error is deprecated and removed"),c(e,"complete",e.always,"jqXHR-methods","jQXHR.complete is deprecated and removed")),e},"jqXHR-methods"),e("4.0.0")||s.ajaxPrefilter("+json",function(e){!1!==e.jsonp&&(p.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&p.test(e.data))&&u("jsonp-promotion","JSON-to-JSONP auto-promotion is deprecated")}));var j=s.fn.removeAttr,b=s.fn.toggleClass,Q=/^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i,w=/\S+/g;function x(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}i(s.fn,"removeAttr",function(e){var r=this,n=!1;return s.each(e.match(w),function(e,t){Q.test(t)&&r.each(function(){if(!1!==s(this).prop(t))return!(n=!0)}),n&&(u("removeAttr-bool","jQuery.fn.removeAttr no longer sets boolean properties: "+t),r.prop(t,!1))}),j.apply(this,arguments)},"removeAttr-bool"),i(s.fn,"toggleClass",function(t){return void 0!==t&&"boolean"!=typeof t?b.apply(this,arguments):(u("toggleClass-bool","jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==t&&s.data(this,"__className__")||"")}))},"toggleClass-bool");var A,R,S=!1,k=/^[a-z]/,N=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var r=s.cssHooks[t]&&s.cssHooks[t].get;r&&(s.cssHooks[t].get=function(){var e;return S=!0,e=r.apply(this,arguments),S=!1,e})}),i(s,"swap",function(e,t,r,n){var o,a,i={};for(a in S||u("swap","jQuery.swap() is undocumented and deprecated"),t)i[a]=e.style[a],e.style[a]=t[a];for(a in o=r.apply(e,n||[]),t)e.style[a]=i[a];return o},"swap"),e("3.4.0")&&"undefined"!=typeof Proxy&&(s.cssProps=new Proxy(s.cssProps||{},{set:function(){return u("cssProps","jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}})),e("4.0.0")?(R={animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},"undefined"!=typeof Proxy?s.cssNumber=new Proxy(R,{get:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.get.apply(this,arguments)},set:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.set.apply(this,arguments)}}):s.cssNumber=R):R=s.cssNumber,A=s.fn.css,i(s.fn,"css",function(e,t){var r,n,o=this;return e&&"object"==typeof e&&!Array.isArray(e)?(s.each(e,function(e,t){s.fn.css.call(o,e,t)}),this):("number"==typeof t&&(r=x(e),n=r,k.test(n)&&N.test(n[0].toUpperCase()+n.slice(1))||R[r]||u("css-number",'Number-typed values are deprecated for jQuery.fn.css( "'+e+'", value )')),A.apply(this,arguments))},"css-number");var P,C,H,E,M=s.data;i(s,"data",function(e,t,r){var n,o,a;if(t&&"object"==typeof t&&2===arguments.length){for(a in n=s.hasData(e)&&M.call(this,e),o={},t)a!==x(a)?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+a),n[a]=t[a]):o[a]=t[a];return M.call(this,e,o),t}return t&&"string"==typeof t&&t!==x(t)&&(n=s.hasData(e)&&M.call(this,e))&&t in n?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+t),2<arguments.length&&(n[t]=r),n[t]):M.apply(this,arguments)},"data-camelCase"),s.fx&&(H=s.Tween.prototype.run,E=function(e){return e},i(s.Tween.prototype,"run",function(){1<s.easing[this.easing].length&&(u("easing-one-arg","'jQuery.easing."+this.easing.toString()+"' should use only one argument"),s.easing[this.easing]=E),H.apply(this,arguments)},"easing-one-arg"),P=s.fx.interval,C="jQuery.fx.interval is deprecated",n.requestAnimationFrame&&Object.defineProperty(s.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return n.document.hidden||u("fx-interval",C),s.migrateIsPatchEnabled("fx-interval")&&void 0===P?13:P},set:function(e){u("fx-interval",C),P=e}}));var q=s.fn.load,O=s.event.add,F=s.event.fix;s.event.props=[],s.event.fixHooks={},r(s.event.props,"concat",s.event.props.concat,"event-old-patch","jQuery.event.props.concat() is deprecated and removed"),i(s.event,"fix",function(e){var t,r=e.type,n=this.fixHooks[r],o=s.event.props;if(o.length){u("event-old-patch","jQuery.event.props are deprecated and removed: "+o.join());while(o.length)s.event.addProp(o.pop())}if(n&&!n._migrated_&&(n._migrated_=!0,u("event-old-patch","jQuery.event.fixHooks are deprecated and removed: "+r),(o=n.props)&&o.length))while(o.length)s.event.addProp(o.pop());return t=F.call(this,e),n&&n.filter?n.filter(t,e):t},"event-old-patch"),i(s.event,"add",function(e,t){return e===n&&"load"===t&&"complete"===n.document.readyState&&u("load-after-event","jQuery(window).on('load'...) called after load event occurred"),O.apply(this,arguments)},"load-after-event"),s.each(["load","unload","error"],function(e,t){i(s.fn,t,function(){var e=Array.prototype.slice.call(arguments,0);return"load"===t&&"string"==typeof e[0]?q.apply(this,e):(u("shorthand-removed-v3","jQuery.fn."+t+"() is deprecated"),e.splice(0,0,t),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))},"shorthand-removed-v3")}),s.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,r){c(s.fn,r,function(e,t){return 0<arguments.length?this.on(r,null,e,t):this.trigger(r)},"shorthand-deprecated-v3","jQuery.fn."+r+"() event shorthand is deprecated")}),s(function(){s(n.document).triggerHandler("ready")}),s.event.special.ready={setup:function(){this===n.document&&u("ready-event","'ready' event is deprecated")}},c(s.fn,"bind",function(e,t,r){return this.on(e,null,t,r)},"pre-on-methods","jQuery.fn.bind() is deprecated"),c(s.fn,"unbind",function(e,t){return this.off(e,null,t)},"pre-on-methods","jQuery.fn.unbind() is deprecated"),c(s.fn,"delegate",function(e,t,r,n){return this.on(t,e,r,n)},"pre-on-methods","jQuery.fn.delegate() is deprecated"),c(s.fn,"undelegate",function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)},"pre-on-methods","jQuery.fn.undelegate() is deprecated"),c(s.fn,"hover",function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)},"pre-on-methods","jQuery.fn.hover() is deprecated");function T(e){var t=n.document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body&&t.body.innerHTML}var D=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi;c(s,"UNSAFE_restoreLegacyHtmlPrefilter",function(){s.migrateEnablePatches("self-closed-tags")},"legacy-self-closed-tags",'jQuery.UNSAFE_restoreLegacyHtmlPrefilter deprecated; use `jQuery.migrateEnablePatches( "self-closed-tags" )`'),i(s,"htmlPrefilter",function(e){var t,r;return(r=(t=e).replace(D,"<$1></$2>"))!==t&&T(t)!==T(r)&&u("self-closed-tags","HTML tags must be properly nested and closed: "+t),e.replace(D,"<$1></$2>")},"self-closed-tags"),s.migrateDisablePatches("self-closed-tags");var _,I,W,J=s.fn.offset;return i(s.fn,"offset",function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?J.apply(this,arguments):(u("offset-valid-elem","jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},"offset-valid-elem"),s.ajax&&(_=s.param,i(s,"param",function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("param-ajax-traditional","jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),_.call(this,e,t)},"param-ajax-traditional")),c(s.fn,"andSelf",s.fn.addBack,"andSelf","jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),s.Deferred&&(I=s.Deferred,W=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],i(s,"Deferred",function(e){var a=I(),i=a.promise();function t(){var o=arguments;return s.Deferred(function(n){s.each(W,function(e,t){var r="function"==typeof o[e]&&o[e];a[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===i?n.promise():this,r?[e]:arguments)})}),o=null}).promise()}return c(a,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),c(i,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),e&&e.call(a,a),a},"deferred-pipe"),s.Deferred.exceptionHook=I.exceptionHook),s}); | ||
//# sourceMappingURL=jquery-migrate.min.map |
@@ -6,3 +6,4 @@ { | ||
"main": "dist/jquery-migrate.js", | ||
"version": "3.4.1", | ||
"version": "3.5.0", | ||
"type": "module", | ||
"homepage": "https://github.com/jquery/jquery-migrate", | ||
@@ -22,5 +23,13 @@ "author": { | ||
"scripts": { | ||
"build": "grunt default-no-test", | ||
"test": "grunt test", | ||
"ci": "grunt ci" | ||
"build": "node build/tasks/build-default.js", | ||
"lint": "eslint --cache .", | ||
"npmcopy": "node build/tasks/npmcopy.js", | ||
"prepare": "husky", | ||
"pretest": "npm run npmcopy && npm run build && npm run lint", | ||
"start": "npm run npmcopy && node build/tasks/build-watch.js", | ||
"test:browser": "npm run pretest && npm run test:unit -- -b chrome -b firefox -h", | ||
"test:safari": "npm run pretest && npm run test:unit -- -v -b safari", | ||
"test:server": "node test/runner/server.js", | ||
"test:unit": "node test/runner/command.js", | ||
"test": "npm run test:browser" | ||
}, | ||
@@ -31,27 +40,23 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"chalk": "5.0.1", | ||
"@types/selenium-webdriver": "4.1.22", | ||
"body-parser": "1.20.2", | ||
"browserstack-local": "1.5.5", | ||
"chalk": "5.3.0", | ||
"commitplease": "3.2.0", | ||
"enquirer": "2.3.6", | ||
"eslint": "8.11.0", | ||
"eslint-config-jquery": "3.0.0", | ||
"eslint-plugin-import": "2.25.4", | ||
"grunt": "1.5.3", | ||
"grunt-cli": "1.4.3", | ||
"grunt-compare-size": "0.4.2", | ||
"grunt-contrib-uglify": "4.0.1", | ||
"grunt-contrib-watch": "1.1.0", | ||
"grunt-eslint": "24.0.0", | ||
"grunt-karma": "4.0.2", | ||
"grunt-npmcopy": "0.2.0", | ||
"gzip-js": "0.3.2", | ||
"karma": "6.3.17", | ||
"karma-browserstack-launcher": "1.6.0", | ||
"karma-chrome-launcher": "3.1.1", | ||
"karma-firefox-launcher": "2.1.2", | ||
"karma-qunit": "4.1.2", | ||
"load-grunt-tasks": "5.1.0", | ||
"diff": "5.2.0", | ||
"enquirer": "2.4.1", | ||
"eslint": "8.57.0", | ||
"eslint-config-jquery": "3.0.2", | ||
"eslint-plugin-import": "2.29.1", | ||
"exit-hook": "4.0.0", | ||
"express": "4.19.2", | ||
"express-body-parser-error-handler": "1.0.7", | ||
"globals": "15.3.0", | ||
"husky": "9.0.11", | ||
"native-promise-only": "0.8.1", | ||
"qunit": "2.19.1", | ||
"rollup": "2.70.1", | ||
"testswarm": "1.1.2" | ||
"qunit": "2.21.0", | ||
"rollup": "4.18.0", | ||
"selenium-webdriver": "4.21.0", | ||
"uglify-js": "3.9.4", | ||
"yargs": "17.7.2" | ||
}, | ||
@@ -66,2 +71,3 @@ "keywords": [ | ||
"commitplease": { | ||
"nohook": true, | ||
"components": [ | ||
@@ -68,0 +74,0 @@ "Docs", |
@@ -28,4 +28,4 @@  | ||
```html | ||
<script src="https://code.jquery.com/jquery-3.6.3.js"></script> | ||
<script src="https://code.jquery.com/jquery-migrate-3.4.1.js"></script> | ||
<script src="https://code.jquery.com/jquery-3.7.1.js"></script> | ||
<script src="https://code.jquery.com/jquery-migrate-3.5.0.js"></script> | ||
``` | ||
@@ -43,3 +43,3 @@ | ||
| Minified | | <p align="center">✓</p> | | ||
| Latest release (*may be hotlinked if desired*) | [jquery-migrate-3.4.1.js](https://code.jquery.com/jquery-migrate-3.4.1.js) | [jquery-migrate-3.4.1.min.js](https://code.jquery.com/jquery-migrate-3.4.1.min.js) | | ||
| Latest release (*may be hotlinked if desired*) | [jquery-migrate-3.5.0.js](https://code.jquery.com/jquery-migrate-3.5.0.js) | [jquery-migrate-3.5.0.min.js](https://code.jquery.com/jquery-migrate-3.5.0.min.js) | | ||
| \* Latest work-in-progress build | [jquery-migrate-git.js](https://releases.jquery.com/git/jquery-migrate-git.js) | [jquery-migrate-git.min.js](https://releases.jquery.com/git/jquery-migrate-git.min.js) | | ||
@@ -94,2 +94,3 @@ | ||
## Build with `npm` commands | ||
```sh | ||
@@ -102,12 +103,2 @@ $ git clone git://github.com/jquery/jquery-migrate.git | ||
## Build with [`grunt`](http://gruntjs.com/) | ||
```sh | ||
$ git clone git://github.com/jquery/jquery-migrate.git | ||
$ cd jquery-migrate | ||
$ npm install | ||
$ npm install -g grunt-cli | ||
$ grunt build | ||
``` | ||
### Run tests | ||
@@ -122,3 +113,5 @@ | ||
```sh | ||
$ grunt test | ||
$ npm run test:server | ||
``` | ||
and open http://localhost:3000/test/ in your browser. |
@@ -5,2 +5,3 @@ import { migratePatchFunc, migrateWarn } from "../main.js"; | ||
oldToggleClass = jQuery.fn.toggleClass, | ||
rbooleans = /^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i, | ||
rmatchNonSpace = /\S+/g; | ||
@@ -13,3 +14,3 @@ | ||
jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) { | ||
if ( jQuery.expr.match.bool.test( attr ) ) { | ||
if ( rbooleans.test( attr ) ) { | ||
@@ -62,4 +63,4 @@ // Only warn if at least a single node had the property set to | ||
className || state === false ? | ||
"" : | ||
jQuery.data( this, "__className__" ) || "" | ||
"" : | ||
jQuery.data( this, "__className__" ) || "" | ||
); | ||
@@ -66,0 +67,0 @@ } |
@@ -131,3 +131,4 @@ import { jQueryVersionSince } from "../compareVersions.js"; | ||
migratePatchAndWarnFunc( jQuery, "isNumeric", function( obj ) { | ||
migratePatchAndWarnFunc( jQuery, "isNumeric", | ||
function( obj ) { | ||
@@ -134,0 +135,0 @@ // As of jQuery 3.0, isNumeric is limited to |
@@ -84,3 +84,3 @@ import { jQueryVersionSince } from "../compareVersions.js"; | ||
// In jQuery >=4 where jQuery.cssNumber is missing fill it with the latest 3.x version: | ||
// https://github.com/jquery/jquery/blob/3.6.0/src/css.js#L212-L233 | ||
// https://github.com/jquery/jquery/blob/3.7.1/src/css.js#L216-L246 | ||
// This way, number values for the CSS properties below won't start triggering | ||
@@ -94,4 +94,5 @@ // Migrate warnings when jQuery gets updated to >=4.0.0 (gh-438). | ||
animationIterationCount: true, | ||
aspectRatio: true, | ||
borderImageSlice: true, | ||
columnCount: true, | ||
fillOpacity: true, | ||
flexGrow: true, | ||
@@ -111,5 +112,13 @@ flexShrink: true, | ||
orphans: true, | ||
scale: true, | ||
widows: true, | ||
zIndex: true, | ||
zoom: true | ||
zoom: true, | ||
// SVG-related | ||
fillOpacity: true, | ||
floodOpacity: true, | ||
stopOpacity: true, | ||
strokeMiterlimit: true, | ||
strokeOpacity: true | ||
}; | ||
@@ -116,0 +125,0 @@ |
@@ -96,3 +96,3 @@ import { | ||
"change select submit keydown keypress keyup contextmenu" ).split( " " ), | ||
function( _i, name ) { | ||
function( _i, name ) { | ||
@@ -104,5 +104,5 @@ // Handle event binding | ||
this.trigger( name ); | ||
}, | ||
"shorthand-deprecated-v3", | ||
"jQuery.fn." + name + "() event shorthand is deprecated" ); | ||
}, | ||
"shorthand-deprecated-v3", | ||
"jQuery.fn." + name + "() event shorthand is deprecated" ); | ||
} ); | ||
@@ -109,0 +109,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { migratePatchFunc, migrateWarn } from "../main.js"; | ||
import { migratePatchAndWarnFunc, migratePatchFunc, migrateWarn } from "../main.js"; | ||
import "../disablePatches.js"; | ||
@@ -22,5 +22,7 @@ | ||
*/ | ||
jQuery.UNSAFE_restoreLegacyHtmlPrefilter = function() { | ||
migratePatchAndWarnFunc( jQuery, "UNSAFE_restoreLegacyHtmlPrefilter", function() { | ||
jQuery.migrateEnablePatches( "self-closed-tags" ); | ||
}; | ||
}, "legacy-self-closed-tags", | ||
"jQuery.UNSAFE_restoreLegacyHtmlPrefilter deprecated; use " + | ||
"`jQuery.migrateEnablePatches( \"self-closed-tags\" )`" ); | ||
@@ -27,0 +29,0 @@ migratePatchFunc( jQuery, "htmlPrefilter", function( html ) { |
@@ -6,22 +6,22 @@ import { jQueryVersionSince } from "./compareVersions.js"; | ||
// Support: IE9 only | ||
// IE9 only creates console object when dev tools are first opened | ||
// IE9 console is a host object, callable but doesn't have .apply() | ||
if ( !window.console || !window.console.log ) { | ||
return; | ||
} | ||
// Support: IE9 only | ||
// IE9 only creates console object when dev tools are first opened | ||
// IE9 console is a host object, callable but doesn't have .apply() | ||
if ( !window.console || !window.console.log ) { | ||
return; | ||
} | ||
// Need jQuery 3.x-4.x and no older Migrate loaded | ||
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) || | ||
jQueryVersionSince( "5.0.0" ) ) { | ||
window.console.log( "JQMIGRATE: jQuery 3.x-4.x REQUIRED" ); | ||
} | ||
if ( jQuery.migrateWarnings ) { | ||
window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" ); | ||
} | ||
// Need jQuery 3.x-4.x and no older Migrate loaded | ||
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) || | ||
jQueryVersionSince( "5.0.0" ) ) { | ||
window.console.log( "JQMIGRATE: jQuery 3.x-4.x REQUIRED" ); | ||
} | ||
if ( jQuery.migrateWarnings ) { | ||
window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" ); | ||
} | ||
// Show a message on the console so devs know we're active | ||
window.console.log( "JQMIGRATE: Migrate is installed" + | ||
( jQuery.migrateMute ? "" : " with logging active" ) + | ||
", version " + jQuery.migrateVersion ); | ||
// Show a message on the console so devs know we're active | ||
window.console.log( "JQMIGRATE: Migrate is installed" + | ||
( jQuery.migrateMute ? "" : " with logging active" ) + | ||
", version " + jQuery.migrateVersion ); | ||
@@ -28,0 +28,0 @@ } )(); |
jQuery.migrateVersion = "3.4.1"; | ||
jQuery.migrateVersion = "3.5.0"; |
@@ -0,1 +1,3 @@ | ||
"use strict"; | ||
// Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2 | ||
@@ -2,0 +4,0 @@ window.compareVersions = function compareVersions( v1, v2 ) { |
@@ -0,1 +1,3 @@ | ||
"use strict"; | ||
/* | ||
@@ -2,0 +4,0 @@ * Iframe-based unit tests support |
@@ -0,1 +1,3 @@ | ||
"use strict"; | ||
/* exported expectWarning, expectNoWarning */ | ||
@@ -2,0 +4,0 @@ |
@@ -1,4 +0,3 @@ | ||
// ESLint doesn't take the `typeof` check into account and still | ||
// complains about the `global` variable | ||
// eslint-disable-next-line no-undef | ||
"use strict"; | ||
( typeof global != "undefined" ? global : window ).TestManager = { | ||
@@ -22,6 +21,2 @@ | ||
if ( window.__karma__ && isSelf ) { | ||
projectRoot = "/base"; | ||
} | ||
// The esmodules mode requires the browser to support ES modules | ||
@@ -87,10 +82,2 @@ // so it won't run in IE. | ||
// Load the TestSwarm listener if swarmURL is in the address. | ||
if ( QUnit.isSwarm ) { | ||
document.write( "<scr" + "ipt " + | ||
( esmodules ? "type='module' " : "" ) + | ||
"src='https://swarm.jquery.org/js/inject.js?" + ( new Date() ).getTime() + "'" + | ||
"></scr" + "ipt>" ); | ||
} | ||
document.write( "<script " + ( esmodules ? "type='module'" : "" ) + ">" + | ||
@@ -169,6 +156,3 @@ " QUnit.start();\n" + | ||
// Tests are always loaded async | ||
// except when running tests in Karma (See Gruntfile) | ||
if ( !window.__karma__ ) { | ||
QUnit.config.autostart = false; | ||
} | ||
QUnit.config.autostart = false; | ||
@@ -182,5 +166,2 @@ // Max time for async tests until it aborts test | ||
// Leverage QUnit URL parsing to detect testSwarm environment | ||
QUnit.isSwarm = ( QUnit.urlParams.swarmURL + "" ).indexOf( "http" ) === 0; | ||
// Set the list of projects, including the project version choices. | ||
@@ -192,3 +173,3 @@ for ( p in projects ) { | ||
id: project.urlTag, | ||
value: project.choices.split( "," ) | ||
value: project.choices | ||
} ); | ||
@@ -213,3 +194,3 @@ } | ||
QUnit.begin( function( details ) { | ||
QUnit.begin( function() { | ||
originalDeduplicateWarnings = jQuery.migrateDeduplicateWarnings; | ||
@@ -268,11 +249,53 @@ } ); | ||
urlTag: "jquery", | ||
choices: "dev,min,git,git.min,git.slim,git.slim.min," + | ||
"3.x-git,3.x-git.min,3.x-git.slim,3.x-git.slim.min," + | ||
"3.6.3,3.6.3.slim,3.5.1,3.5.1.slim,3.4.1,3.4.1.slim," + | ||
"3.3.1,3.3.1.slim,3.2.1,3.2.1.slim,3.1.1,3.1.1.slim,3.0.0,3.0.0.slim" | ||
// Keep in sync with test/runner/jquery.js | ||
choices: [ | ||
"dev", | ||
"min", | ||
"git", | ||
"git.min", | ||
"git.slim", | ||
"git.slim.min", | ||
"3.x-git", | ||
"3.x-git.min", | ||
"3.x-git.slim", | ||
"3.x-git.slim.min", | ||
"3.7.1", | ||
"3.7.1.slim", | ||
"3.6.4", | ||
"3.6.4.slim", | ||
"3.5.1", | ||
"3.5.1.slim", | ||
"3.4.1", | ||
"3.4.1.slim", | ||
"3.3.1", | ||
"3.3.1.slim", | ||
"3.2.1", | ||
"3.2.1.slim", | ||
"3.1.1", | ||
"3.1.1.slim", | ||
"3.0.0", | ||
"3.0.0.slim" | ||
] | ||
}, | ||
"jquery-migrate": { | ||
urlTag: "plugin", | ||
choices: "dev,min,esmodules,git,3.3.2,3.3.1,3.3.0,3.2.0,3.1.0,3.0.1,3.0.0" | ||
// Keep in sync with test/runner/jquery-migrate.js | ||
choices: [ | ||
"dev", | ||
"min", | ||
"git", | ||
"3.4.1", | ||
"3.4.0", | ||
"3.3.2", | ||
"3.3.1", | ||
"3.3.0", | ||
"3.2.0", | ||
"3.1.0", | ||
"3.0.1", | ||
"3.0.0", | ||
"esmodules" | ||
] | ||
} | ||
} ); |
@@ -22,3 +22,3 @@ // Support jQuery slim which excludes the ajax module | ||
assert.ok( true, "ajax complete" ); | ||
} )[ "catch" ]( jQuery.noop ); | ||
} ).catch( jQuery.noop ); | ||
} ).then( function() { | ||
@@ -48,3 +48,3 @@ done(); | ||
dataType: "json" | ||
} )[ "catch" ]( jQuery.noop ); | ||
} ).catch( jQuery.noop ); | ||
} | ||
@@ -61,3 +61,3 @@ ); | ||
dataType: "json" | ||
} )[ "catch" ]( jQuery.noop ); | ||
} ).catch( jQuery.noop ); | ||
} | ||
@@ -75,3 +75,3 @@ ); | ||
dataType: "json" | ||
} )[ "catch" ]( jQuery.noop ); | ||
} ).catch( jQuery.noop ); | ||
} | ||
@@ -88,3 +88,3 @@ ); | ||
dataType: "jsonp" | ||
} )[ "catch" ]( jQuery.noop ); | ||
} ).catch( jQuery.noop ); | ||
} | ||
@@ -102,3 +102,3 @@ ); | ||
dataType: "jsonp" | ||
} )[ "catch" ]( jQuery.noop ); | ||
} ).catch( jQuery.noop ); | ||
} | ||
@@ -105,0 +105,0 @@ ); |
@@ -13,3 +13,5 @@ // Support jQuery slim which excludes the effects module | ||
jQuery.easing.testOld = function( p, n, firstNum, diff ) { | ||
// Keep the unused arguments. | ||
// The number is important for the test. | ||
jQuery.easing.testOld = function( _p, _n, _firstNum, _diff ) { | ||
assert.ok( false, "should not have been called" ); | ||
@@ -16,0 +18,0 @@ }; |
@@ -155,3 +155,3 @@ | ||
TestManager.runIframeTest( "jQuery.event.props.concat", "event-props-concat.html", | ||
function( assert, jQuery, window, document, log, props ) { | ||
function( assert, jQuery, _window, _document, _log, props ) { | ||
assert.expect( 3 ); | ||
@@ -187,3 +187,3 @@ | ||
TestManager.runIframeTest( "Load within a ready handler", "event-lateload.html", | ||
function( assert, jQuery, window, document, log ) { | ||
function( assert, jQuery ) { | ||
assert.expect( 2 ); | ||
@@ -190,0 +190,0 @@ |
@@ -44,5 +44,7 @@ "use strict"; | ||
QUnit.test( "jQuery.UNSAFE_restoreLegacyHtmlPrefilter (deprecated)", function( assert ) { | ||
assert.expect( 5 ); | ||
assert.expect( 7 ); | ||
jQuery.UNSAFE_restoreLegacyHtmlPrefilter(); | ||
expectWarning( assert, "jQuery.UNSAFE_restoreLegacyHtmlPrefilter()", 1, function() { | ||
jQuery.UNSAFE_restoreLegacyHtmlPrefilter(); | ||
} ); | ||
@@ -59,4 +61,5 @@ var warns = jQuery.migrateWarnings, | ||
assert.equal( warns.length, 1, "Proper warning length" ); | ||
assert.ok( warns[ 0 ].indexOf( "HTML tags" ) >= 0, warns[ 0 ] ); | ||
assert.equal( warns.length, 2, "Proper warning length" ); | ||
assert.ok( warns[ 0 ].indexOf( "jQuery.UNSAFE_restoreLegacyHtmlPrefilter" ) >= 0, warns[ 0 ] ); | ||
assert.ok( warns[ 1 ].indexOf( "HTML tags" ) >= 0, warns[ 1 ] ); | ||
} ); |
@@ -63,4 +63,4 @@ # jQuery Migrate Plugin - Warning Messages | ||
### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.load() is deprecated | ||
### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.unload() is deprecated | ||
### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.load( [ eventData ], handler ) is deprecated and removed | ||
### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.unload() is deprecated and removed | ||
@@ -67,0 +67,0 @@ **Cause:** The `.load()` and `.unload()` event methods attach a "load" and "unload" event, respectively, to an element. They were deprecated in 1.9 and removed in 3.0 to reduce confusion with the AJAX-related `.load()` method that loads HTML fragments and which has not been deprecated. Note that these two methods are used almost exclusively with a jQuery collection consisting of only the `window` element. Also note that attaching an "unload" or "beforeunload" event on a window via any means can impact performance on some browsers because it disables the document cache (bfcache). For that reason we strongly advise against it. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 7 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
21
-16%102
15.91%14151
14.54%Yes
NaN557357
-6.24%113
-5.83%15
400%