friendly-img-hash-js 1.1.1 → 1.1.2

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.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "friendly-img-hash-js",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "User friendly algorithms for generating image hashes.",
5
5
  "main": "index.js",
6
6
  "type": "module",
7
7
  "scripts": {
8
- "test": "mocha index.test.js",
8
+ "test": "mocha src/**/*.test.js index.test.js",
9
9
  "lint": "eslint src/** index.js index.test.js --no-error-on-unmatched-pattern",
10
10
  "lint:fix": "eslint src/** index.js index.test.js --fix"
11
11
  },
@@ -46,4 +46,4 @@
46
46
  "utif2": "^4.1.0"
47
47
  },
48
48
  "browser": "browser.js"
49
- }
49
+ }
@@ -3,9 +3,8 @@ import https from 'https';
3
3
 
4
4
  export const isUrl = (s) => {
5
5
  try {
6
- // eslint-disable-next-line no-new
7
- new URL(s);
8
- return true;
6
+ const url = new URL(s);
7
+ return url.protocol.startsWith('http');
9
8
  } catch (err) {
10
9
  // Nope.
11
10
  }