Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function validateJoin(join: QueryJoin): void {
if (!isObject(join) || !isStringFull(join.field)) {
throw new RequestQueryException('Invalid join field. String expected');
}
if (!isUndefined(join.select) && !isArrayStrings(join.select)) {
throw new RequestQueryException('Invalid join select. Array of strings expected');
}
}
function validateJoin(join) {
if (!util_1.isObject(join) || !util_1.isStringFull(join.field)) {
throw new exceptions_1.RequestQueryException('Invalid join field. String expected');
}
if (!util_1.isUndefined(join.select) && !util_1.isArrayStrings(join.select)) {
throw new exceptions_1.RequestQueryException('Invalid join select. Array of strings expected');
}
}
exports.validateJoin = validateJoin;
function validateFields(fields) {
if (!util_1.isArrayStrings(fields)) {
throw new exceptions_1.RequestQueryException('Invalid fields. Array of strings expected');
}
}
exports.validateFields = validateFields;
export function validateFields(fields: QueryFields): void {
if (!isArrayStrings(fields)) {
throw new RequestQueryException('Invalid fields. Array of strings expected');
}
}