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:
Florent Vilmart
2016-09-24 13:53:15 -04:00
committed by GitHub
parent 3ba6e613b3
commit 2ec2bb5660
9 changed files with 36 additions and 26 deletions

View File

@@ -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';