質問編集履歴

1

修正

2022/06/24 03:45

投稿

noc
noc

スコア73

test CHANGED
File without changes
test CHANGED
@@ -6,11 +6,12 @@
6
6
  [key: string]: string
7
7
  }
8
8
  }
9
- function isHolder(target: any): is Holder{
9
+ function isHolder(target: any): target is Holder{
10
10
  return (
11
11
  typeof target == 'object' &&
12
12
  'something' in target &&
13
+ typeof target.something == 'object'
13
- typeof target.something == 'object' // something の中身が [key:string]: string であることを確認する方法がわからない
14
+ // something の中身が [key:string]: string であることを確認する方法がわからない
14
15
  )
15
16
  }
16
17
  ```