updates assertions

This commit is contained in:
JasterV 2022-03-21 11:08:11 +01:00
parent 5bd1d7bc0a
commit e5c717b0aa
2 changed files with 2 additions and 2 deletions

View file

@ -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": [

View file

@ -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;