jskos-tools
Advanced tools
Comparing version 1.0.18 to 1.0.19
@@ -799,8 +799,10 @@ const _ = require("./utils") | ||
* - `language`: preferred language | ||
* - will also be passed through to `getLanguages` | ||
*/ | ||
function languageMapContent(item, prop) { | ||
function languageMapContent(item, prop, { language } = {}) { | ||
let languageMap = (item && prop) ? item[prop] : item | ||
if (languageMap) { | ||
const language = languagePreference.selectLanguage(languageMap) | ||
if (languageMap[language]) { | ||
return languageMap[language] | ||
} | ||
language = languagePreference.selectLanguage(languageMap) | ||
if (language) { | ||
@@ -825,3 +827,3 @@ return languageMap[language] | ||
return _.get(item, `prefLabel.${options.language}`) | ||
|| languageMapContent(item, "prefLabel") | ||
|| languageMapContent(item, "prefLabel", options) | ||
|| ((fallbackToUri && item && item.uri) ? item.uri : "") | ||
@@ -840,3 +842,3 @@ } | ||
let content = _.get(item, `definition.${options.language}`) | ||
|| languageMapContent(item, "definition") | ||
|| languageMapContent(item, "definition", options) | ||
|| [] | ||
@@ -843,0 +845,0 @@ // Make sure an array is returned |
{ | ||
"name": "jskos-tools", | ||
"version": "1.0.18", | ||
"version": "1.0.19", | ||
"description": "Tools for working with the JSKOS data format.", | ||
@@ -49,7 +49,7 @@ "homepage": "https://github.com/gbv/jskos-tools", | ||
"@babel/core": "^7.15.5", | ||
"@babel/preset-env": "^7.15.4", | ||
"@babel/preset-env": "^7.15.6", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-commonjs": "^20.0.0", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^13.0.4", | ||
"@rollup/plugin-node-resolve": "^13.0.5", | ||
"axios": "^0.21.4", | ||
@@ -59,3 +59,3 @@ "eslint": "^7.32.0", | ||
"foodoc": "0.0.9", | ||
"glob": "^7.1.7", | ||
"glob": "^7.2.0", | ||
"jsdoc": "^3.6.7", | ||
@@ -67,3 +67,3 @@ "lint-staged": "^11.1.2", | ||
"pre-commit": "^1.2.2", | ||
"rollup": "^2.56.3", | ||
"rollup": "^2.57.0", | ||
"rollup-plugin-license": "^2.5.0", | ||
@@ -70,0 +70,0 @@ "wikidata-sdk": "^7.13.0" |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143231
3727