Comparing version 1.6.5 to 1.6.6
@@ -19,3 +19,3 @@ /** | ||
SERVER_URL: 'https://api.parse.com', | ||
VERSION: '1.6.5', | ||
VERSION: '1.6.6', | ||
APPLICATION_ID: null, | ||
@@ -22,0 +22,0 @@ JAVASCRIPT_KEY: null, |
@@ -46,70 +46,60 @@ /** | ||
function encode(_x, _x2, _x3, _x4) { | ||
var _again = true; | ||
_function: while (_again) { | ||
var value = _x, | ||
disallowObjects = _x2, | ||
forcePointers = _x3, | ||
seen = _x4; | ||
json = output = k = undefined; | ||
_again = false; | ||
if (value instanceof _ParseObject2['default']) { | ||
if (disallowObjects) { | ||
throw new Error('Parse Objects not allowed here'); | ||
} | ||
if (forcePointers || !seen || seen.indexOf(value) > -1 || value.dirty() || _Object$keys(value._getServerData()).length < 1) { | ||
return value.toPointer(); | ||
} | ||
seen = seen.concat(value); | ||
var json = value._toFullJSON(seen); | ||
_x = json; | ||
_x2 = disallowObjects; | ||
_x3 = forcePointers; | ||
_x4 = seen; | ||
_again = true; | ||
continue _function; | ||
function encode(value, disallowObjects, forcePointers, seen) { | ||
if (value instanceof _ParseObject2['default']) { | ||
if (disallowObjects) { | ||
throw new Error('Parse Objects not allowed here'); | ||
} | ||
if (value instanceof _ParseOp.Op || value instanceof _ParseACL2['default'] || value instanceof _ParseGeoPoint2['default'] || value instanceof _ParseRelation2['default']) { | ||
return value.toJSON(); | ||
var seenEntry = value.id ? value.className + ':' + value.id : value; | ||
if (forcePointers || !seen || seen.indexOf(seenEntry) > -1 || value.dirty() || _Object$keys(value._getServerData()).length < 1) { | ||
return value.toPointer(); | ||
} | ||
if (value instanceof _ParseFile2['default']) { | ||
if (!value.url()) { | ||
throw new Error('Tried to encode an unsaved file.'); | ||
} | ||
return value.toJSON(); | ||
seen = seen.concat(seenEntry); | ||
var json = encode(value.attributes, disallowObjects, forcePointers, seen); | ||
json.className = value.className; | ||
json.__type = 'Object'; | ||
if (value.id) { | ||
json.objectId = value.id; | ||
} | ||
if (toString.call(value) === '[object Date]') { | ||
if (isNaN(value)) { | ||
throw new Error('Tried to encode an invalid date.'); | ||
} | ||
return { __type: 'Date', iso: value.toJSON() }; | ||
return json; | ||
} | ||
if (value instanceof _ParseOp.Op || value instanceof _ParseACL2['default'] || value instanceof _ParseGeoPoint2['default'] || value instanceof _ParseRelation2['default']) { | ||
return value.toJSON(); | ||
} | ||
if (value instanceof _ParseFile2['default']) { | ||
if (!value.url()) { | ||
throw new Error('Tried to encode an unsaved file.'); | ||
} | ||
if (toString.call(value) === '[object RegExp]' && typeof value.source === 'string') { | ||
return value.source; | ||
return value.toJSON(); | ||
} | ||
if (toString.call(value) === '[object Date]') { | ||
if (isNaN(value)) { | ||
throw new Error('Tried to encode an invalid date.'); | ||
} | ||
return { __type: 'Date', iso: value.toJSON() }; | ||
} | ||
if (toString.call(value) === '[object RegExp]' && typeof value.source === 'string') { | ||
return value.source; | ||
} | ||
if (Array.isArray(value)) { | ||
return value.map(function (v) { | ||
return encode(v, disallowObjects, forcePointers, seen); | ||
}); | ||
} | ||
if (Array.isArray(value)) { | ||
return value.map(function (v) { | ||
return encode(v, disallowObjects, forcePointers, seen); | ||
}); | ||
} | ||
if (value && typeof value === 'object') { | ||
var output = {}; | ||
for (var k in value) { | ||
output[k] = encode(value[k], disallowObjects, forcePointers, seen); | ||
} | ||
return output; | ||
if (value && typeof value === 'object') { | ||
var output = {}; | ||
for (var k in value) { | ||
output[k] = encode(value[k], disallowObjects, forcePointers, seen); | ||
} | ||
return output; | ||
} | ||
return value; | ||
} | ||
return value; | ||
} | ||
exports['default'] = function (value, disallowObjects, forcePointers) { | ||
return encode(value, !!disallowObjects, !!forcePointers, []); | ||
exports['default'] = function (value, disallowObjects, forcePointers, seen) { | ||
return encode(value, !!disallowObjects, !!forcePointers, seen || []); | ||
}; | ||
module.exports = exports['default']; |
@@ -400,2 +400,3 @@ /** | ||
value: function toJSON() { | ||
var seenEntry = this.id ? this.className + ':' + this.id : this; | ||
var json = {}; | ||
@@ -407,3 +408,3 @@ var attrs = this.attributes; | ||
} else { | ||
json[attr] = (0, _encode2['default'])(attrs[attr], false, true); | ||
json[attr] = (0, _encode2['default'])(attrs[attr], false, false, [seenEntry]); | ||
} | ||
@@ -410,0 +411,0 @@ } |
@@ -19,3 +19,3 @@ /** | ||
SERVER_URL: 'https://api.parse.com', | ||
VERSION: '1.6.5', | ||
VERSION: '1.6.6', | ||
APPLICATION_ID: null, | ||
@@ -22,0 +22,0 @@ JAVASCRIPT_KEY: null, |
@@ -46,70 +46,60 @@ /** | ||
function encode(_x, _x2, _x3, _x4) { | ||
var _again = true; | ||
_function: while (_again) { | ||
var value = _x, | ||
disallowObjects = _x2, | ||
forcePointers = _x3, | ||
seen = _x4; | ||
json = output = k = undefined; | ||
_again = false; | ||
if (value instanceof _ParseObject2['default']) { | ||
if (disallowObjects) { | ||
throw new Error('Parse Objects not allowed here'); | ||
} | ||
if (forcePointers || !seen || seen.indexOf(value) > -1 || value.dirty() || _Object$keys(value._getServerData()).length < 1) { | ||
return value.toPointer(); | ||
} | ||
seen = seen.concat(value); | ||
var json = value._toFullJSON(seen); | ||
_x = json; | ||
_x2 = disallowObjects; | ||
_x3 = forcePointers; | ||
_x4 = seen; | ||
_again = true; | ||
continue _function; | ||
function encode(value, disallowObjects, forcePointers, seen) { | ||
if (value instanceof _ParseObject2['default']) { | ||
if (disallowObjects) { | ||
throw new Error('Parse Objects not allowed here'); | ||
} | ||
if (value instanceof _ParseOp.Op || value instanceof _ParseACL2['default'] || value instanceof _ParseGeoPoint2['default'] || value instanceof _ParseRelation2['default']) { | ||
return value.toJSON(); | ||
var seenEntry = value.id ? value.className + ':' + value.id : value; | ||
if (forcePointers || !seen || seen.indexOf(seenEntry) > -1 || value.dirty() || _Object$keys(value._getServerData()).length < 1) { | ||
return value.toPointer(); | ||
} | ||
if (value instanceof _ParseFile2['default']) { | ||
if (!value.url()) { | ||
throw new Error('Tried to encode an unsaved file.'); | ||
} | ||
return value.toJSON(); | ||
seen = seen.concat(seenEntry); | ||
var json = encode(value.attributes, disallowObjects, forcePointers, seen); | ||
json.className = value.className; | ||
json.__type = 'Object'; | ||
if (value.id) { | ||
json.objectId = value.id; | ||
} | ||
if (toString.call(value) === '[object Date]') { | ||
if (isNaN(value)) { | ||
throw new Error('Tried to encode an invalid date.'); | ||
} | ||
return { __type: 'Date', iso: value.toJSON() }; | ||
return json; | ||
} | ||
if (value instanceof _ParseOp.Op || value instanceof _ParseACL2['default'] || value instanceof _ParseGeoPoint2['default'] || value instanceof _ParseRelation2['default']) { | ||
return value.toJSON(); | ||
} | ||
if (value instanceof _ParseFile2['default']) { | ||
if (!value.url()) { | ||
throw new Error('Tried to encode an unsaved file.'); | ||
} | ||
if (toString.call(value) === '[object RegExp]' && typeof value.source === 'string') { | ||
return value.source; | ||
return value.toJSON(); | ||
} | ||
if (toString.call(value) === '[object Date]') { | ||
if (isNaN(value)) { | ||
throw new Error('Tried to encode an invalid date.'); | ||
} | ||
return { __type: 'Date', iso: value.toJSON() }; | ||
} | ||
if (toString.call(value) === '[object RegExp]' && typeof value.source === 'string') { | ||
return value.source; | ||
} | ||
if (Array.isArray(value)) { | ||
return value.map(function (v) { | ||
return encode(v, disallowObjects, forcePointers, seen); | ||
}); | ||
} | ||
if (Array.isArray(value)) { | ||
return value.map(function (v) { | ||
return encode(v, disallowObjects, forcePointers, seen); | ||
}); | ||
} | ||
if (value && typeof value === 'object') { | ||
var output = {}; | ||
for (var k in value) { | ||
output[k] = encode(value[k], disallowObjects, forcePointers, seen); | ||
} | ||
return output; | ||
if (value && typeof value === 'object') { | ||
var output = {}; | ||
for (var k in value) { | ||
output[k] = encode(value[k], disallowObjects, forcePointers, seen); | ||
} | ||
return output; | ||
} | ||
return value; | ||
} | ||
return value; | ||
} | ||
exports['default'] = function (value, disallowObjects, forcePointers) { | ||
return encode(value, !!disallowObjects, !!forcePointers, []); | ||
exports['default'] = function (value, disallowObjects, forcePointers, seen) { | ||
return encode(value, !!disallowObjects, !!forcePointers, seen || []); | ||
}; | ||
module.exports = exports['default']; |
@@ -400,2 +400,3 @@ /** | ||
value: function toJSON() { | ||
var seenEntry = this.id ? this.className + ':' + this.id : this; | ||
var json = {}; | ||
@@ -407,3 +408,3 @@ var attrs = this.attributes; | ||
} else { | ||
json[attr] = (0, _encode2['default'])(attrs[attr], false, true); | ||
json[attr] = (0, _encode2['default'])(attrs[attr], false, false, [seenEntry]); | ||
} | ||
@@ -410,0 +411,0 @@ } |
@@ -19,3 +19,3 @@ /** | ||
SERVER_URL: 'https://api.parse.com', | ||
VERSION: '1.6.5', | ||
VERSION: '1.6.6', | ||
APPLICATION_ID: null, | ||
@@ -22,0 +22,0 @@ JAVASCRIPT_KEY: null, |
@@ -46,70 +46,60 @@ /** | ||
function encode(_x, _x2, _x3, _x4) { | ||
var _again = true; | ||
_function: while (_again) { | ||
var value = _x, | ||
disallowObjects = _x2, | ||
forcePointers = _x3, | ||
seen = _x4; | ||
json = output = k = undefined; | ||
_again = false; | ||
if (value instanceof _ParseObject2['default']) { | ||
if (disallowObjects) { | ||
throw new Error('Parse Objects not allowed here'); | ||
} | ||
if (forcePointers || !seen || seen.indexOf(value) > -1 || value.dirty() || _Object$keys(value._getServerData()).length < 1) { | ||
return value.toPointer(); | ||
} | ||
seen = seen.concat(value); | ||
var json = value._toFullJSON(seen); | ||
_x = json; | ||
_x2 = disallowObjects; | ||
_x3 = forcePointers; | ||
_x4 = seen; | ||
_again = true; | ||
continue _function; | ||
function encode(value, disallowObjects, forcePointers, seen) { | ||
if (value instanceof _ParseObject2['default']) { | ||
if (disallowObjects) { | ||
throw new Error('Parse Objects not allowed here'); | ||
} | ||
if (value instanceof _ParseOp.Op || value instanceof _ParseACL2['default'] || value instanceof _ParseGeoPoint2['default'] || value instanceof _ParseRelation2['default']) { | ||
return value.toJSON(); | ||
var seenEntry = value.id ? value.className + ':' + value.id : value; | ||
if (forcePointers || !seen || seen.indexOf(seenEntry) > -1 || value.dirty() || _Object$keys(value._getServerData()).length < 1) { | ||
return value.toPointer(); | ||
} | ||
if (value instanceof _ParseFile2['default']) { | ||
if (!value.url()) { | ||
throw new Error('Tried to encode an unsaved file.'); | ||
} | ||
return value.toJSON(); | ||
seen = seen.concat(seenEntry); | ||
var json = encode(value.attributes, disallowObjects, forcePointers, seen); | ||
json.className = value.className; | ||
json.__type = 'Object'; | ||
if (value.id) { | ||
json.objectId = value.id; | ||
} | ||
if (toString.call(value) === '[object Date]') { | ||
if (isNaN(value)) { | ||
throw new Error('Tried to encode an invalid date.'); | ||
} | ||
return { __type: 'Date', iso: value.toJSON() }; | ||
return json; | ||
} | ||
if (value instanceof _ParseOp.Op || value instanceof _ParseACL2['default'] || value instanceof _ParseGeoPoint2['default'] || value instanceof _ParseRelation2['default']) { | ||
return value.toJSON(); | ||
} | ||
if (value instanceof _ParseFile2['default']) { | ||
if (!value.url()) { | ||
throw new Error('Tried to encode an unsaved file.'); | ||
} | ||
if (toString.call(value) === '[object RegExp]' && typeof value.source === 'string') { | ||
return value.source; | ||
return value.toJSON(); | ||
} | ||
if (toString.call(value) === '[object Date]') { | ||
if (isNaN(value)) { | ||
throw new Error('Tried to encode an invalid date.'); | ||
} | ||
return { __type: 'Date', iso: value.toJSON() }; | ||
} | ||
if (toString.call(value) === '[object RegExp]' && typeof value.source === 'string') { | ||
return value.source; | ||
} | ||
if (Array.isArray(value)) { | ||
return value.map(function (v) { | ||
return encode(v, disallowObjects, forcePointers, seen); | ||
}); | ||
} | ||
if (Array.isArray(value)) { | ||
return value.map(function (v) { | ||
return encode(v, disallowObjects, forcePointers, seen); | ||
}); | ||
} | ||
if (value && typeof value === 'object') { | ||
var output = {}; | ||
for (var k in value) { | ||
output[k] = encode(value[k], disallowObjects, forcePointers, seen); | ||
} | ||
return output; | ||
if (value && typeof value === 'object') { | ||
var output = {}; | ||
for (var k in value) { | ||
output[k] = encode(value[k], disallowObjects, forcePointers, seen); | ||
} | ||
return output; | ||
} | ||
return value; | ||
} | ||
return value; | ||
} | ||
exports['default'] = function (value, disallowObjects, forcePointers) { | ||
return encode(value, !!disallowObjects, !!forcePointers, []); | ||
exports['default'] = function (value, disallowObjects, forcePointers, seen) { | ||
return encode(value, !!disallowObjects, !!forcePointers, seen || []); | ||
}; | ||
module.exports = exports['default']; |
@@ -400,2 +400,3 @@ /** | ||
value: function toJSON() { | ||
var seenEntry = this.id ? this.className + ':' + this.id : this; | ||
var json = {}; | ||
@@ -407,3 +408,3 @@ var attrs = this.attributes; | ||
} else { | ||
json[attr] = (0, _encode2['default'])(attrs[attr], false, true); | ||
json[attr] = (0, _encode2['default'])(attrs[attr], false, false, [seenEntry]); | ||
} | ||
@@ -410,0 +411,0 @@ } |
{ | ||
"name": "parse", | ||
"version": "1.6.5", | ||
"version": "1.6.6", | ||
"description": "The Parse JavaScript SDK", | ||
@@ -5,0 +5,0 @@ "homepage": "https://www.parse.com", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2
1291980
33830