web-manager 3.2.30 → 3.2.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/lib/account.js +15 -13
  2. package/package.json +1 -1
package/lib/account.js CHANGED
@@ -233,6 +233,8 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
233
233
 
234
234
  var currentURL;
235
235
  var isDevelopment;
236
+ var timestampOld = '1970-01-01T00:00:00.000Z';
237
+ var timestampUNIXOld = 0;
236
238
 
237
239
  // Resolve auth
238
240
  account.auth = account.auth || {};
@@ -267,16 +269,16 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
267
269
  account.plan.payment.active = account.plan.payment.active || false;
268
270
 
269
271
  account.plan.payment.startDate = account.plan.payment.startDate || {};
270
- account.plan.payment.startDate.timestamp = account.plan.payment.startDate.timestamp || '1970-01-01T00:00:00.000Z';
271
- account.plan.payment.startDate.timestampUNIX = account.plan.payment.startDate.timestampUNIX || 0;
272
+ account.plan.payment.startDate.timestamp = account.plan.payment.startDate.timestamp || timestampOld;
273
+ account.plan.payment.startDate.timestampUNIX = account.plan.payment.startDate.timestampUNIX || timestampUNIXOld;
272
274
 
273
275
  account.plan.payment.updatedBy = account.plan.payment.updatedBy || {};
274
276
  account.plan.payment.updatedBy.event = account.plan.payment.updatedBy.event || {};
275
277
  account.plan.payment.updatedBy.event.id = account.plan.payment.updatedBy.event.id || 'unknown';
276
278
  account.plan.payment.updatedBy.event.name = account.plan.payment.updatedBy.event.name || 'unknown';
277
279
  account.plan.payment.updatedBy.date = account.plan.payment.updatedBy.date || {};
278
- account.plan.payment.updatedBy.date.timestamp = account.plan.payment.updatedBy.date.timestamp || '1970-01-01T00:00:00.000Z';
279
- account.plan.payment.updatedBy.date.timestampUNIX = account.plan.payment.updatedBy.date.timestampUNIX || 0;
280
+ account.plan.payment.updatedBy.date.timestamp = account.plan.payment.updatedBy.date.timestamp || timestampOld;
281
+ account.plan.payment.updatedBy.date.timestampUNIX = account.plan.payment.updatedBy.date.timestampUNIX || timestampUNIXOld;
280
282
 
281
283
  // Set some variables
282
284
  // In a try/catch because this lib is used in node sometimes
@@ -320,8 +322,8 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
320
322
 
321
323
  // Resolve oAuth2
322
324
  account.oauth2 = account.oauth2 || {};
325
+ // account.oauth2.google = account.oauth2.google || {};
323
326
  // account.oauth2.discord = account.oauth2.discord || {};
324
- // account.oauth2.discord.user = account.oauth2.discord.user || {};
325
327
 
326
328
  // Resolve roles
327
329
  account.roles = account.roles || {};
@@ -342,12 +344,12 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
342
344
  // Resolve activity
343
345
  account.activity = account.activity || {};
344
346
  account.activity.lastActivity = account.activity.lastActivity || {};
345
- account.activity.lastActivity.timestamp = account.activity.lastActivity.timestamp || '1970-01-01T00:00:00.000Z';
346
- account.activity.lastActivity.timestampUNIX = account.activity.lastActivity.timestampUNIX || 0;
347
+ account.activity.lastActivity.timestamp = account.activity.lastActivity.timestamp || timestampOld;
348
+ account.activity.lastActivity.timestampUNIX = account.activity.lastActivity.timestampUNIX || timestampUNIXOld;
347
349
 
348
350
  account.activity.created = account.activity.created || {};
349
- account.activity.created.timestamp = account.activity.created.timestamp || '1970-01-01T00:00:00.000Z';
350
- account.activity.created.timestampUNIX = account.activity.created.timestampUNIX || 0;
351
+ account.activity.created.timestamp = account.activity.created.timestamp || timestampOld;
352
+ account.activity.created.timestampUNIX = account.activity.created.timestampUNIX || timestampUNIXOld;
351
353
 
352
354
  account.activity.geolocation = account.activity.geolocation || {};
353
355
  account.activity.geolocation.ip = account.activity.geolocation.ip || 'unknown';
@@ -378,15 +380,15 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
378
380
 
379
381
  account.usage.requests.last = account.usage.requests.last || {};
380
382
  account.usage.requests.last.id = account.usage.requests.last.id || '';
381
- account.usage.requests.last.timestamp = account.usage.requests.last.timestamp || '1970-01-01T00:00:00.000Z';
382
- account.usage.requests.last.timestampUNIX = account.usage.requests.last.timestampUNIX || 0;
383
+ account.usage.requests.last.timestamp = account.usage.requests.last.timestamp || timestampOld;
384
+ account.usage.requests.last.timestampUNIX = account.usage.requests.last.timestampUNIX || timestampUNIXOld;
383
385
 
384
386
  // Personal
385
387
  account.personal = account.personal || {};
386
388
 
387
389
  account.personal.birthday = account.personal.birthday || {};
388
- account.personal.birthday.timestamp = account.personal.birthday.timestamp || '1970-01-01T00:00:00.000Z';
389
- account.personal.birthday.timestampUNIX = account.personal.birthday.timestampUNIX || 0;
390
+ account.personal.birthday.timestamp = account.personal.birthday.timestamp || timestampOld;
391
+ account.personal.birthday.timestampUNIX = account.personal.birthday.timestampUNIX || timestampUNIXOld;
390
392
 
391
393
  account.personal.gender = account.personal.gender || '';
392
394
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.2.30",
3
+ "version": "3.2.32",
4
4
  "description": "Easily access important variables such as the query string, current domain, and current page in a single object.",
5
5
  "main": "index.js",
6
6
  "scripts": {