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

@flourish/pocket-knife

Package Overview
Dependencies
Maintainers
10
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flourish/pocket-knife - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

2

package.json
{
"name": "@flourish/pocket-knife",
"version": "0.1.1",
"version": "0.2.0",
"description": "Flourish module with handy tools",

@@ -5,0 +5,0 @@ "main": "pocket-knife.js",

@@ -10,5 +10,5 @@ # Flourish pocket knife

### isUrl(string)
Checks if string is valid URL. Returns `null` if false. Otherwise returns matched value.
Checks if string looks like valid URL. Returns `true` or `false`
### isImage(string)
Checks if string is valid image URL. Returns `null` if false. Otherwise returns matched value.
Checks if string looks like valid image URL. Returns `true` or `false`

@@ -0,2 +1,5 @@

### 0.2.0
* Improve string checker for isUrl and isImage
### 0.1.0
* First version with isImage and isUrl functions

@@ -1,15 +0,11 @@

function isUndefined(string) {
return string === undefined || string === null;
}
function isUrl(string) {
if (isUndefined(string)) return null;
return string.match(/^https?:\/\//i);
if (typeof string != "string") return false;
return string.match(/^https?:\/\//i) != null;
}
function isImage(string) {
if (isUndefined(string)) return null;
return string.match(/^https?:\/\/.+\.(jpg|jpeg|svg|png|gif|webp)$/i);
if (typeof string != "string") return false;
return string.match(/^https?:\/\/.+\.(jpg|jpeg|svg|png|gif|webp)$/i) != null;
}
export { isUrl, isImage }
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