metascraper 5.54.1 → 5.55.0

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/index.d.ts +5 -1
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "metascraper",
3
3
  "description": "Scrape metadata from any URL using Open Graph, JSON-LD, HTML meta tags, and smart fallbacks.",
4
4
  "homepage": "https://metascraper.js.org",
5
- "version": "5.54.1",
5
+ "version": "5.55.0",
6
6
  "types": "src/index.d.ts",
7
7
  "main": "src/index.js",
8
8
  "repository": {
@@ -27,7 +27,7 @@
27
27
  "unfurl"
28
28
  ],
29
29
  "dependencies": {
30
- "@metascraper/helpers": "5.54.1",
30
+ "@metascraper/helpers": "5.55.0",
31
31
  "cheerio": "~1.2.0",
32
32
  "debug-logfmt": "~1.4.12",
33
33
  "whoops": "~5.1.2"
@@ -55,5 +55,5 @@
55
55
  "tsd": {
56
56
  "directory": "test/types"
57
57
  },
58
- "gitHead": "9f72883982e1c5486f2b3dbc6fa4d7958885e518"
58
+ "gitHead": "c6fdffea348dcee4ff5ce22613518c4c68f50f2a"
59
59
  }
package/src/index.d.ts CHANGED
@@ -123,10 +123,14 @@ declare namespace createMetascraper {
123
123
  /**
124
124
  * Scrape-level check inside `findRule`. Falsy or throw rejects the candidate
125
125
  * and continues with the next rule.
126
+ *
127
+ * `options.propName` is the property being resolved, so a validate can scope
128
+ * itself: the same value is a hostile asset under `logo` and the expected
129
+ * result under `url`.
126
130
  */
127
131
  export type Validate = (
128
132
  value: string,
129
- options: RulesTestOptions,
133
+ options: RulesTestOptions & { propName: string },
130
134
  debug: Debug
131
135
  ) => boolean | Promise<boolean>;
132
136