Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
x: fitData.timestamp,
y: -10,
});
overtrain_zone_points.push({
x: fitData.timestamp,
y: -30,
});
}
});
// Adding days of preview (CTL + ATL + TSB dashed) after if toTimestamp is today
const ctlPreviewValues: any[] = [];
const atlPreviewValues: any[] = [];
const tsbPreviewValues: any[] = [];
const fitnessDataPreview: IFitnessActivity[] = _.filter(fitnessData, {
previewDay: true,
});
// If "toTimestamp" is today
// We add preview curves...
if (moment(toTimestamp).format("YYYYMMDD") === moment().format("YYYYMMDD")) {
_.forEach(fitnessDataPreview, (fitData: IFitnessActivity) => {
ctlPreviewValues.push({
x: fitData.timestamp,
y: fitData.ctl,
});
atlPreviewValues.push({
x: fitData.timestamp,
calculateDisplayProperties(schema, sortOptions) {
const properties = _.get(schema, 'properties');
if (_.isEmpty(properties)) {
return;
}
const fields = _.map(properties, (field, name) => ({
...field,
name,
}));
const schemaDisplayFields = _.filter(fields, (property) => (
!_.includes(UNSUPPORTED_FORMATS, property.format)
));
const displayFields = [
...schemaDisplayFields,
...ALWAYS_AVAILABLE_SORT_FORMATS,
];
// resolve field and order or set defaults
const field = _.get(sortOptions, 'field', 'name');
const order = _.get(sortOptions, 'order', 'ascending');
const currentField = _.find(displayFields, { name: field });
this.setState({
displayFields,
return !service.acl && !service.auths.length;
})
sails.log("***********************************************")
sails.log("KongConsumersController:services:open", _.map(open, item => item.name))
sails.log("***********************************************")
// Gather services with auths matching at least one consumer credential
let matchingAuths = _.filter(services,function (service) {
return _.intersection(service.auths, consumerAuths).length > 0;
});
sails.log("***********************************************")
sails.log("KongConsumersController:services:matchingAuths", _.map(matchingAuths, item => item.name))
sails.log("***********************************************")
// Gather services with access control restrictions whitelisting at least one of the consumer's groups.
let whitelisted = _.filter(services,function (service) {
return service.acl && _.intersection(service.acl.config.whitelist,consumerGroups).length > 0;
});
sails.log("***********************************************")
sails.log("KongConsumersController:services:whitelisted", _.map(whitelisted, item => item.name))
sails.log("***********************************************")
// Gather services with no authentication plugins
// & access control restrictions whitelisting at least one of the consumer's groups.
let whitelistedNoAuth = _.filter(services,function (service) {
return service.acl
&& _.intersection(service.acl.config.whitelist,consumerGroups).length > 0
&& (!service.auths || !service.auths.length);
});
sails.log("***********************************************")
sails.log("KongConsumersController:services:whitelistedNoAuth", _.map(whitelistedNoAuth, item => item.name))
handleAssigneeSelectChange = (value) => {
this.filterControler = new IssueFilterControler();
IssueStore.setSelectedAssignee(value);
if (value.find(item => item === 'none')) {
this.filterControler.assigneeFilterUpdate([]);
this.filterControler.cache.get('userFilter').otherArgs.assigneeId = ['0'].concat(filter(value, item => item !== 'none'));
// IssueStore.setFilterMap(this.filterControler.cache);
} else {
if (!this.filterControler.cache.get('userFilter').otherArgs) {
this.filterControler.cache.get('userFilter').otherArgs = {};
}
this.filterControler.cache.get('userFilter').otherArgs.assigneeId = [];
// IssueStore.setFilterMap(this.filterControler.cache);
this.filterControler.assigneeFilterUpdate(value);
}
IssueStore.judgeFilterConditionIsEmpty();
IssueStore.judgeConditionWithFilter();
IssueStore.updateIssues(this.filterControler);
}
function removeDuplicateWpcomRecords( domain, records ) {
const rootARecords = filter( records, isRootARecord( domain ) );
const wpcomARecord = find( rootARecords, isWpcomRecord );
const customARecord = find( rootARecords, negate( isWpcomRecord ) );
if ( wpcomARecord && customARecord ) {
return without( records, wpcomARecord );
}
return records;
}
removeDeleteModal(id) {
const { deleteArr } = this.state;
const newDeleteArr = _.filter(deleteArr, ({ deleteId }) => deleteId !== id);
this.setState({ deleteArr: newDeleteArr });
}
checkActive(e, option) {
let result = filter(
this.options,
value => value.id === option.id && e === value.value
);
return !isEmpty(result);
},
handleOptionChange(e, option) {
getFiles({configJson, appPath}, callback){
let localFiles = _.filter(configJson.javascript, isScriptLocal);
let localCssFiles = _.filter(configJson.css, isScriptLocal);
return async.series({
javascript_files: jsCallback=> {
return this.getJavaScripts({appPath, scripts: localFiles, compress:true}, jsCallback);
},
uncompressed_javascript_files: jsCallback=> {
return this.getJavaScripts({appPath, scripts: localFiles, compress:false}, jsCallback);
},
css_file_names: cssCallback=> {
return cssCallback(null, _.map(localCssFiles, css.getGeneratedFileName));
},
css_files: cssCallback=> {
return this.getStylesheets({appPath, scripts: localCssFiles, compress: true}, cssCallback);
},
uncompressed_css_files: cssCallback=> {
return this.getStylesheets({appPath, scripts: localCssFiles, compress: false}, cssCallback);
},
.then(([userRecommendationsObj, userItemWeights, dnr]) => {
var itemIdToWeightMap = getItemIdToWeightMap(userItemWeights);
var allRecommendations = _.get(userRecommendationsObj, 'recommendations', []);
var itemToScoreMap = {};
_.forEach(allRecommendations, (rec) => {
itemToScoreMap[rec.item] = rec.weight;
});
var filteredRecommendations = _.filter(allRecommendations, filterRecommendations.bind(this, dnr, itemIdToWeightMap));
var sampleRecommendations = getSamples(filteredRecommendations, numberOfSamples);
return addScoreToItems(itemToScoreMap, _.map(sampleRecommendations, 'item'));
});
};
function removeRequiredTags(tags, requiredTags) {
return _.filter(tags, t => !_.includes(requiredTags, t));
}