| ; | |
| Object.defineProperty(exports, "__esModule", { | |
| value: true | |
| }); | |
| exports.ref = exports.parsers = exports.formats = void 0; | |
| var _core = require("@citation-js/core"); | |
| var id = _interopRequireWildcard(require("./id.js")); | |
| var entity = _interopRequireWildcard(require("./entity.js")); | |
| var prop = _interopRequireWildcard(require("./prop.js")); | |
| var url = _interopRequireWildcard(require("./url.js")); | |
| var api = _interopRequireWildcard(require("./api.js")); | |
| var _config = _interopRequireDefault(require("./config.json")); | |
| function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } | |
| function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | |
| function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | |
| const ref = exports.ref = '@wikidata'; | |
| const parsers = exports.parsers = { | |
| id, | |
| entity, | |
| prop, | |
| url, | |
| api | |
| }; | |
| const formats = exports.formats = { | |
| '@wikidata/id': { | |
| parse: id.parse, | |
| parseType: { | |
| dataType: 'String', | |
| predicate: /^Q\d+$/ | |
| } | |
| }, | |
| '@wikidata/list+text': { | |
| parse(data) { | |
| return data.trim().split(/(?:[\s,]\s*)/g); | |
| }, | |
| parseType: { | |
| dataType: 'String', | |
| predicate: /^\s*((?:Q\d+(?:[\s,]\s*))*Q\d+)\s*$/ | |
| } | |
| }, | |
| '@wikidata/api': { | |
| parse: api.parse, | |
| parseAsync: api.parseAsync, | |
| parseType: { | |
| dataType: 'String', | |
| predicate: /^(https?:\/\/(?:www\.)?wikidata.org\/w\/api\.php(?:\?.*)?)$/, | |
| extends: '@else/url' | |
| } | |
| }, | |
| '@wikidata/array+api': { | |
| parse: api.parse, | |
| parseAsync: api.parseAsync, | |
| parseType: { | |
| dataType: 'Array', | |
| elementConstraint: '@wikidata/api' | |
| } | |
| }, | |
| '@wikidata/url': { | |
| parse: url.parse, | |
| parseType: { | |
| dataType: 'String', | |
| predicate: /\/(Q\d+)(?:[#?/]|\s*$)/, | |
| extends: '@else/url' | |
| } | |
| }, | |
| '@wikidata/list+object': { | |
| parse: id.parse, | |
| parseType: { | |
| dataType: 'Array', | |
| elementConstraint: '@wikidata/id' | |
| } | |
| }, | |
| '@wikidata/object': { | |
| parse: entity.parse, | |
| parseAsync: entity.parseAsync, | |
| parseType: { | |
| dataType: 'SimpleObject', | |
| propertyConstraint: { | |
| props: 'entities' | |
| } | |
| } | |
| }, | |
| '@wikidata/array+object': { | |
| parse(responses) { | |
| return responses.reduce((combined, { | |
| success, | |
| entities | |
| }) => { | |
| combined.success &= success; | |
| Object.assign(combined.entities, entities); | |
| return combined; | |
| }); | |
| }, | |
| parseType: { | |
| dataType: 'Array', | |
| elementConstraint: '@wikidata/object' | |
| }, | |
| outputs: '@wikidata/object' | |
| }, | |
| '@wikidata/prop': { | |
| parse: prop.parseProp | |
| }, | |
| '@wikidata/type': { | |
| parse: prop.parseType | |
| } | |
| }; | |
| _core.plugins.add(ref, { | |
| input: formats, | |
| config: _config.default | |
| }); |
Xet Storage Details
- Size:
- 3.4 kB
- Xet hash:
- a61cd3af14a958afe6cf35f61014c3414f80de7f0f3f541e1aa22f7e97dbb303
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.