Skip to content

Commit

Permalink
[input:type] Use extends option in input modules
Browse files Browse the repository at this point in the history
Use the new extends options in input modules, so
that @wikidata/url, @wikidata/api and @doi/api
are now subtypes of @else/url, as they are.

See d2d68a2
See d55ed0c
Fixes #104
  • Loading branch information
larsgw committed Apr 23, 2018
1 parent d55ed0c commit a156afe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/parse/modules/doi/index.js
Expand Up @@ -12,7 +12,8 @@ export const parsers = {id, api, json, type}
export const types = {
'@doi/api': {
dataType: 'String',
predicate: /^\s*(https?:\/\/(?:dx\.)?doi\.org\/(10.\d{4,9}\/[-._;()/:A-Z0-9]+))\s*$/i
predicate: /^\s*(https?:\/\/(?:dx\.)?doi\.org\/(10.\d{4,9}\/[-._;()/:A-Z0-9]+))\s*$/i,
extends: '@else/url'
},
'@doi/id': {
dataType: 'String',
Expand Down
6 changes: 4 additions & 2 deletions src/parse/modules/wikidata/index.js
Expand Up @@ -22,11 +22,13 @@ export const types = {
},
'@wikidata/api': {
dataType: 'String',
predicate: /^(https?:\/\/(?:www\.)?wikidata.org\/w\/api\.php(?:\?.*)?)$/
predicate: /^(https?:\/\/(?:www\.)?wikidata.org\/w\/api\.php(?:\?.*)?)$/,
extends: '@else/url'
},
'@wikidata/url': {
dataType: 'String',
predicate: /\/(Q\d+)(?:[#?/]|\s*$)/
predicate: /\/(Q\d+)(?:[#?/]|\s*$)/,
extends: '@else/url'
},
'@wikidata/array': {
dataType: 'Array',
Expand Down

0 comments on commit a156afe

Please sign in to comment.