Skip to content

Commit 50314b3

Browse files
committed
wip
1 parent 4d40339 commit 50314b3

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

resources/buildConfigDefinitions.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,16 @@ function inject(t, list) {
255255
props.push(t.objectProperty(t.stringLiteral('action'), action));
256256
}
257257
if (elt.defaultValue) {
258-
const parsedValue = parseDefaultValue(elt, elt.defaultValue, t);
258+
let parsedValue = parseDefaultValue(elt, elt.defaultValue, t);
259+
if (!parsedValue) {
260+
for (const type of elt.typeAnnotation.types) {
261+
elt.type = type.type;
262+
parsedValue = parseDefaultValue(elt, elt.defaultValue, t);
263+
if (parsedValue) {
264+
break;
265+
}
266+
}
267+
}
259268
if (parsedValue) {
260269
props.push(t.objectProperty(t.stringLiteral('default'), parsedValue));
261270
} else {

src/Options/Definitions.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@ module.exports.ParseServerOptions = {
493493
env: 'PARSE_SERVER_SEND_USER_EMAIL_VERIFICATION',
494494
help:
495495
'Set to `false` to prevent sending of verification email. Supports a function with a return value of `true` or `false` for conditional email sending.<br><br>Default is `true`.<br>',
496-
action: parsers.booleanParser,
497496
default: true,
498497
},
499498
serverCloseComplete: {
@@ -543,7 +542,6 @@ module.exports.ParseServerOptions = {
543542
env: 'PARSE_SERVER_VERIFY_USER_EMAILS',
544543
help:
545544
'Set to `true` to require users to verify their email address to complete the sign-up process. Supports a function with a return value of `true` or `false` for conditional verification.<br><br>Default is `false`.',
546-
action: parsers.booleanParser,
547545
default: false,
548546
},
549547
webhookKey: {

src/Options/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export interface ParseServerOptions {
157157
<br><br>
158158
Default is `false`.
159159
:DEFAULT: false */
160-
verifyUserEmails: ?boolean;
160+
verifyUserEmails: ?(boolean | void);
161161
/* Set to `true` to prevent a user from logging in if the email has not yet been verified and email verification is required.
162162
<br><br>
163163
Default is `false`.
@@ -186,7 +186,7 @@ export interface ParseServerOptions {
186186
Default is `true`.
187187
<br>
188188
:DEFAULT: true */
189-
sendUserEmailVerification: ?boolean;
189+
sendUserEmailVerification: ?(boolean | void);
190190
/* The account lockout policy for failed login attempts. */
191191
accountLockout: ?AccountLockoutOptions;
192192
/* The password policy for enforcing password related rules. */

0 commit comments

Comments
 (0)