Postgres Check If String Javascript Methods