GASでスプレッドシートから値を読むときに getValue とか getValues とか使うけど、 @types/google-apps-script の定義だと戻り値の型が any になっていて扱いにくい。 公式のドキュメントには戻り値の型について The value may be of type Number, Boolean, Date, or String depending on the value of the cell. と書いてあるので、型がこの4つのどれかになってるかどうか判定する関数を用意するといい感じになる。 type TypeMap = { string: stri…