Skip to content

Commit 9365179

Browse files
yagotomedplewis
authored andcommitted
Fix JSDocs return types of ParseObject's methods (#832)
1 parent f38f882 commit 9365179

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/ParseObject.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ class ParseObject {
624624
* @param {} value The value to give it.
625625
* @param {Object} options A set of options for the set.
626626
* The only supported option is <code>error</code>.
627-
* @return {Boolean} true if the set succeeded.
627+
* @return {(ParseObject|Boolean)} true if the set succeeded.
628628
*/
629629
set(key: mixed, value: mixed, options?: mixed): ParseObject | boolean {
630630
let changes = {};
@@ -728,6 +728,7 @@ class ParseObject {
728728
* Remove an attribute from the model. This is a noop if the attribute doesn't
729729
* exist.
730730
* @param {String} attr The string name of an attribute.
731+
* @return {(ParseObject|Boolean)}
731732
*/
732733
unset(attr: string, options?: { [opt: string]: mixed }): ParseObject | boolean {
733734
options = options || {};
@@ -741,6 +742,7 @@ class ParseObject {
741742
*
742743
* @param attr {String} The key.
743744
* @param amount {Number} The amount to increment by (optional).
745+
* @return {(ParseObject|Boolean)}
744746
*/
745747
increment(attr: string, amount?: number): ParseObject | boolean {
746748
if (typeof amount === 'undefined') {
@@ -768,6 +770,7 @@ class ParseObject {
768770
* key.
769771
* @param attr {String} The key.
770772
* @param items {Object[]} The items to add.
773+
* @return {(ParseObject|Boolean)}
771774
*/
772775
addAll(attr: string, items: Array<mixed>): ParseObject | boolean {
773776
return this.set(attr, new AddOp(items));
@@ -780,6 +783,7 @@ class ParseObject {
780783
*
781784
* @param attr {String} The key.
782785
* @param item {} The object to add.
786+
* @return {(ParseObject|Boolean)}
783787
*/
784788
addUnique(attr: string, item: mixed): ParseObject | boolean {
785789
return this.set(attr, new AddUniqueOp([item]));
@@ -792,6 +796,7 @@ class ParseObject {
792796
*
793797
* @param attr {String} The key.
794798
* @param items {Object[]} The objects to add.
799+
* @return {(ParseObject|Boolean)}
795800
*/
796801
addAllUnique(attr: string, items: Array<mixed>): ParseObject | boolean {
797802
return this.set(attr, new AddUniqueOp(items));
@@ -803,6 +808,7 @@ class ParseObject {
803808
*
804809
* @param attr {String} The key.
805810
* @param item {} The object to remove.
811+
* @return {(ParseObject|Boolean)}
806812
*/
807813
remove(attr: string, item: mixed): ParseObject | boolean {
808814
return this.set(attr, new RemoveOp([item]));
@@ -814,6 +820,7 @@ class ParseObject {
814820
*
815821
* @param attr {String} The key.
816822
* @param items {Object[]} The object to remove.
823+
* @return {(ParseObject|Boolean)}
817824
*/
818825
removeAll(attr: string, items: Array<mixed>): ParseObject | boolean {
819826
return this.set(attr, new RemoveOp(items));
@@ -963,7 +970,7 @@ class ParseObject {
963970
* Sets the ACL to be used for this object.
964971
* @param {Parse.ACL} acl An instance of Parse.ACL.
965972
* @param {Object} options
966-
* @return {Boolean} Whether the set passed validation.
973+
* @return {(ParseObject|Boolean)} Whether the set passed validation.
967974
* @see Parse.Object#set
968975
*/
969976
setACL(acl: ParseACL, options?: mixed): ParseObject | boolean {

0 commit comments

Comments
 (0)