# All files / composer/utils/draft-js-custom-plugins/prepopulated-autocomplete-mention prepopulatedMentionEntityStrategy.js

25% Statements 1/4
0% Branches 0/2
0% Functions 0/2
25% Lines 1/4

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    127x

     const prepopulatedMentionEntityStrategy = (contentBlock, callback, contentState) => {
      contentBlock.findEntityRanges((character) => {
        const entityKey = character.getEntity();
        return (
          entityKey !== null &&
          contentState.getEntity(entityKey).getType() === 'PREPOPULATED_MENTION'
        );
      }, callback);
    };

    export default prepopulatedMentionEntityStrategy;