-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathis-tsconfig-host.mts
More file actions
33 lines (30 loc) · 834 Bytes
/
is-tsconfig-host.mts
File metadata and controls
33 lines (30 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* @file isTsconfigHost
* @module tsconfig-utils/lib/isTsconfigHost
*/
import type { Tsconfig } from '@flex-development/tsconfig-types'
import type { TsconfigHost } from '@flex-development/tsconfig-utils'
/**
* Check if `value` is an object with a {@linkcode Tsconfig}.
*
* @see {@linkcode TsconfigHost}
*
* @this {void}
*
* @param {unknown} value
* The value to check
* @return {value is TsconfigHost}
* `true` if `value` is tsconfig host object, `false` otherwise
*/
function isTsconfigHost(this: void, value: unknown): value is TsconfigHost {
return (
typeof value === 'object' &&
value !== null &&
!Array.isArray(value) &&
'tsconfig' in value &&
typeof value.tsconfig === 'object' &&
!Array.isArray(value.tsconfig) &&
value.tsconfig !== null
)
}
export default isTsconfigHost