import on splash

This commit is contained in:
Matias Alejo Garcia 2015-05-13 11:58:19 -03:00
commit 51ad7d83dc
12 changed files with 28 additions and 52 deletions

View file

@ -14,17 +14,20 @@ Profile.create = function(opts) {
var x = new Profile();
x.createdOn = Date.now();
x.credentials = opts.credentials;
x.credentials = opts.credentials || [];
return x;
};
Profile.fromObj = function(obj) {
var x = new Profile();
x.createdOn = obj.createdOn;
x.credentials = obj.credentials;
if (x.credentials[0] && typeof x.credentials[0] != 'object')
throw ("credentials should be an object");
return x;
};