Skip to content

Commit

Permalink
第四级(乡镇街道)数据,过滤掉“办事处”后缀,例如:东华门街道办事处-->东华门街道
Browse files Browse the repository at this point in the history
  • Loading branch information
modood committed Sep 1, 2017
1 parent 4ea90d9 commit d379e68
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/address4.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/streets.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function getAddressPCAS (provinces, cities, areas, streets) {
doc[p.name][c.name][a.name] = streets.filter(function (s) {
return a.code === s.parent_code
}).map(function (s) {
return s.name
return s.name.replace('办事处', '')
})
})
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "china-division",
"version": "1.1.1",
"version": "1.1.2",
"description": "中华人民共和国行政区划:省份、城市、区县、乡镇(街道)",
"main": "index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions test/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ describe('中华人民共和国行政区划:', function () {

it('“省份、城市、区县、乡镇” 四级联动数据', function () {
assert.ok(address4['广西壮族自治区']['玉林市']['容县'].indexOf('石头镇') !== -1)
assert.ok(address4['陕西省']['汉中市']['汉台区'].indexOf('七里街道') !== -1)
assert.ok(address4['海南省']['三沙市']['南沙群岛'].indexOf('永暑岛') !== -1)

assert.ok(address4['广东省']['中山市']['中山市'].indexOf('横栏镇') !== -1)
Expand Down

0 comments on commit d379e68

Please # to comment.