Skip to content
This repository was archived by the owner on Jan 26, 2021. It is now read-only.

Commit 078592d

Browse files
committed
package.json modifications, bumping to 0.2.4
1 parent 96bf10e commit 078592d

File tree

9 files changed

+84
-116
lines changed

9 files changed

+84
-116
lines changed

dist/parse-react.js

Lines changed: 37 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Parse + React
3-
* v0.2.3
3+
* v0.2.4
44
*/
55
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ParseReact = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
66
/*
@@ -142,6 +142,8 @@ var Delta = (function () {
142142
function Delta(id, data, options) {
143143
_classCallCheck(this, Delta);
144144

145+
this.__initializeProperties();
146+
145147
if (!(id instanceof Id)) {
146148
throw new TypeError('Cannot create a Delta with an invalid target Id');
147149
}
@@ -160,18 +162,6 @@ var Delta = (function () {
160162
}
161163

162164
_createClass(Delta, [{
163-
key: 'id',
164-
value: undefined,
165-
enumerable: true
166-
}, {
167-
key: 'map',
168-
value: undefined,
169-
enumerable: true
170-
}, {
171-
key: 'destroy',
172-
value: undefined,
173-
enumerable: true
174-
}, {
175165
key: 'merge',
176166

177167
/**
@@ -197,6 +187,13 @@ var Delta = (function () {
197187

198188
return this;
199189
}
190+
}, {
191+
key: '__initializeProperties',
192+
value: function __initializeProperties() {
193+
this.id = undefined;
194+
this.map = undefined;
195+
this.destroy = undefined;
196+
}
200197
}]);
201198

202199
return Delta;
@@ -244,23 +241,23 @@ var Id = (function () {
244241
function Id(className, objectId) {
245242
_classCallCheck(this, Id);
246243

244+
this.__initializeProperties();
245+
247246
this.className = className;
248247
this.objectId = objectId;
249248
}
250249

251250
_createClass(Id, [{
252-
key: 'className',
253-
value: undefined,
254-
enumerable: true
255-
}, {
256-
key: 'objectId',
257-
value: undefined,
258-
enumerable: true
259-
}, {
260251
key: 'toString',
261252
value: function toString() {
262253
return this.className + ':' + this.objectId;
263254
}
255+
}, {
256+
key: '__initializeProperties',
257+
value: function __initializeProperties() {
258+
this.className = undefined;
259+
this.objectId = undefined;
260+
}
264261
}], [{
265262
key: 'fromString',
266263
value: function fromString(str) {
@@ -629,24 +626,14 @@ var Mutation = (function () {
629626
function Mutation(action, target, data) {
630627
_classCallCheck(this, Mutation);
631628

629+
this.__initializeProperties();
630+
632631
this.action = action;
633632
this.target = target;
634633
this.data = data;
635634
}
636635

637636
_createClass(Mutation, [{
638-
key: 'action',
639-
value: undefined,
640-
enumerable: true
641-
}, {
642-
key: 'target',
643-
value: undefined,
644-
enumerable: true
645-
}, {
646-
key: 'data',
647-
value: undefined,
648-
enumerable: true
649-
}, {
650637
key: 'dispatch',
651638
value: function dispatch(options) {
652639
if (this.action === 'NOOP') {
@@ -741,6 +728,13 @@ var Mutation = (function () {
741728
}
742729
return new Delta(id, changes);
743730
}
731+
}, {
732+
key: '__initializeProperties',
733+
value: function __initializeProperties() {
734+
this.action = undefined;
735+
this.target = undefined;
736+
this.data = undefined;
737+
}
744738
}]);
745739

746740
return Mutation;
@@ -1425,7 +1419,7 @@ function deepFetch(id, seen) {
14251419
var obj = {};
14261420
for (var attr in source) {
14271421
var sourceVal = source[attr];
1428-
if (sourceVal.__type === 'Pointer') {
1422+
if (typeof sourceVal === 'object' && sourceVal.__type === 'Pointer') {
14291423
var childId = new Id(sourceVal.className, sourceVal.objectId);
14301424
if (seen.indexOf(childId.toString()) < 0 && store[childId]) {
14311425
seen = seen.concat([childId.toString()]);
@@ -1620,6 +1614,7 @@ module.exports = ParsePatches;
16201614
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
16211615
* IN THE SOFTWARE.
16221616
*
1617+
* @flow
16231618
*/
16241619

