ãã¡ãã¯ã¨ã ã¹ãªã¼ Advent Calendar 2024 9æ¥ç®ã®è¨äºã§ãã
ããã«ã¡ã¯ã4æã«æ°åã§ãã¸ã¹ããã¼ã ã«ã¸ã§ã¤ã³ããã½ããã¦ã§ã¢ã¨ã³ã¸ãã¢ã®æ± 奥ã§ããå
æ¥äº¬é½ã§éå¬ãããTSKaigi Kansai 2024ã§ã¯ã³ã¢ã¹ã¿ããã¨ãã¦æ´»åãã¦ãã¾ããã
ç§ã®æå±ãããã¸ã¹ããã¼ã ã§ã¯ããã³ãã¨ã³ãã«TypeScriptãæ¡ç¨ããã¦ãããåã®æè»æ§ãæ´»ãããå®è£
ããã³ãã³è¦ããã¾ããããã§ä»åã¯ãTypeScriptã®åã¨ãã£ã¨ä»²è¯ããªãã¹ããåã¬ãã«ã§ååæ¼ç®ã®ãã¼ãµã¼ããå®è¡å¨ã¾ã§å®è£
ãã話ããéããã¾ãã
ä»åä½æããããã°ã©ã ãå©ç¨ããã¨ã次ã®ãããªè¨ç®ãåã¬ãã«ã§è¡ããã¨ãã§ãã¾ãã
type Result1 = Eval<"12*3+5*7+(2+45)*2-4">
type Result2 = Eval<"len('@m3_engineering')">
type Result3 = Eval<"word+'ã®æåæ°ã¯'+cast(len(word),'str')+'æåã§ã'", { word: "Alice in Wonderland" }>
type Result4 = Eval<"len('@m3_engineering')<=2*2*2*2">
å®ã¯ååæ¼ç®ã ãã§ãªããæ¯è¼æ¼ç®åãåªå
é ä½ãæå®ããæ¬å¼§ããµãã¼ããã¦ãã¾ããã»ãã«ããæååããã¼ã«å¤ãæ±ããããçµã¿è¾¼ã¿é¢æ°ï¼lenãcastï¼ããµãã¼ããã¦ããããè©ä¾¡æã«å¤æ°ã®å¤ãå¤é¨ããæå®ã§ãããããæ©è½ãåãã¦ãã¾ãããªããå²ãç®ã¯èªç¶æ°ã®ç¯å²ããå¤ãã¦ãã¾ããããµãã¼ãå¤ã¨ãã¾ããã
ç¶ããèªã