@chrisburnell/eleventy-cache-webmentions 2.2.4 → 2.2.7

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.
@@ -1 +1 @@
1
- {"cachedAt":1761780564178,"type":"json","metadata":{}}
1
+ {"cachedAt":1764872868125,"type":"json","metadata":{}}
@@ -15,10 +15,27 @@ const sanitizeHTML = require("sanitize-html");
15
15
  * @property {AllowedHTML} allowedHTML
16
16
  * @property {Array<string>} allowlist
17
17
  * @property {Array<string>} blocklist
18
- * @property {{[key: string], string}} urlReplacements
18
+ * @property {{[key: string]: string}} urlReplacements
19
19
  * @property {number} maximumHtmlLength
20
20
  * @property {string} maximumHtmlText
21
21
  */
22
+ const defaults = {
23
+ refresh: false,
24
+ duration: "1d",
25
+ uniqueKey: "webmentions",
26
+ cacheDirectory: undefined,
27
+ allowedHTML: {
28
+ allowedTags: ["a", "b", "em", "i", "strong"],
29
+ allowedAttributes: {
30
+ a: ["href"],
31
+ },
32
+ },
33
+ allowlist: [],
34
+ blocklist: [],
35
+ urlReplacements: {},
36
+ maximumHtmlLength: 1000,
37
+ maximumHtmlText: "mentioned this in",
38
+ };
22
39
 
23
40
  /**
24
41
  * @typedef {object} OptionsUserInput
@@ -61,27 +78,6 @@ const sanitizeHTML = require("sanitize-html");
61
78
  * @typedef {"bookmark-of"|"like-of"|"repost-of"|"mention-of"|"in-reply-to"} WebmentionType
62
79
  */
63
80
 
64
- /**
65
- * @type {OptionsDefaults}
66
- */
67
- const defaults = {
68
- refresh: false,
69
- duration: "1d",
70
- uniqueKey: "webmentions",
71
- cacheDirectory: undefined,
72
- allowedHTML: {
73
- allowedTags: ["a", "b", "em", "i", "strong"],
74
- allowedAttributes: {
75
- a: ["href"],
76
- },
77
- },
78
- allowlist: [],
79
- blocklist: [],
80
- urlReplacements: {},
81
- maximumHtmlLength: 1000,
82
- maximumHtmlText: "mentioned this in",
83
- };
84
-
85
81
  /**
86
82
  * @param {string} url
87
83
  * @param {string} domain
@@ -521,7 +517,7 @@ const WEBMENTIONS = {};
521
517
 
522
518
  /**
523
519
  * @param {Options} options
524
- * @returns {Promise<{[key: string], Array<Webmention>}>}
520
+ * @returns {Promise<{[key: string]: Array<Webmention>}>}
525
521
  */
526
522
  const webmentionsByURL = async (options) => {
527
523
  if (Object.keys(WEBMENTIONS).length) {
@@ -15,10 +15,27 @@ import sanitizeHTML from "sanitize-html";
15
15
  * @property {AllowedHTML} allowedHTML
16
16
  * @property {Array<string>} allowlist
17
17
  * @property {Array<string>} blocklist
18
- * @property {{[key: string], string}} urlReplacements
18
+ * @property {{[key: string]: string}} urlReplacements
19
19
  * @property {number} maximumHtmlLength
20
20
  * @property {string} maximumHtmlText
21
21
  */
22
+ export const defaults = {
23
+ refresh: false,
24
+ duration: "1d",
25
+ uniqueKey: "webmentions",
26
+ cacheDirectory: undefined,
27
+ allowedHTML: {
28
+ allowedTags: ["a", "b", "em", "i", "strong"],
29
+ allowedAttributes: {
30
+ a: ["href"],
31
+ },
32
+ },
33
+ allowlist: [],
34
+ blocklist: [],
35
+ urlReplacements: {},
36
+ maximumHtmlLength: 1000,
37
+ maximumHtmlText: "mentioned this in",
38
+ };
22
39
 
23
40
  /**
24
41
  * @typedef {object} OptionsUserInput
@@ -61,27 +78,6 @@ import sanitizeHTML from "sanitize-html";
61
78
  * @typedef {"bookmark-of"|"like-of"|"repost-of"|"mention-of"|"in-reply-to"} WebmentionType
62
79
  */
63
80
 
64
- /**
65
- * @type {OptionsDefaults}
66
- */
67
- export const defaults = {
68
- refresh: false,
69
- duration: "1d",
70
- uniqueKey: "webmentions",
71
- cacheDirectory: undefined,
72
- allowedHTML: {
73
- allowedTags: ["a", "b", "em", "i", "strong"],
74
- allowedAttributes: {
75
- a: ["href"],
76
- },
77
- },
78
- allowlist: [],
79
- blocklist: [],
80
- urlReplacements: {},
81
- maximumHtmlLength: 1000,
82
- maximumHtmlText: "mentioned this in",
83
- };
84
-
85
81
  /**
86
82
  * @param {string} url
87
83
  * @param {string} domain
@@ -117,7 +113,7 @@ const baseURL = (url) => {
117
113
 
118
114
  /**
119
115
  * @param {string} url
120
- * @param {{[key: string], string}} [urlReplacements]
116
+ * @param {{[key: string]: string}} [urlReplacements]
121
117
  * @returns {string}
122
118
  */
123
119
  const fixURL = (url, urlReplacements) => {
@@ -535,7 +531,7 @@ const WEBMENTIONS = {};
535
531
 
536
532
  /**
537
533
  * @param {Options} options
538
- * @returns {Promise<{[key: string], Array<Webmention>}>}
534
+ * @returns {Promise<{[key: string]: Array<Webmention>}>}
539
535
  */
540
536
  export const webmentionsByURL = async (options) => {
541
537
  if (Object.keys(WEBMENTIONS).length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrisburnell/eleventy-cache-webmentions",
3
- "version": "2.2.4",
3
+ "version": "2.2.7",
4
4
  "description": "Cache webmentions using eleventy-fetch and make them available to use in collections, layouts, pages, etc. in Eleventy.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -61,14 +61,14 @@
61
61
  "node": ">=18"
62
62
  },
63
63
  "dependencies": {
64
- "@11ty/eleventy-fetch": "^5.1.0",
64
+ "@11ty/eleventy-fetch": "^5.1.1",
65
65
  "sanitize-html": "^2.17.0"
66
66
  },
67
67
  "devDependencies": {
68
- "esbuild": "^0.25.11",
69
- "eslint": "^9.38.0",
70
- "eslint-plugin-jsdoc": "^61.1.10",
71
- "globals": "^16.4.0",
68
+ "esbuild": "^0.27.1",
69
+ "eslint": "^9.39.1",
70
+ "eslint-plugin-jsdoc": "^61.4.1",
71
+ "globals": "^16.5.0",
72
72
  "nock": "^14.0.10"
73
73
  },
74
74
  "type": "module"