parse 3.4.3-alpha.1 → 3.4.3-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Parse JavaScript SDK v3.4.3-alpha.1
2
+ * Parse JavaScript SDK v3.4.3-alpha.2
3
3
  *
4
4
  * The source tree of this library can be found at
5
5
  * https://github.com/ParsePlatform/Parse-SDK-JS
@@ -699,7 +699,7 @@ var config
699
699
  SERVER_AUTH_TOKEN: null,
700
700
  LIVEQUERY_SERVER_URL: null,
701
701
  ENCRYPTED_KEY: null,
702
- VERSION: 'js' + "3.4.3-alpha.1",
702
+ VERSION: 'js' + "3.4.3-alpha.2",
703
703
  APPLICATION_ID: null,
704
704
  JAVASCRIPT_KEY: null,
705
705
  MASTER_KEY: null,
@@ -18143,6 +18143,8 @@ var ParseRole = /*#__PURE__*/function (_ParseObject) {
18143
18143
  )
18144
18144
  /*: ParseObject | boolean*/
18145
18145
  {
18146
+ this._validateName(name);
18147
+
18146
18148
  return this.set('name', name, options);
18147
18149
  }
18148
18150
  /**
@@ -18183,6 +18185,17 @@ var ParseRole = /*#__PURE__*/function (_ParseObject) {
18183
18185
  {
18184
18186
  return this.relation('roles');
18185
18187
  }
18188
+ }, {
18189
+ key: "_validateName",
18190
+ value: function (newName) {
18191
+ if (typeof newName !== 'string') {
18192
+ throw new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name must be a String.");
18193
+ }
18194
+
18195
+ if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
18196
+ throw new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can be only contain alphanumeric characters, _, " + '-, and spaces.');
18197
+ }
18198
+ }
18186
18199
  }, {
18187
18200
  key: "validate",
18188
18201
  value: function (attrs
@@ -18208,12 +18221,10 @@ var ParseRole = /*#__PURE__*/function (_ParseObject) {
18208
18221
  return new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
18209
18222
  }
18210
18223
 
18211
- if (typeof newName !== 'string') {
18212
- return new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name must be a String.");
18213
- }
18214
-
18215
- if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
18216
- return new _ParseError.default(_ParseError.default.OTHER_CAUSE, "A role's name can be only contain alphanumeric characters, _, " + '-, and spaces.');
18224
+ try {
18225
+ this._validateName(newName);
18226
+ } catch (e) {
18227
+ return e;
18217
18228
  }
18218
18229
  }
18219
18230
 
@@ -20396,7 +20407,7 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
20396
20407
  * Request an email verification.
20397
20408
  *
20398
20409
  * @param {string} email The email address associated with the user that
20399
- * forgot their password.
20410
+ * needs to verify their email.
20400
20411
  * @param {object} options
20401
20412
  * @static
20402
20413
  * @returns {Promise}