New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

oembed-parser

Package Overview
Dependencies
Maintainers
3
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oembed-parser - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

10

package.json
{
"version": "1.5.0",
"version": "1.5.1",
"name": "oembed-parser",

@@ -25,5 +25,2 @@ "description": "Get oEmbed data from given URL.",

},
"dependencies": {
"cross-fetch": "^3.1.4"
},
"devDependencies": {

@@ -40,3 +37,6 @@ "jest": "^27.3.1",

"license": "MIT",
"types": "./index.d.ts"
"types": "./index.d.ts",
"dependencies": {
"phin": "^3.6.0"
}
}
// utils -> fetchEmbed
const fetch = require('cross-fetch')
const fetch = require('phin')

@@ -51,9 +51,9 @@ const isFacebookGraphDependent = (provider) => {

const link = getRegularUrl(query, provider.url)
const res = await fetch(link, { mode: 'no-cors' })
const json = await res.json()
json.provider_name = provider_name // eslint-disable-line camelcase
json.provider_url = provider_url // eslint-disable-line camelcase
return json
const res = await fetch({ url: link, parse: 'json' })
const body = res.body
body.provider_name = provider_name // eslint-disable-line camelcase
body.provider_url = provider_url // eslint-disable-line camelcase
return body
}
module.exports = fetchEmbed

@@ -1,21 +0,9 @@

/**
* uri -> check if a url is valid
* @ndaidong
**/
// utils -> isValidUrl
const isValidURL = (str) => {
if (!str) {
return false
module.exports = (url = '') => {
try {
return new URL(url) !== null
} catch (err) {
return null
}
/* eslint-disable*/
let pattern = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/i;
/* eslint-enable */
if (!pattern.test(str)) {
return false
}
return true
}
module.exports = isValidURL
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc