Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const stripFunctionWordsFromStart = function( functionWords, str ) {
str = str.toLocaleLowerCase();
let titleWords = getWords( str.toLocaleLowerCase() );
// Strip all function words from the start of the string.
titleWords = filter( titleWords, function( word ) {
return ( ! includes( functionWords, word.trim().toLocaleLowerCase() ) );
} );
return isEmpty( titleWords );
};
export default function( paper ) {
const keyphrase = paper.getKeyword();
// Return false if there are double quotes around the keyphrase.
const doubleQuotes = [ "“", "”", "〝", "〞", "〟", "‟", "„", "\"" ];
if ( includes( doubleQuotes, keyphrase[ 0 ] ) && includes( doubleQuotes, keyphrase[ keyphrase.length - 1 ] ) ) {
return false;
}
let keyphraseWords = getWords( keyphrase );
const functionWords = get( getFunctionWords, [ getLanguage( paper.getLocale() ) ], [] );
keyphraseWords = filter( keyphraseWords, function( word ) {
return ( ! includes( functionWords.all, word.trim().toLocaleLowerCase() ) );
} );
return isEmpty( keyphraseWords );
}
_updateCollaborators(collaborators) {
let collaboratorsChanged = false
let allCollaboratorsIds = Object.keys(this.collaborators)
let activeCollaborators = filter(collaborators, c => { return c !== null })
let activeCollaboratorsIds = map(activeCollaborators, c => { return c.userId })
let nonActiveCollabortorIds = difference(allCollaboratorsIds, activeCollaboratorsIds)
activeCollaboratorsIds.forEach(collaboratorId => {
let collaboratorData = this.collaborators[collaboratorId]
if(!collaboratorData) {
this.emit('collaborator:add', collaboratorId)
collaboratorsChanged = true
} else {
if(!collaboratorData.active) {
this.collaborators[collaboratorId].active = true
collaboratorsChanged = true
}
}
})
const filterZeroBalanceTokens = balances =>
filter(balances, token => toBigNumber(token.balance).gt(0))
normalizeImageStreams(imageStreams) {
const builderimageStreams = _.filter(imageStreams, isBuilder);
return _.map(builderimageStreams, (imageStream) => {
const { namespace: currentNamespace = '' } = this.props;
const { name, namespace } = imageStream.metadata;
const tag = getMostRecentBuilderTag(imageStream);
const tileName =
_.get(imageStream, ['metadata', 'annotations', ANNOTATIONS.displayName]) || name;
const iconClass = getImageStreamIcon(tag);
const tileImgUrl = getImageForIconClass(iconClass);
const tileIconClass = tileImgUrl ? null : iconClass;
const tileDescription = _.get(tag, 'annotations.description');
const tags = getAnnotationTags(tag);
const createLabel = 'Create Application';
const tileProvider = _.get(tag, ['annotations', ANNOTATIONS.providerDisplayName]);
const href = `/catalog/source-to-image?imagestream=${name}&imagestream-ns=${namespace}&preselected-ns=${currentNamespace}`;
const builderImageTag = _.head(_.get(imageStream, 'spec.tags'));
const sampleRepo = _.get(builderImageTag, 'annotations.sampleRepo');
this.coursesService.enrolledCourseData$.pipe(first()).subscribe(data => {
this.attendedTraining = _.filter(data.enrolledCourses, { status: 2 }) || [];
});
}
render() {
const files = filter(this.props.files, { type: "subtraction" });
let fileComponents;
if (files.length) {
fileComponents = map(files, file => (
));
} else {
fileComponents = (
No files found. Upload some.
module.exports = function( sentences, recommendedValue ) {
var tooLongSentences = filter( sentences, function( sentence ) {
return isSentenceTooLong( recommendedValue, sentence.sentenceLength );
} );
return tooLongSentences;
};
return this.getOrgSearch().pipe(map((channelData: any) => {
const data = _.filter(channelData, 'hashTagId');
return { formData: formData, channelData: data };
}));
} else {