r3dkar-social-media-api
Advanced tools
Comparing version
{ | ||
"name": "r3dkar-social-media-api", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "API for social media", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -14,3 +14,2 @@ import fs from 'fs'; | ||
const emailRegex = /^\S+@\S+$/; | ||
const urlRegex = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/; | ||
const birthdatePattern = date.compile('YYYY-MM-DD'); | ||
@@ -25,3 +24,2 @@ const timestampPattern = date.compile('HH:mm:ss DD-MM-YYYY'); | ||
email, | ||
photoUrl, | ||
role, | ||
@@ -39,5 +37,2 @@ accountStatus | ||
if (photoUrl !== undefined && photoUrl.match(urlRegex) === null) | ||
throw new Error(`Invalid url "${photoUrl}"`); | ||
if (role !== undefined && roles.indexOf(role) === -1) | ||
@@ -44,0 +39,0 @@ throw new Error(`Invalid role "${role}"`); |
10952
-2.37%274
-1.44%