Update cafy to 8.0.0 🚀
This commit is contained in:
parent
0c3e9dd5e0
commit
f664cf09c0
97 changed files with 294 additions and 291 deletions
|
|
@ -16,15 +16,15 @@ const escapeRegexp = require('escape-regexp');
|
|||
*/
|
||||
module.exports = (params, me) => new Promise(async (res, rej) => {
|
||||
// Get 'query' parameter
|
||||
const [query, queryError] = $(params.query).string().pipe(x => x != '').get();
|
||||
const [query, queryError] = $.str.pipe(x => x != '').get(params.query);
|
||||
if (queryError) return rej('invalid query param');
|
||||
|
||||
// Get 'offset' parameter
|
||||
const [offset = 0, offsetErr] = $(params.offset).optional.number().min(0).get();
|
||||
const [offset = 0, offsetErr] = $.num.optional().min(0).get(params.offset);
|
||||
if (offsetErr) return rej('invalid offset param');
|
||||
|
||||
// Get 'max' parameter
|
||||
const [max = 10, maxErr] = $(params.max).optional.number().range(1, 30).get();
|
||||
const [max = 10, maxErr] = $.num.optional().range(1, 30).get(params.max);
|
||||
if (maxErr) return rej('invalid max param');
|
||||
|
||||
// If Elasticsearch is available, search by $
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue