usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [2/9] git commit: fix and simplify getEntityId()
Date Fri, 28 Mar 2014 03:21:10 GMT
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 <scott@ganyo.com>
Authored: Fri Mar 21 13:52:24 2014 -0700
Committer: Scott Ganyo <scott@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;
   }
 
   /*


Mime
View raw message