function getMentions(value = "", config = {}) {
  const { prefix = "@", split = " " } = config;
  const prefixList = Array.isArray(prefix) ? prefix : [prefix];
  return value.split(split).map((str = "") => {
    let hitPrefix = null;
    prefixList.some((prefixStr) => {
      const startStr = str.slice(0, prefixStr.length);
      if (startStr === prefixStr) {
        hitPrefix = prefixStr;
        return true;
      }
      return false;
    });
    if (hitPrefix !== null) {
      return {
        prefix: hitPrefix,
        value: str.slice(hitPrefix.length)
      };
    }
    return null;
  }).filter((entity) => !!entity && !!entity.value);
}

export { getMentions };
//# sourceMappingURL=utils.mjs.map