16251620
'use strict';
@@ -1657,7 +1652,7 @@ function stringify(object) {
16571652
if (typeof object === 'string') {
16581653
return '"' + object.replace(/\|/g, '%|') + '"';
16591654
}
1660-
return object;
1655+
return object + '';
16611656
}
16621657
if (Array.isArray(object)) {
16631658
var copy = object.map(stringify);
@@ -1682,7 +1677,7 @@ function queryHash(query) {
16821677
throw new TypeError('Only a Parse Query can be hashed');
16831678
}
16841679
var where = flattenOrQueries(query._where || {});
1685-
var columns;
1680+
var columns = [];
16861681
var values = [];
16871682
var i;
16881683
if (Array.isArray(where)) {
@@ -2023,6 +2018,12 @@ var Subscription = (function () {
20232018
function Subscription(query) {
20242019
_classCallCheck(this, Subscription);
20252020

2021+
this.originalQuery = undefined;
2022+
this.pending = undefined;
2023+
this.subscribers = undefined;
2024+
this.resultSet = undefined;
2025+
this.observationCount = undefined;
2026+
20262027
// The query used to fetch results for this Subscription
20272028
this.originalQuery = query;
20282029
// Whether there is an outstanding AJAX request for results
@@ -2038,26 +2039,6 @@ var Subscription = (function () {
20382039
}
20392040

20402041
_createClass(Subscription, [{
2041-
key: 'originalQuery',
2042-
value: undefined,
2043-
enumerable: true
2044-
}, {
2045-
key: 'pending',
2046-
value: undefined,
2047-
enumerable: true
2048-
}, {
2049-
key: 'subscribers',
2050-
value: undefined,
2051-
enumerable: true
2052-
}, {
2053-
key: 'resultSet',
2054-
value: undefined,
2055-
enumerable: true
2056-
}, {
2057-
key: 'observationCount',
2058-
value: undefined,
2059-
enumerable: true
2060-
}, {
20612042
key: 'addSubscriber',
20622043

20632044
/**

dist/parse-react.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Delta.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ var Delta = (function () {
4141
function Delta(id, data, options) {
4242
_classCallCheck(this, Delta);
4343

44+
this.__initializeProperties();
45+
4446
if (!(id instanceof Id)) {
4547
throw new TypeError('Cannot create a Delta with an invalid target Id');
4648
}
@@ -59,18 +61,6 @@ var Delta = (function () {
5961
}
6062

6163
_createClass(Delta, [{
62-
key: 'id',
63-
value: undefined,
64-
enumerable: true
65-
}, {
66-
key: 'map',
67-
value: undefined,
68-
enumerable: true
69-
}, {
70-
key: 'destroy',
71-
value: undefined,
72-
enumerable: true
73-
}, {
7464
key: 'merge',
7565

7666
/**
@@ -96,6 +86,13 @@ var Delta = (function () {
9686

9787
return this;
9888
}
89+
}, {
90+
key: '__initializeProperties',
91+
value: function __initializeProperties() {
92+
this.id = undefined;
93+
this.map = undefined;
94+
this.destroy = undefined;
95+
}
9996
}]);
10097

10198
return Delta;

lib/Id.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ var Id = (function () {
3737
function Id(className, objectId) {
3838
_classCallCheck(this, Id);
3939

40+
this.__initializeProperties();
41+
4042
this.className = className;
4143
this.objectId = objectId;
4244
}
4345

4446
_createClass(Id, [{
45-
key: 'className',
46-
value: undefined,
47-
enumerable: true
48-
}, {
49-
key: 'objectId',
50-
value: undefined,
51-
enumerable: true
52-
}, {
5347
key: 'toString',
5448
value: function toString() {
5549
return this.className + ':' + this.objectId;
5650
}
51+
}, {
52+
key: '__initializeProperties',
53+
value: function __initializeProperties() {
54+
this.className = undefined;
55+
this.objectId = undefined;
56+
}
5757
}], [{
5858
key: 'fromString',
5959
value: function fromString(str) {

lib/Mutation.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,24 +85,14 @@ var Mutation = (function () {
8585
function Mutation(action, target, data) {
8686
_classCallCheck(this, Mutation);
8787

88+
this.__initializeProperties();
89+
8890
this.action = action;
8991
this.target = target;
9092
this.data = data;
9193
}
9294

9395
_createClass(Mutation, [{
94-
key: 'action',
95-
value: undefined,
96-
enumerable: true
97-
}, {
98-
key: 'target',
99-
value: undefined,
100-
enumerable: true
101-
}, {
102-
key: 'data',
103-
value: undefined,
104-
enumerable: true
105-
}, {
10696
key: 'dispatch',
10797
value: function dispatch(options) {
10898
if (this.action === 'NOOP') {
@@ -197,6 +187,13 @@ var Mutation = (function () {
197187
}
198188
return new Delta(id, changes);
199189
}
190+
}, {
191+
key: '__initializeProperties',
192+
value: function __initializeProperties() {
193+
this.action = undefined;
194+
this.target = undefined;
195+
this.data = undefined;
196+
}
200197
}]);
201198

202199
return Mutation;

lib/ObjectStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ function deepFetch(id, seen) {
351351
var obj = {};
352352
for (var attr in source) {
353353
var sourceVal = source[attr];
354-
if (sourceVal.__type === 'Pointer') {
354+
if (typeof sourceVal === 'object' && sourceVal.__type === 'Pointer') {
355355
var childId = new Id(sourceVal.className, sourceVal.objectId);
356356
if (seen.indexOf(childId.toString()) < 0 && store[childId]) {
357357
seen = seen.concat([childId.toString()]);

lib/QueryTools.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1919
* IN THE SOFTWARE.
2020
*
21+
* @flow
2122
*/
2223

2324
'use strict';
@@ -55,7 +56,7 @@ function stringify(object) {
5556
if (typeof object === 'string') {
5657
return '"' + object.replace(/\|/g, '%|') + '"';
5758
}
58-
return object;
59+
return object + '';
5960
}
6061
if (Array.isArray(object)) {
6162
var copy = object.map(stringify);
@@ -80,7 +81,7 @@ function queryHash(query) {
8081
throw new TypeError('Only a Parse Query can be hashed');
8182
}
8283
var where = flattenOrQueries(query._where || {});
83-
var columns;
84+
var columns = [];
8485
var values = [];
8586
var i;
8687
if (Array.isArray(where)) {

lib/Subscription.js

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ var Subscription = (function () {
7676
function Subscription(query) {
7777
_classCallCheck(this, Subscription);
7878

79+
this.originalQuery = undefined;
80+
this.pending = undefined;
81+
this.subscribers = undefined;
82+
this.resultSet = undefined;
83+
this.observationCount = undefined;
84+
7985
// The query used to fetch results for this Subscription
8086
this.originalQuery = query;
8187
// Whether there is an outstanding AJAX request for results
@@ -91,26 +97,6 @@ var Subscription = (function () {
9197
}
9298

9399
_createClass(Subscription, [{
94-
key: 'originalQuery',
95-
value: undefined,
96-
enumerable: true
97-
}, {
98-
key: 'pending',
99-
value: undefined,
100-
enumerable: true
101-
}, {
102-
key: 'subscribers',
103-
value: undefined,
104-
enumerable: true
105-
}, {
106-
key: 'resultSet',
107-
value: undefined,
108-
enumerable: true
109-
}, {
110-
key: 'observationCount',
111-
value: undefined,
112-
enumerable: true
113-
}, {
114100
key: 'addSubscriber',
115101

116102
/**

0 commit comments

Comments
 (0)