Index: trunk/extensions/UploadWizard/resources/mw.Utilities.js |
— | — | @@ -1,24 +1,22 @@ |
2 | | -// dependencies: mw |
| 2 | +( function() { |
3 | 3 | |
4 | | -( function( mw ) { |
5 | | - |
6 | 4 | /** |
7 | 5 | * Check if a value is null, undefined, or the empty string. |
8 | 6 | * |
9 | | - * @param {object} object Object to be checked |
| 7 | + * @param {mixed} v Variable to be checked |
10 | 8 | * @return {boolean} |
11 | 9 | */ |
12 | | - mw.isEmpty = function( o ) { |
13 | | - return ! mw.isDefined( o ) || o === null || ( typeof o === 'string' && o === '' ); |
| 10 | + mw.isEmpty = function( v ) { |
| 11 | + return ! mw.isDefined( v ) || v === null || v === ''; |
14 | 12 | }; |
15 | 13 | |
16 | 14 | /** |
17 | 15 | * Check if something is defined |
18 | | - * @param {object} |
| 16 | + * @param {mixed} v |
19 | 17 | * @return {boolean} |
20 | 18 | */ |
21 | | - mw.isDefined = function( o ) { |
22 | | - return typeof o !== 'undefined'; |
| 19 | + mw.isDefined = function( v ) { |
| 20 | + return typeof v !== 'undefined'; |
23 | 21 | }; |
24 | 22 | |
25 | 23 | |
— | — | @@ -32,4 +30,4 @@ |
33 | 31 | }; |
34 | 32 | |
35 | 33 | |
36 | | -} )( window.mediaWiki ); |
| 34 | +} )(); |