1
- const debug = require ( 'debug' ) ( 'empty' )
1
+ // const debug = require('debug')('empty')
2
+
2
3
/**
3
4
* @module is
4
5
* @author sanghak,Lee <[email protected] >
@@ -21,11 +22,11 @@ const debug = require('debug')('empty')
21
22
* is.empty(1) // false
22
23
*/
23
24
const empty = ( value ) => {
24
- debug ( 'value' , value )
25
- debug ( 'typeof value' , typeof value )
26
- debug ( 'Object.keys(value).length' , value && Object . keys ( value ) . length )
27
- debug ( 'Object.getOwnPropertyNames()' , value && Object . getOwnPropertyNames ( value ) )
28
- debug ( 'value.constructor.name' , value && value . constructor && value . constructor . name )
25
+ // debug('value', value)
26
+ // debug('typeof value', typeof value)
27
+ // debug('Object.keys(value).length', value && Object.keys(value).length)
28
+ // debug('Object.getOwnPropertyNames()', value && Object.getOwnPropertyNames(value))
29
+ // debug('value.constructor.name', value && value.constructor && value.constructor.name)
29
30
30
31
if ( value === null ) return true
31
32
if ( typeof value === 'undefined' ) return true
@@ -35,7 +36,7 @@ const empty = (value) => {
35
36
36
37
if ( typeof value === 'object' && value . constructor . name === 'String' && Object . keys ( value ) . length < 1 ) return true // new String()
37
38
38
- debug ( 'isEmpty false' )
39
+ // debug('isEmpty false')
39
40
return false
40
41
}
41
42
0 commit comments