mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
15 lines
553 B
Plaintext
15 lines
553 B
Plaintext
firstMatchRegExpMatchArray.ts(5,11): error TS2322: Type 'string | undefined' is not assignable to type 'string'.
|
|
Type 'undefined' is not assignable to type 'string'.
|
|
|
|
|
|
==== firstMatchRegExpMatchArray.ts (1 errors) ====
|
|
const match = ''.match(/ /)
|
|
|
|
if (match !== null) {
|
|
const foo: string = match[0]
|
|
const bar: string = match[1]
|
|
~~~
|
|
!!! error TS2322: Type 'string | undefined' is not assignable to type 'string'.
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'string'.
|
|
}
|
|
|