isTextIndex.js 314 B

12345678910111213141516
  1. 'use strict';
  2. /**
  3. * Returns `true` if the given index options have a `text` option.
  4. */
  5. module.exports = function isTextIndex(indexKeys) {
  6. let isTextIndex = false;
  7. for (const key of Object.keys(indexKeys)) {
  8. if (indexKeys[key] === 'text') {
  9. isTextIndex = true;
  10. }
  11. }
  12. return isTextIndex;
  13. };