* 生成地址(使用对应国家的街道名)
(country)
| 955 | * 生成地址(使用对应国家的街道名) |
| 956 | */ |
| 957 | function generateAddress(country) { |
| 958 | const streets = STREET_NAMES[country] || STREET_NAMES['default']; |
| 959 | const streetNum = Math.floor(Math.random() * 9999) + 1; |
| 960 | const street = randomChoice(streets); |
| 961 | const aptNum = Math.random() > 0.7 ? `, Apt ${Math.floor(Math.random() * 999) + 1}` : ''; |
| 962 | return `${streetNum} ${street}${aptNum}`; |
| 963 | } |
| 964 | |
| 965 | /** |
| 966 | * 选择一个城市位置(返回城市、州、邮编前缀) |
no test coverage detected