resetExcludedStep( stepName ) { const index = Flows.excludedSteps.indexOf( stepName ); if ( index > -1 ) { Flows.excludedSteps.splice( index, 1 ); } }
// copy opts to run Object.keys(options) .filter(key => copyOptions.indexOf(key) > -1) .forEach((key) => { childOpts[key] = options[key]; });
[ ...ownersInCommunity, ...moderatorsInCommunity, ...ownersInChannel, ...moderatorsInChannel, ].filter((item, i, ar) => ar.indexOf(item) === i)
context.state.selTest.ui.forEach(function (obj) { if(obj.type=="interface") { let o=JSON.parse(obj.data); if(o.project && o.project._id && arrProject.indexOf(o.project._id)==-1) { arrProject.push(o.project._id); } } })
use(request: Request, response: Response, next: () => void) { const req: any = request; const res: any = response; if (this.configService.server.allowOrigins.indexOf(req.headers.origin) >= 0) { res.header('Access-Control-Allow-Origin', req.headers.origin); } res.header('Access-Control-Allow-Methods', 'OPTIONS,HEAD,PUT,POST,GET,DELETE'); next(); }
list.forEach(function(item) { var host = item.isHttps ? item.path : item.hostname; if (hostList.indexOf(host) === -1) { hostList.push(host); } });
function contains(name) { if (protocols.indexOf(name) != -1 || aliasProtocols[name] || PROXY_RE.test(name)) { return true; } name += ':'; return isWebsocketProtocol(name) || isWebProtocol(name) || isFileProxy(name) || name == 'tunnel:'; }
const getReactions = (messageIds: Array<string>): Promise<Array<DBReaction>> => { const distinctMessageIds = messageIds.filter((x, i, a) => a.indexOf(x) == i); return db .table('reactions') .getAll(...distinctMessageIds, { index: 'messageId' }) .filter(row => row.hasFields('deletedAt').not()) .group('messageId') .run(); }
obj.errors.forEach(function (obj) { if(err.indexOf(obj.line)==-1) { err.push(obj.line); } })
/** * @param {string} str * @returns {Boolean} */ export function validUsername(str) { const valid_map = ['admin', 'editor'] return valid_map.indexOf(str.trim()) >= 0 }
objIns.tags.forEach(function (obj) { if(arr.indexOf(obj)==-1) { arr.push(obj); } })
REMOVE_OPTIONS.forEach(function(option) { if (OPTIONS_WITH_SELECTED.indexOf(option.id) !== -1) { option.disabled = true; } else if (option.id === 'removeUnselected') { option.disabled = !hasUnselected; } });
PROTOCOLS.forEach(function(name) { if (PROXY_PROTOCOLS.indexOf(name) !== -1 || /^x/.test(name)) { return; } DEFAULT_RULES_MODAL[name] = ''; });