MCPcopy Create free account
hub / github.com/debbide/GeoFill / generateAddress

Function generateAddress

scripts/generators.js:957–963  ·  view source on GitHub ↗

* 生成地址(使用对应国家的街道名)

(country)

Source from the content-addressed store, hash-verified

955 * 生成地址(使用对应国家的街道名)
956 */
957function 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 * 选择一个城市位置(返回城市、州、邮编前缀)

Callers 4

generateAllInfoFunction · 0.85
regenerateFieldFunction · 0.85
generators.jsFile · 0.85

Calls 1

randomChoiceFunction · 0.70

Tested by

no test coverage detected