You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/03/21 22:20:45 UTC

[2/8] 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/node-sdk-enhancements
Commit: 70c4f01f5a82e29a3ca8d055901315674b033a26
Parents: 4766515
Author: Scott Ganyo <sc...@ganyo.com>
Authored: Fri Mar 21 13:52:24 2014 -0700
Committer: Scott Ganyo <sc...@ganyo.com>
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;
   }
 
   /*