@flourish/pocket-knife
Advanced tools
Comparing version 0.3.2 to 0.4.0
{ | ||
"name": "@flourish/pocket-knife", | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"description": "Flourish module with handy tools", | ||
@@ -32,2 +32,2 @@ "main": "pocket-knife.js", | ||
} | ||
} | ||
} |
@@ -0,1 +1,4 @@ | ||
### 0.4.0 | ||
* Recognise `data:` URIs in the `isUrl()` and `isImage()` functions | ||
### 0.3.2 | ||
@@ -14,2 +17,2 @@ * Change `this` in `getTextWidth()` | ||
### 0.1.0 | ||
* First version with isImage and isUrl functions | ||
* First version with isImage and isUrl functions |
@@ -12,3 +12,3 @@ var getTextWidth = (function() { | ||
if (typeof string != "string") return false; | ||
return string.match(/^https?:\/\/.+\.(jpg|jpeg|svg|png|gif|webp)$/i) != null; | ||
return string.match(/^(https?:\/\/.+\.(jpg|jpeg|svg|png|gif|webp)$|data:image\/)/i) != null; | ||
} | ||
@@ -18,5 +18,5 @@ | ||
if (typeof string != "string") return false; | ||
return string.match(/^https?:\/\//i) != null; | ||
return string.match(/^(https?:\/\/|data:)/i) != null; | ||
} | ||
export { getTextWidth, isImage, isUrl } | ||
export { getTextWidth, isImage, isUrl } |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3021
40
1