removeSelectPart(selectParts, part) { // if we remove the field remove the whole statement if (part.def.type === 'field') { if (this.selectModels.length > 1) { var modelsIndex = _.indexOf(this.selectModels, selectParts); this.selectModels.splice(modelsIndex, 1); } } else { var partIndex = _.indexOf(selectParts, part); selectParts.splice(partIndex, 1); } this.updatePersistedParts(); }
_.forEach(commands, c => { switch (c.type) { case 'r': const a = Number(c.args[0]); if (Math.random() > 1 / a) { isCondMatched = false; return false; } break; case 'c': let count = 0; for (let y = 0; y < 3; y++) { for (let x = 0; x < 3; x++) { const rc = rule.before[y][x]; const cl = getCell(sx + x, sy + y); if (rc === ' ' && cl != null && _.indexOf(c.args[1], cl) >= 0) { count++; } } } if (count !== Number(c.args[0])) { isCondMatched = false; return false; } break; } });
filterByTag(tag) { if (_.indexOf(this.query.tag, tag) === -1) { this.query.tag.push(tag); this.search(); this.giveSearchFocus = this.giveSearchFocus + 1; } }
export function inRow(solid: string, sectionName: string, rowName: string) { const { rows, data } = sections[sectionName]; const rowIndex = _.indexOf(rows, rowName); const row = data[rowIndex]; // TODO deal with '!' stuff in tables return hasDeep(row, toConwayNotation(solid)); }
// 쿼리 전송 public search(type: string, query: any, options): Promise<any> { if (!_.isUndefined(query.resultFormat)) { query.resultFormat.mode = _.indexOf(pivotChart, type.toString()) > -1 ? type : ChartType.BAR; query.resultFormat.options = _.extend({}, { addMinMax: true }, options); } return this.post(this.API_URL + 'datasources/query/search', query); }
_.each(options, function(value, key) { if (_.indexOf(graphite_options, key) === -1) { return; } if (value) { clean_options.push(key + '=' + encodeURIComponent(value)); } });
_.each(original.vuosiluokkakokonaisuudet, function(vlk) { if (_.indexOf(removedVlkSet, "" + vlk._vuosiluokkaKokonaisuus) > -1) { promises.push( PerusopetusService.deleteOppiaineenVuosiluokkakokonaisuus(vlk, $scope.editableModel.id) .$promise ); } });
_.each($scope.vuosiluokkakokonaisuudet, function(vlk) { if (_.indexOf(current, "" + vlk.id) > -1) { $scope.activeVuosiluokat.push(vlk); var field = getVlkField(vlk); if (field) { field.visible = true; } } });
moveRow(direction) { var rowsList = this.dashboard.rows; var rowIndex = _.indexOf(rowsList, this.row); var newIndex = rowIndex + direction; if (newIndex >= 0 && newIndex <= (rowsList.length - 1)) { _.move(rowsList, rowIndex, newIndex); } }
response: response => { const uudelleenohjausStatuskoodit = [401, 412, 500]; const fail = _.indexOf(uudelleenohjausStatuskoodit, response.status) !== -1; if (fail) { $rootScope.$emit("event:uudelleenohjattava", response.status); } return response || $q.when(response); },