驗證台灣電話號碼格式:行動 (09xx) / 市話 (0Xxxx) / 0800 / +886。 含或不含分隔符 (- 空白) 都可。回傳 type 與 area_code。
參數
| 參數 | 型別 | 說明 |
|---|---|---|
| phone * | string | — |
原始 JSON schema
{
"properties": {
"phone": {
"title": "Phone",
"type": "string"
}
},
"required": [
"phone"
],
"title": "validate_phoneArguments",
"type": "object",
"additionalProperties": false
}呼叫方式
起手式——參數見上表
tw_validate_phone({ phone: "…" })