mirror of
https://codeberg.org/JasterV/imgphash.git
synced 2026-04-26 18:10:01 +00:00
updates assertions
This commit is contained in:
parent
5bd1d7bc0a
commit
e5c717b0aa
2 changed files with 2 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "hash-image",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.0",
|
||||
"description": "Provide an image class that is able to calculate similarity to other images using the phash value",
|
||||
"main": "./src/lib.js",
|
||||
"keywords": [
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class HashImage {
|
|||
}
|
||||
|
||||
static hashCompare(hash1, hash2) {
|
||||
if (!(hash1 instanceof String) || !(hash2 instanceof String)) {
|
||||
if (typeof hash1 !== "string" || typeof hash2 !== "string") {
|
||||
throw new Error("Both hash values need to be strings");
|
||||
}
|
||||
let similarity = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue