Comparing version 2.0.0 to 3.0.0-6-dc-relation-should-not-be-fetched-from-274459359-39d33d99
@@ -7,2 +7,8 @@ # Changelog | ||
## [3.0.0] - 2019-08-17 | ||
### Breaking changes | ||
- `DC.relation` meta tags are no longer supported - they should not be used to identify the primary document. | ||
## [2.0.0] - 2019-07-19 | ||
@@ -9,0 +15,0 @@ |
@@ -7,3 +7,2 @@ "use strict"; | ||
'citation_doi', | ||
'dc.relation', | ||
'eprints.id_number', | ||
@@ -10,0 +9,0 @@ 'eprints.official_url', |
@@ -96,29 +96,2 @@ "use strict"; | ||
}); | ||
describe('Detecting DOIs located in dc.relation meta tags', function () { | ||
it('should not return identifiers that are not DOIs', function () { | ||
var dom = new jsdom_1.JSDOM("<!DOCTYPE html><html><head>\n <meta name=\"dc.relation\" content=\"https://osf.io/khbvy/\">\n </head><p>No DOIs here!</p></html>"); | ||
var document = dom.window.document; | ||
expect(index_1.getDois(document)).toEqual([]); | ||
}); | ||
it('should return a naked DOI', function () { | ||
var dom = new jsdom_1.JSDOM("<!DOCTYPE html><html><head>\n <meta name=\"dc.relation\" content=\"10.31219/osf.io/khbvy\">\n </head><p>Hello there</p></html>"); | ||
var document = dom.window.document; | ||
expect(index_1.getDois(document)).toEqual(['10.31219/osf.io/khbvy']); | ||
}); | ||
it('should return a DOI prefixed with `doi:`', function () { | ||
var dom = new jsdom_1.JSDOM("<!DOCTYPE html><html><head>\n <meta name=\"dc.relation\" content=\"doi:10.31219/osf.io/khbvy\">\n </head><p>Hello there</p></html>"); | ||
var document = dom.window.document; | ||
expect(index_1.getDois(document)).toEqual(['10.31219/osf.io/khbvy']); | ||
}); | ||
it('should return a DOI prefixed with `info:doi:`', function () { | ||
var dom = new jsdom_1.JSDOM("<!DOCTYPE html><html><head>\n <meta name=\"dc.relation\" content=\"info:doi:10.31219/osf.io/khbvy\">\n </head><p>Hello there</p></html>"); | ||
var document = dom.window.document; | ||
expect(index_1.getDois(document)).toEqual(['10.31219/osf.io/khbvy']); | ||
}); | ||
it('should return multiple DOIs when present', function () { | ||
var dom = new jsdom_1.JSDOM("<!DOCTYPE html><html><head>\n <meta name=\"dc.relation\" content=\"info:doi:10.31219/osf.io/khbvy\">\n <meta name=\"dc.relation\" content=\"10.1371/journal.pbio.1002456\">\n </head><p>Hello there</p></html>"); | ||
var document = dom.window.document; | ||
expect(index_1.getDois(document)).toEqual(['10.31219/osf.io/khbvy', '10.1371/journal.pbio.1002456']); | ||
}); | ||
}); | ||
describe('Detecting DOIs located in eprints.id_number meta tags', function () { | ||
@@ -125,0 +98,0 @@ it('should not return identifiers that are not DOIs', function () { |
@@ -197,60 +197,2 @@ import { JSDOM } from 'jsdom'; | ||
describe('Detecting DOIs located in dc.relation meta tags', () => { | ||
it('should not return identifiers that are not DOIs', () => { | ||
const dom = new JSDOM( | ||
`<!DOCTYPE html><html><head> | ||
<meta name="dc.relation" content="https://osf.io/khbvy/"> | ||
</head><p>No DOIs here!</p></html>` | ||
); | ||
const document = dom.window.document; | ||
expect(getDois(document)).toEqual([]); | ||
}); | ||
it('should return a naked DOI', () => { | ||
const dom = new JSDOM( | ||
`<!DOCTYPE html><html><head> | ||
<meta name="dc.relation" content="10.31219/osf.io/khbvy"> | ||
</head><p>Hello there</p></html>` | ||
); | ||
const document = dom.window.document; | ||
expect(getDois(document)).toEqual(['10.31219/osf.io/khbvy']); | ||
}); | ||
it('should return a DOI prefixed with `doi:`', () => { | ||
const dom = new JSDOM( | ||
`<!DOCTYPE html><html><head> | ||
<meta name="dc.relation" content="doi:10.31219/osf.io/khbvy"> | ||
</head><p>Hello there</p></html>` | ||
); | ||
const document = dom.window.document; | ||
expect(getDois(document)).toEqual(['10.31219/osf.io/khbvy']); | ||
}); | ||
it('should return a DOI prefixed with `info:doi:`', () => { | ||
const dom = new JSDOM( | ||
`<!DOCTYPE html><html><head> | ||
<meta name="dc.relation" content="info:doi:10.31219/osf.io/khbvy"> | ||
</head><p>Hello there</p></html>` | ||
); | ||
const document = dom.window.document; | ||
expect(getDois(document)).toEqual(['10.31219/osf.io/khbvy']); | ||
}); | ||
it('should return multiple DOIs when present', () => { | ||
const dom = new JSDOM( | ||
`<!DOCTYPE html><html><head> | ||
<meta name="dc.relation" content="info:doi:10.31219/osf.io/khbvy"> | ||
<meta name="dc.relation" content="10.1371/journal.pbio.1002456"> | ||
</head><p>Hello there</p></html>` | ||
); | ||
const document = dom.window.document; | ||
expect(getDois(document)).toEqual(['10.31219/osf.io/khbvy', '10.1371/journal.pbio.1002456']); | ||
}); | ||
}); | ||
describe('Detecting DOIs located in eprints.id_number meta tags', () => { | ||
@@ -257,0 +199,0 @@ it('should not return identifiers that are not DOIs', () => { |
@@ -6,3 +6,2 @@ import './polyfills'; | ||
'citation_doi', | ||
'dc.relation', | ||
'eprints.id_number', | ||
@@ -9,0 +8,0 @@ 'eprints.official_url', |
{ | ||
"name": "get-dois", | ||
"version": "2.0.0", | ||
"version": "3.0.0-6-dc-relation-should-not-be-fetched-from-274459359-39d33d99", | ||
"description": "Detect Digital Object Identifiers listed in the metadata of a DOM tree", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -45,3 +45,3 @@ get-dois | ||
- PRISM tags (`prism.doi`) | ||
- Dublin Core Schema markup (`dc.identifier` and/or `dc.relation`) | ||
- Dublin Core Schema markup (`dc.identifier`) | ||
@@ -48,0 +48,0 @@ If you encounter a different format that is not yet supported, please [file an issue](https://gitlab.com/Flockademic/get-dois/issues/new). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58047
18
978
1