Removes dependency upon babel-polyfills (#2731)
* Removes runtime dependency babel-polyfill (#2692) * Removes runtime dependency babel-polyfill * removes references to polyfilled array includes * Better support for polyfilling * Removes unnecessary log * Adds killswitch if tests are polyfilled * Reverts usage of includes on strings
This commit is contained in:
@@ -101,7 +101,7 @@ const transformKeyValueForUpdate = (className, restKey, restValue, parseFormatSc
|
||||
}
|
||||
|
||||
const transformInteriorValue = restValue => {
|
||||
if (restValue !== null && typeof restValue === 'object' && Object.keys(restValue).some(key => key.includes('$') || key.includes('.'))) {
|
||||
if (restValue !== null && typeof restValue === 'object' && Object.keys(restValue).some(key => key.includes('$')|| key.includes('.'))) {
|
||||
throw new Parse.Error(Parse.Error.INVALID_NESTED_KEY, "Nested keys should not contain the '$' or '.' characters");
|
||||
}
|
||||
// Handle atomic values
|
||||
|
||||
@@ -445,7 +445,7 @@ export class PostgresStorageAdapter {
|
||||
relations.push(fieldName)
|
||||
return;
|
||||
}
|
||||
if (['_rperm', '_wperm'].includes(fieldName)) {
|
||||
if (['_rperm', '_wperm'].indexOf(fieldName) >= 0) {
|
||||
parseType.contents = { type: 'String' };
|
||||
}
|
||||
valuesArray.push(fieldName);
|
||||
@@ -678,7 +678,7 @@ export class PostgresStorageAdapter {
|
||||
valuesArray.push(object[fieldName].objectId);
|
||||
break;
|
||||
case 'Array':
|
||||
if (['_rperm', '_wperm'].includes(fieldName)) {
|
||||
if (['_rperm', '_wperm'].indexOf(fieldName) >= 0) {
|
||||
valuesArray.push(object[fieldName]);
|
||||
} else {
|
||||
valuesArray.push(JSON.stringify(object[fieldName]));
|
||||
@@ -707,7 +707,7 @@ export class PostgresStorageAdapter {
|
||||
let initialValues = valuesArray.map((val, index) => {
|
||||
let termination = '';
|
||||
let fieldName = columnsArray[index];
|
||||
if (['_rperm','_wperm'].includes(fieldName)) {
|
||||
if (['_rperm','_wperm'].indexOf(fieldName) >= 0) {
|
||||
termination = '::text[]';
|
||||
} else if (schema.fields[fieldName] && schema.fields[fieldName].type === 'Array') {
|
||||
termination = '::jsonb';
|
||||
|
||||
Reference in New Issue
Block a user