| import { plugins } from '@citation-js/core'; | |
| import * as id from './id.js'; | |
| import * as api from './api.js'; | |
| import * as json from './json.js'; | |
| import * as type from './type.js'; | |
| const ref = '@doi'; | |
| const parsers = { | |
| id, | |
| api, | |
| json, | |
| type | |
| }; | |
| const formats = { | |
| '@doi/api': { | |
| parse: api.parse, | |
| parseAsync: api.parseAsync, | |
| parseType: { | |
| dataType: 'String', | |
| predicate: /^\s*(https?:\/\/(?:dx\.)?doi\.org\/(10.\d{4,9}\/[-._;()/:A-Z0-9[\]<>]+))\s*$/i, | |
| extends: '@else/url' | |
| } | |
| }, | |
| '@doi/short-url': { | |
| parse: function (url) { | |
| return url.replace(/^(\s*)/, '$1https://'); | |
| }, | |
| parseType: { | |
| dataType: 'String', | |
| predicate: /^\s*((?:dx\.)?doi\.org\/(10.\d{4,9}\/[-._;()/:A-Z0-9[\]<>]+))\s*$/i | |
| } | |
| }, | |
| '@doi/id': { | |
| parse: id.parse, | |
| parseType: { | |
| dataType: 'String', | |
| predicate: /^\s*(10.\d{4,9}\/[-._;()/:A-Z0-9[\]<>]+)\s*$/i | |
| } | |
| }, | |
| '@doi/list+text': { | |
| parse: id.parse, | |
| parseType: { | |
| dataType: 'String', | |
| tokenList: /^10.\d{4,9}\/[-._;()/:A-Z0-9[\]<>]+$/i | |
| } | |
| }, | |
| '@doi/list+object': { | |
| parse: id.parse, | |
| parseType: { | |
| dataType: 'Array', | |
| elementConstraint: '@doi/id' | |
| } | |
| }, | |
| '@doi/type': { | |
| parse: type.parse | |
| } | |
| }; | |
| plugins.add(ref, { | |
| input: formats | |
| }); | |
| export { ref, parsers, formats }; |
Xet Storage Details
- Size:
- 1.32 kB
- Xet hash:
- 90df295090ae0f556fa6e2d6533bcc82d1fff7c7ee9b7e13dda8943d2b97c702
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.