You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@citation-js/plugin-doi

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@citation-js/plugin-doi - npm Package Compare versions

Comparing version

to
0.5.0-alpha.0

34

lib-mjs/api.js

@@ -1,5 +0,1 @@

function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
import parseDoiJson from './json';

@@ -14,25 +10,13 @@ import { util } from '@citation-js/core';

const fetchDoiApiAsync = function () {
var _ref = _asyncToGenerator(function* (url) {
const result = yield util.fetchFileAsync(url, apiOptions);
return result === '[]' ? {} : JSON.parse(result);
});
const fetchDoiApiAsync = async function (url) {
const result = await util.fetchFileAsync(url, apiOptions);
return result === '[]' ? {} : JSON.parse(result);
};
return function fetchDoiApiAsync(_x) {
return _ref.apply(this, arguments);
};
}();
const parseDoiApiAsync = async function (data) {
const doiJsonList = await Promise.all([].concat(data).map(fetchDoiApiAsync));
return doiJsonList.map(parseDoiJson);
};
const parseDoiApiAsync = function () {
var _ref2 = _asyncToGenerator(function* (data) {
const doiJsonList = yield Promise.all([].concat(data).map(fetchDoiApiAsync));
return doiJsonList.map(parseDoiJson);
});
return function parseDoiApiAsync(_x2) {
return _ref2.apply(this, arguments);
};
}();
const fetchDoiApi = function fetchDoiApi(url) {
const fetchDoiApi = function (url) {
const result = util.fetchFile(url, apiOptions);

@@ -39,0 +23,0 @@ return result === '[]' ? {} : JSON.parse(result);

import fetchDoiType from './type';
const parseDoiJson = function parseDoiJson(data) {
const parseDoiJson = function (data) {
const res = {

@@ -5,0 +5,0 @@ type: fetchDoiType(data.type)

@@ -14,6 +14,2 @@ "use strict";

function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
const apiOptions = {

@@ -26,27 +22,15 @@ checkContentType: true,

const fetchDoiApiAsync = function () {
var _ref = _asyncToGenerator(function* (url) {
const result = yield _core.util.fetchFileAsync(url, apiOptions);
return result === '[]' ? {} : JSON.parse(result);
});
const fetchDoiApiAsync = async function (url) {
const result = await _core.util.fetchFileAsync(url, apiOptions);
return result === '[]' ? {} : JSON.parse(result);
};
return function fetchDoiApiAsync(_x) {
return _ref.apply(this, arguments);
};
}();
const parseDoiApiAsync = async function (data) {
const doiJsonList = await Promise.all([].concat(data).map(fetchDoiApiAsync));
return doiJsonList.map(_json.default);
};
const parseDoiApiAsync = function () {
var _ref2 = _asyncToGenerator(function* (data) {
const doiJsonList = yield Promise.all([].concat(data).map(fetchDoiApiAsync));
return doiJsonList.map(_json.default);
});
return function parseDoiApiAsync(_x2) {
return _ref2.apply(this, arguments);
};
}();
exports.parseAsync = parseDoiApiAsync;
const fetchDoiApi = function fetchDoiApi(url) {
const fetchDoiApi = function (url) {
const result = _core.util.fetchFile(url, apiOptions);

@@ -53,0 +37,0 @@

@@ -18,4 +18,6 @@ "use strict";

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
const ref = '@doi';

@@ -22,0 +24,0 @@ exports.ref = ref;

@@ -12,3 +12,3 @@ "use strict";

const parseDoiJson = function parseDoiJson(data) {
const parseDoiJson = function (data) {
const res = {

@@ -15,0 +15,0 @@ type: (0, _type.default)(data.type)

{
"name": "@citation-js/plugin-doi",
"version": "0.4.9",
"version": "0.5.0-alpha.0",
"description": "Plugin for DOI input for Citation.js",

@@ -25,3 +25,3 @@ "keywords": [

"engines": {
"node": ">=6.0.0"
"node": ">=8"
},

@@ -36,3 +36,3 @@ "files": [

"devDependencies": {
"@citation-js/core": "^0.4.9"
"@citation-js/core": "^0.5.0-alpha.0"
},

@@ -42,3 +42,3 @@ "peerDependencies": {

},
"gitHead": "5e9b903060186dbd3df668e40da6cad1599c15c0"
"gitHead": "68a69847510cc948b1dae7f7d81c8fa1430a183b"
}