| ; | |
| Object.defineProperty(exports, "__esModule", { | |
| value: true | |
| }); | |
| exports.parse = parseDoiApi; | |
| exports.parseAsync = parseDoiApiAsync; | |
| var _core = require("@citation-js/core"); | |
| var _json = _interopRequireDefault(require("./json.js")); | |
| function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } | |
| const apiOptions = { | |
| checkContentType: true, | |
| headers: { | |
| Accept: 'application/vnd.citationstyles.csl+json' | |
| } | |
| }; | |
| function processApiResponse(response) { | |
| if (response === '[]') { | |
| return {}; | |
| } | |
| return (0, _json.default)(JSON.parse(response)); | |
| } | |
| function parseDoiApiAsync(data) { | |
| const response = [].concat(data).map(url => _core.util.fetchFileAsync(url, apiOptions).then(processApiResponse)); | |
| return Promise.all(response); | |
| } | |
| function parseDoiApi(data) { | |
| const response = [].concat(data).map(url => _core.util.fetchFile(url, apiOptions)).map(processApiResponse); | |
| return response; | |
| } |
Xet Storage Details
- Size:
- 937 Bytes
- Xet hash:
- 58ad2c00e7dc514ac05a7a92834a4be18958a660d618e988c2e4f1aad78a3c6c
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.