@metascraper/helpers 5.46.5 → 5.46.10

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/index.js +8 -1
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -284,7 +284,14 @@ const url = (value, { url = '' } = {}) => {
284
284
  if (isUrl(absoluteUrl)) return absoluteUrl
285
285
  } catch (_) {}
286
286
 
287
- return isUri(value) ? value : undefined
287
+ let sanitizedValue = value
288
+ if (value.startsWith('data:')) {
289
+ const [header, data] = value.split(',')
290
+ const cleanData = data.replace(/\s+/g, '')
291
+ sanitizedValue = `${header},${cleanData}`
292
+ }
293
+
294
+ return isUri(sanitizedValue) ? sanitizedValue : undefined
288
295
  }
289
296
 
290
297
  const getISODate = date =>
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@metascraper/helpers",
3
3
  "description": "Collection of helper functions used by metascraper",
4
4
  "homepage": "https://github.com/microlinkhq/metascraper/packages/metascraper-helpers",
5
- "version": "5.46.5",
5
+ "version": "5.46.10",
6
6
  "main": "index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "901812e75b5ff01bb9e82c2d8bf9646f66815dbb"
67
+ "gitHead": "d66104b59aa84d93e142ba4404c6d7614c5b4362"
68
68
  }