Deprecated: Remove jQuery.trim

The API has been deprecated in 3.5.0 so it can be removed in 4.0.0.

Ref gh-4461
Closes gh-4695
This commit is contained in:
Michał Gołębiowski-Owczarek 2020-05-18 23:20:38 +02:00 committed by GitHub
parent bfb6897c55
commit 0b676ae12d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 28 deletions

View File

@ -1,6 +1,5 @@
import jQuery from "./core.js"; import jQuery from "./core.js";
import slice from "./var/slice.js"; import slice from "./var/slice.js";
import trim from "./var/trim.js";
import "./deprecated/ajax-event-alias.js"; import "./deprecated/ajax-event-alias.js";
import "./deprecated/event.js"; import "./deprecated/event.js";
@ -43,7 +42,3 @@ jQuery.holdReady = function( hold ) {
jQuery.ready( true ); jQuery.ready( true );
} }
}; };
jQuery.trim = function( text ) {
return text == null ? "" : trim.call( text );
};

View File

@ -1 +0,0 @@
export default "".trim;

View File

@ -199,25 +199,3 @@ QUnit[ jQuery.proxy ? "test" : "skip" ]( "jQuery.proxy", function( assert ) {
cb = jQuery.proxy( fn, null, "arg1", "arg2" ); cb = jQuery.proxy( fn, null, "arg1", "arg2" );
cb.call( thisObject, "arg3" ); cb.call( thisObject, "arg3" );
} ); } );
QUnit[ jQuery.trim ? "test" : "skip" ]( "trim", function( assert ) {
assert.expect( 13 );
var nbsp = String.fromCharCode( 160 );
assert.equal( jQuery.trim( "hello " ), "hello", "trailing space" );
assert.equal( jQuery.trim( " hello" ), "hello", "leading space" );
assert.equal( jQuery.trim( " hello " ), "hello", "space on both sides" );
assert.equal( jQuery.trim( " " + nbsp + "hello " + nbsp + " " ), "hello", " " );
assert.equal( jQuery.trim(), "", "Nothing in." );
assert.equal( jQuery.trim( undefined ), "", "Undefined" );
assert.equal( jQuery.trim( null ), "", "Null" );
assert.equal( jQuery.trim( 5 ), "5", "Number" );
assert.equal( jQuery.trim( false ), "false", "Boolean" );
assert.equal( jQuery.trim( " " ), "", "space should be trimmed" );
assert.equal( jQuery.trim( "ipad\xA0" ), "ipad", "nbsp should be trimmed" );
assert.equal( jQuery.trim( "\uFEFF" ), "", "zwsp should be trimmed" );
assert.equal( jQuery.trim( "\uFEFF \xA0! | \uFEFF" ), "! |", "leading/trailing should be trimmed" );
} );