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

@metascraper/helpers

Package Overview
Dependencies
Maintainers
1
Versions
242
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metascraper/helpers - npm Package Compare versions

Comparing version 3.2.0 to 3.3.0

README.md

19

index.js

@@ -8,14 +8,23 @@ 'use strict'

const smartquotes = require('smartquotes')
const { flow, isNil } = require('lodash')
const toTitle = require('to-title-case')
const urlRegex = require('url-regex')
const { flow } = require('lodash')
const isUrl = value => urlRegex().test(value)
const isUrl = (url, {relative = true} = {}) => {
if (isNil(url)) return false
if (!relative) return urlRegex().test(url)
return isRelativeUrl(url) || urlRegex().test(url)
}
const normalizeUrl = url => sanetizeUrl(url, { stripWWW: false })
const getAbsoluteUrl = (url, baseUrl) =>
isRelativeUrl(url) ? resolveUrl(baseUrl, url) : url
const getAbsoluteUrl = (baseUrl, relativePath = '') => (
isRelativeUrl(relativePath)
? resolveUrl(baseUrl, relativePath)
: relativePath
)
const getUrl = (url, baseUrl) => normalizeUrl(getAbsoluteUrl(url, baseUrl))
const getUrl = (baseUrl, relativePath) => (
normalizeUrl(getAbsoluteUrl(baseUrl, relativePath))
)

@@ -22,0 +31,0 @@ const createTitle = flow([condenseWhitespace, smartquotes])

@@ -5,3 +5,3 @@ {

"homepage": "https://metascraper.js.org",
"version": "3.2.0",
"version": "3.3.0",
"main": "src/index.js",

@@ -8,0 +8,0 @@ "author": {

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