@workskills/getskill 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +7 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -408,15 +408,15 @@ async function searchSkills(keyword, options = {}) {
|
|
|
408
408
|
}
|
|
409
409
|
|
|
410
410
|
// 提取需要的字段
|
|
411
|
+
// 新 API 数据直接在根层级,不再嵌套在 repository 中
|
|
411
412
|
return result.data.map(item => {
|
|
412
|
-
const repo = item.repository || {};
|
|
413
413
|
return {
|
|
414
|
-
name:
|
|
415
|
-
full_name:
|
|
416
|
-
description:
|
|
417
|
-
html_url:
|
|
418
|
-
git_url:
|
|
419
|
-
clone_url:
|
|
414
|
+
name: item.full_name || item.name || '',
|
|
415
|
+
full_name: item.full_name || '',
|
|
416
|
+
description: item.description || '',
|
|
417
|
+
html_url: item.html_url || '',
|
|
418
|
+
git_url: item.clone_url || (item.html_url ? `${item.html_url}.git` : ''),
|
|
419
|
+
clone_url: item.clone_url || ''
|
|
420
420
|
};
|
|
421
421
|
}).filter(item => item.full_name); // 过滤掉没有 full_name 的项
|
|
422
422
|
|