idea-toolbox
Advanced tools
Comparing version 6.6.6 to 6.6.7
@@ -21,9 +21,9 @@ "use strict"; | ||
load(x) { | ||
this.userId = this.clean(x.userId ?? x.sub, String); | ||
this.userId = this.clean(x.userId || x.sub, String); | ||
this.email = this.clean(x.email, String); | ||
this.emailVerified = this.clean(x.emailVerified ?? x.email_verified, Boolean); | ||
this.emailVerified = this.clean(x.emailVerified || x.email_verified, Boolean); | ||
this.name = this.clean(x.name, String); | ||
this.nickname = this.clean(x.nickname, String); | ||
this.picture = this.clean(x.picture, String); | ||
this.updatedAt = this.clean(x.updatedAt ?? x.updated_at, t => new Date(t).toISOString()); | ||
this.updatedAt = this.clean(x.updatedAt || x.updated_at, t => new Date(t).toISOString()); | ||
this.groups = this.cleanArray(x.groups, String); | ||
@@ -30,0 +30,0 @@ this.attributes = x.attributes ?? {}; |
@@ -120,3 +120,3 @@ "use strict"; | ||
cleanArray(origin, castFunction, defaultVal) { | ||
return (origin ?? []) | ||
return (origin || []) | ||
.map(x => (x || x === 0 ? castFunction(x) : defaultVal !== undefined ? defaultVal : null)) | ||
@@ -123,0 +123,0 @@ .filter(x => x || x === 0); |
{ | ||
"name": "idea-toolbox", | ||
"version": "6.6.6", | ||
"version": "6.6.7", | ||
"description": "IDEA's utility functions", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |