Simplify code

This commit is contained in:
Jan Oberhauser 2021-03-18 11:02:00 +01:00
parent f6938a8d48
commit 40b76fd746

View file

@ -163,7 +163,7 @@ export function getDefaultFields(sobject: string) {
export function getQuery(options: IDataObject, sobject: string, returnAll: boolean, limit = 0) { export function getQuery(options: IDataObject, sobject: string, returnAll: boolean, limit = 0) {
const fields: string[] = []; const fields: string[] = [];
if (options.fields) { if (options.fields) {
fields.push.apply(fields, options.fields.toString().split(',')); fields.push.apply(fields, options.fields as string[]);
} else { } else {
fields.push.apply(fields, (getDefaultFields(sobject) as string || 'id').split(',')); fields.push.apply(fields, (getDefaultFields(sobject) as string || 'id').split(','));
} }