Skip to content

Commit

Permalink
Merge pull request #4 from smileidentity/regex
Browse files Browse the repository at this point in the history
fix the regex to include png and put the e in jpeg in the correct spot
  • Loading branch information
beaglebets authored Sep 30, 2019
2 parents 1d28657 + cdbac22 commit 81cbdb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "smile-identity-core",
"version": "0.2.3",
"version": "0.2.4",
"description": "The official Smile Identity gem exposes two classes namely, the WebApi and Signature class.",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/web-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ class WebApi {
if (image['image_type_id'] > 3) {
throw new Error("Invalid image_type_id");
}
if (image['image_type_id'] > 1 && image['image'].match(/(\.je?pg)$/)) {
if (image['image_type_id'] > 1 && image['image'].match(/(\.jpe?g)|(\.png)$/)) {
throw new Error("image_type_id mismatch");
}
if (image['image_type_id'] < 2 && !image['image'].match(/(\.je?pg)$/)) {
if (image['image_type_id'] < 2 && !image['image'].match(/(\.jpe?g)|(\.png)$/)) {
throw new Error("image_type_id mismatch");
}
});
Expand Down

0 comments on commit 81cbdb7

Please sign in to comment.