File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ const os = require('os')
5
5
const linux = require ( './linux' )
6
6
const noop = require ( './noop' )
7
7
8
+ const has = ( obj , k ) => Object . prototype . hasOwnProperty . call ( obj , k )
9
+
8
10
const types = {
9
11
linux,
10
12
darwin : linux ,
@@ -20,7 +22,7 @@ const getDefaultType = () => {
20
22
module . exports = ( type ) => {
21
23
const typeIsNotNil = type != null
22
24
const typeIsCustomObject = typeIsNotNil && typeof type === 'object'
23
- const typeIsNotSupported = typeIsNotNil && ! types . hasOwnProperty ( type )
25
+ const typeIsNotSupported = typeIsNotNil && ! has ( types , type )
24
26
25
27
if ( typeIsCustomObject ) return type
26
28
Original file line number Diff line number Diff line change @@ -60,10 +60,12 @@ const defaultType = () => {
60
60
if ( commandExists ( 'pkg' ) ) return 'pkgng'
61
61
}
62
62
63
+ const has = ( obj , k ) => Object . prototype . hasOwnProperty . call ( obj , k )
64
+
63
65
module . exports = ( type ) => {
64
66
const typeIsNotNil = type != null
65
67
const typeIsCustomFunction = typeIsNotNil && typeof type === 'function'
66
- const typeIsNotSupported = typeIsNotNil && ! types . hasOwnProperty ( type )
68
+ const typeIsNotSupported = typeIsNotNil && ! has ( types , type )
67
69
68
70
if ( typeIsCustomFunction ) return type
69
71
You can’t perform that action at this time.
0 commit comments