Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!isPresent(label)) {
return Optional.empty();
}
if (!label.startsWith('#')) {
label = '#' + label;
}
const strippedLabel = this.stripTypedLabel(label);
if ( ! strippedLabel.isPresent()) {
return Optional.empty();
}
if (twitter_txt.isValidHashtag(strippedLabel.get())) {
return Optional.of(label);
}
return Optional.empty();
}