reffy 10.0.0 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reffy",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.1",
|
|
4
4
|
"description": "W3C/WHATWG spec dependencies exploration companion. Features a short set of tools to study spec references as well as WebIDL term definitions and references found in W3C specifications.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
* Post-processing module that annotates links extracts with the spec
|
|
3
3
|
shortname they link to
|
|
4
4
|
*/
|
|
5
|
-
const fs = require('fs');
|
|
6
|
-
const path = require('path');
|
|
7
5
|
|
|
8
6
|
function canonicalizeUrl(url) {
|
|
9
7
|
return url.replace(/^http:/, 'https:')
|
|
@@ -23,14 +21,13 @@ const needsSaving = {};
|
|
|
23
21
|
module.exports = {
|
|
24
22
|
dependsOn: ['links'],
|
|
25
23
|
input: 'spec',
|
|
26
|
-
property: 'links',
|
|
27
24
|
|
|
28
25
|
run: function(spec, {speclist}) {
|
|
29
26
|
if (!speclist || !speclist.length) {
|
|
30
27
|
console.error("No spec list passed as input, cannot annotate links in post-processing");
|
|
31
28
|
return spec;
|
|
32
29
|
}
|
|
33
|
-
for (let link
|
|
30
|
+
for (let link in (spec.links || {})) {
|
|
34
31
|
// Annotate with the spec to which the page belong if we can find one
|
|
35
32
|
const specUrl = canonicalizeUrl(link);
|
|
36
33
|
let matchingSpec = speclist.find(s => s?.release?.url === specUrl || s?.nightly?.url === specUrl || (s?.series?.currentSpecification === s?.shortname && (s?.series?.nightlyUrl === specUrl || s?.series?.releaseUrl === specUrl)) || s?.nightly?.pages?.includes(specUrl) || s?.release?.pages?.includes(specUrl));
|