File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ const os = require('os')
55const linux = require ( './linux' )
66const noop = require ( './noop' )
77
8+ const has = ( obj , k ) => Object . prototype . hasOwnProperty . call ( obj , k )
9+
810const types = {
911 linux,
1012 darwin : linux ,
@@ -20,7 +22,7 @@ const getDefaultType = () => {
2022module . exports = ( type ) => {
2123 const typeIsNotNil = type != null
2224 const typeIsCustomObject = typeIsNotNil && typeof type === 'object'
23- const typeIsNotSupported = typeIsNotNil && ! types . hasOwnProperty ( type )
25+ const typeIsNotSupported = typeIsNotNil && ! has ( types , type )
2426
2527 if ( typeIsCustomObject ) return type
2628
Original file line number Diff line number Diff line change @@ -60,10 +60,12 @@ const defaultType = () => {
6060 if ( commandExists ( 'pkg' ) ) return 'pkgng'
6161}
6262
63+ const has = ( obj , k ) => Object . prototype . hasOwnProperty . call ( obj , k )
64+
6365module . exports = ( type ) => {
6466 const typeIsNotNil = type != null
6567 const typeIsCustomFunction = typeIsNotNil && typeof type === 'function'
66- const typeIsNotSupported = typeIsNotNil && ! types . hasOwnProperty ( type )
68+ const typeIsNotSupported = typeIsNotNil && ! has ( types , type )
6769
6870 if ( typeIsCustomFunction ) return type
6971
You can’t perform that action at this time.
0 commit comments