cocoda-sdk 3.3.1 → 3.3.3
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.
|
@@ -60,7 +60,21 @@ class LabelSearchSuggestionProvider extends BaseProvider {
|
|
|
60
60
|
}
|
|
61
61
|
const regexResult = /^[\s\wäüöÄÜÖß]*\w/.exec(label);
|
|
62
62
|
label = regexResult ? regexResult[0] : label;
|
|
63
|
-
|
|
63
|
+
let results = await this._getResults({ ...config, label, targetScheme, limit });
|
|
64
|
+
if (!results.length && concept.broader?.length) {
|
|
65
|
+
for (const broader of concept.broader) {
|
|
66
|
+
const label2 = jskos.prefLabel(broader, {
|
|
67
|
+
fallbackToUri: false,
|
|
68
|
+
language
|
|
69
|
+
});
|
|
70
|
+
if (!label2)
|
|
71
|
+
continue;
|
|
72
|
+
results = await this._getResults({ ...config, label: label2, targetScheme, limit });
|
|
73
|
+
if (results.length) {
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
64
78
|
let mappings = results.map((result) => ({
|
|
65
79
|
fromScheme: sourceScheme,
|
|
66
80
|
from: { memberSet: [concept] },
|
|
@@ -87,7 +101,7 @@ class LabelSearchSuggestionProvider extends BaseProvider {
|
|
|
87
101
|
if (!registry || registry.has.search === false) {
|
|
88
102
|
return [];
|
|
89
103
|
}
|
|
90
|
-
let url = this._jskos.overrides.find((o) => jskos.compare(o, targetScheme))?.search;
|
|
104
|
+
let url = (this._jskos.overrides || []).find((o) => jskos.compare(o, targetScheme))?.search;
|
|
91
105
|
const data = await registry.search({
|
|
92
106
|
...config,
|
|
93
107
|
url,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cocoda-sdk",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.3",
|
|
4
4
|
"description": "SDK for Cocoda",
|
|
5
5
|
"main": "dist/cjs/index.cjs",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -56,20 +56,20 @@
|
|
|
56
56
|
"better-docs": "^2.7.2",
|
|
57
57
|
"esbuild": "~0.14.54",
|
|
58
58
|
"esbuild-plugin-ifdef": "^1.0.1",
|
|
59
|
-
"eslint": "^8.
|
|
60
|
-
"eslint-config-gbv": "^1.0.
|
|
59
|
+
"eslint": "^8.31.0",
|
|
60
|
+
"eslint-config-gbv": "^1.0.4",
|
|
61
61
|
"glob": "^8.0.3",
|
|
62
62
|
"jsdoc": "^3.6.11",
|
|
63
63
|
"license-checker": "^25.0.1",
|
|
64
|
-
"lint-staged": "^
|
|
65
|
-
"mocha": "^
|
|
64
|
+
"lint-staged": "^13.1.0",
|
|
65
|
+
"mocha": "^10.2.0",
|
|
66
66
|
"mocha-eslint": "^7.0.0",
|
|
67
67
|
"pre-commit": "^1.2.2"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"axios": "~0.26.1",
|
|
71
71
|
"flexsearch": "~0.6.32",
|
|
72
|
-
"jskos-tools": "^1.0.
|
|
72
|
+
"jskos-tools": "^1.0.28",
|
|
73
73
|
"localforage": "^1.10.0",
|
|
74
74
|
"lodash": "^4.17.21",
|
|
75
75
|
"uuid": "^9.0.0"
|