@iebh/reflib 2.4.5 → 2.4.7

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.
Files changed (2) hide show
  1. package/lib/getRefDoi.js +4 -3
  2. package/package.json +1 -1
package/lib/getRefDoi.js CHANGED
@@ -1,7 +1,8 @@
1
+ // @returns {Object} The modified ref object with the updated DOI
1
2
  /**
2
3
  * Identify DOI in the format(eg: 'https://dx.doi.org/10.1186/s40504-020-00106-2'), extract DOI number only(eg:'10.1186/s40504-020-00106-2')and return the ref object
3
4
  * @param {Object} ref The input object to identify and change DOI format
4
- * @returns {Object} The modified ref object with the updated DOI
5
+ *@returns {string|null} The modified DOI or null if no DOI is available
5
6
  */
6
7
  export function getRefDoi(ref) {
7
8
  if (ref.doi) {
@@ -9,7 +10,7 @@ export function getRefDoi(ref) {
9
10
  if (ref.doi.startsWith(doiPrefix)) {
10
11
  ref.doi = ref.doi.slice(doiPrefix.length);
11
12
  }
12
- return ref;
13
+ return ref.doi;
13
14
  }
14
- return ref;
15
+ return null;
15
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iebh/reflib",
3
- "version": "2.4.5",
3
+ "version": "2.4.7",
4
4
  "description": "Reference / Citation reference library utilities",
5
5
  "scripts": {
6
6
  "lint": "eslint .",