Return-Path: X-Original-To: apmail-usergrid-commits-archive@minotaur.apache.org Delivered-To: apmail-usergrid-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DC34110487 for ; Fri, 28 Mar 2014 03:21:15 +0000 (UTC) Received: (qmail 12783 invoked by uid 500); 28 Mar 2014 03:21:15 -0000 Delivered-To: apmail-usergrid-commits-archive@usergrid.apache.org Received: (qmail 12726 invoked by uid 500); 28 Mar 2014 03:21:14 -0000 Mailing-List: contact commits-help@usergrid.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@usergrid.incubator.apache.org Delivered-To: mailing list commits@usergrid.incubator.apache.org Received: (qmail 12657 invoked by uid 99); 28 Mar 2014 03:21:11 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Mar 2014 03:21:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 0DEA590F8C2; Fri, 28 Mar 2014 03:21:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: snoopdave@apache.org To: commits@usergrid.apache.org Date: Fri, 28 Mar 2014 03:21:10 -0000 Message-Id: <508358e08bd643cead38d87a19c49d6a@git.apache.org> In-Reply-To: <361525db2327489996d878573d7db74d@git.apache.org> References: <361525db2327489996d878573d7db74d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/9] git commit: fix and simplify getEntityId() fix and simplify getEntityId() Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/70c4f01f Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/70c4f01f Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/70c4f01f Branch: refs/heads/master Commit: 70c4f01f5a82e29a3ca8d055901315674b033a26 Parents: 4766515 Author: Scott Ganyo Authored: Fri Mar 21 13:52:24 2014 -0700 Committer: Scott Ganyo Committed: Fri Mar 21 13:52:24 2014 -0700 ---------------------------------------------------------------------- sdks/nodejs/lib/usergrid.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/70c4f01f/sdks/nodejs/lib/usergrid.js ---------------------------------------------------------------------- diff --git a/sdks/nodejs/lib/usergrid.js b/sdks/nodejs/lib/usergrid.js index edc6714..9140f14 100755 --- a/sdks/nodejs/lib/usergrid.js +++ b/sdks/nodejs/lib/usergrid.js @@ -1162,17 +1162,7 @@ var AUTH_NONE = 'NONE'; * */ Usergrid.Entity.prototype.getEntityId = function (entity) { - var id = false; - if (isUUID(entity.get('uuid'))) { - id = entity.get('uuid'); - } else { - if (type === 'users') { - id = entity.get('username'); - } else if (entity.get('name')) { - id = entity.get('name'); - } - } - return id; + return entity.get('uuid') || entity.get('username') || entity.get('name') || false; } /*