浏览代码

refactor: 重命名 childs => children

modood 7 年之前
父节点
当前提交
61feb39c05
共有 7 个文件被更改,包括 15 次插入15 次删除
  1. 0 0
      dist/pc-code.json
  2. 0 0
      dist/pc.json
  3. 0 0
      dist/pca-code.json
  4. 0 0
      dist/pca.json
  5. 0 0
      dist/pcas-code.json
  6. 0 0
      dist/pcas.json
  7. 15 15
      test/json.js

文件差异内容过多而无法显示
+ 0 - 0
dist/pc-code.json


文件差异内容过多而无法显示
+ 0 - 0
dist/pc.json


文件差异内容过多而无法显示
+ 0 - 0
dist/pca-code.json


文件差异内容过多而无法显示
+ 0 - 0
dist/pca.json


文件差异内容过多而无法显示
+ 0 - 0
dist/pcas-code.json


文件差异内容过多而无法显示
+ 0 - 0
dist/pcas.json


+ 15 - 15
test/json.js

@@ -68,11 +68,11 @@ describe('中华人民共和国行政区划:', () => {
     for (let i = 0; i < pcC.length; i++) {
       const p = pcC[i]
       if (['台湾省', '香港特别行政区', '澳门特别行政区'].indexOf(p.name) === -1 &&
-        p.childs.length === 0) throw new Error(`数据:pc-code.json,${p.name}的城市列表为空!`)
+        p.children.length === 0) throw new Error(`数据:pc-code.json,${p.name}的城市列表为空!`)
 
       if (p.code === t[0].code && p.name === t[0].name) {
-        for (let j = 0; j < p.childs.length; j++) {
-          const c = p.childs[j]
+        for (let j = 0; j < p.children.length; j++) {
+          const c = p.children[j]
           if (c.code === t[1].code && c.name === t[1].name) {
             ok = true
             break loop
@@ -109,12 +109,12 @@ describe('中华人民共和国行政区划:', () => {
       const p = pcaC[i]
 
       if (p.code === t[0].code && p.name === t[0].name) {
-        for (let j = 0; j < p.childs.length; j++) {
-          const c = p.childs[j]
-          if (c.childs.length === 0) throw new Error(`数据:pca-code.json,${p.name}${c.name}的区县列表为空!`)
+        for (let j = 0; j < p.children.length; j++) {
+          const c = p.children[j]
+          if (c.children.length === 0) throw new Error(`数据:pca-code.json,${p.name}${c.name}的区县列表为空!`)
           if (c.code === t[1].code && c.name === t[1].name) {
-            for (let k = 0; k < c.childs.length; k++) {
-              const a = c.childs[k]
+            for (let k = 0; k < c.children.length; k++) {
+              const a = c.children[k]
               if (a.code === t[2].code && a.name === t[2].name) {
                 ok = true
                 break loop
@@ -159,15 +159,15 @@ describe('中华人民共和国行政区划:', () => {
       const p = pcasC[i]
 
       if (p.code === t[0].code && p.name === t[0].name) {
-        for (let j = 0; j < p.childs.length; j++) {
-          const c = p.childs[j]
+        for (let j = 0; j < p.children.length; j++) {
+          const c = p.children[j]
           if (c.code === t[1].code && c.name === t[1].name) {
-            for (let k = 0; k < c.childs.length; k++) {
-              const a = c.childs[k]
-              if (a.childs.length === 0) throw new Error(`数据:pcas-code.json,${p.name}${c.name}${a.name}的乡镇列表为空!`)
+            for (let k = 0; k < c.children.length; k++) {
+              const a = c.children[k]
+              if (a.children.length === 0) throw new Error(`数据:pcas-code.json,${p.name}${c.name}${a.name}的乡镇列表为空!`)
               if (a.code === t[2].code && a.name === t[2].name) {
-                for (let l = 0; l < a.childs.length; l++) {
-                  const s = a.childs[l]
+                for (let l = 0; l < a.children.length; l++) {
+                  const s = a.children[l]
                   if (s.code === t[3].code && s.name === t[3].name) {
                     ok = true
                     break loop

部分文件因为文件数量过多而无法显示