Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/queuepro/node_modules/@tarekraafat/autocomplete.js/src/services/ drwxrwxr-x | |
| Viewing file: Select action/file-type: import { getQuery, checkTrigger } from "../helpers/io";
import { getData, findMatches } from "../controllers/dataController";
import { render, close } from "../controllers/listController";
/**
* Start stage
*
* @param {Object} ctx - autoComplete.js context
* @param {String} q - API search query value
*/
export default async function (ctx, q) {
// Get "input" query value
let queryVal = q || getQuery(ctx.input);
queryVal = ctx.query ? ctx.query(queryVal) : queryVal;
// Get trigger decision
const condition = checkTrigger(queryVal, ctx.trigger, ctx.threshold);
// Validate trigger condition
if (condition) {
// Get from source
await getData(ctx, queryVal);
// Check if data fetch failed
if (ctx.feedback instanceof Error) return;
// Find matching results to the query
findMatches(queryVal, ctx);
// Render "resultsList"
if (ctx.resultsList) render(ctx);
} else {
// Close open list
close(ctx);
}
}
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0055 ]-- |