LoginSignup
0
0

More than 1 year has passed since last update.

typescriptに正規表現の型をつける方法

Posted at

これでできる

type StartDate =`${number}${number}${number}${number}-${number}${number}-${number}${number}`

let startDate: StartDate = "2021-9-19" -> error
let startDate: StartDate = "2021-09-19" -> OK
参照

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0