Untitled

mail@pastecode.io avatar
unknown
javascript
a year ago
301 B
1
Indexable
Never
const whereClause = $filters$
	.map(({ key, value }) => {
		let operator = 'LIKE';
		let useValue = `%${value}%`;

		if (typeof(value) === 'string')
			useValue  = `'${useValue}'`;

		const result = `${key} ${operator} ${useValue}`;

		return result;
	})
	.join(' AND ');

whereClause;