How to use the ember-inspector/utils/escape-reg-exp function in ember-inspector

To help you get started, we’ve selected a few ember-inspector examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emberjs / ember-inspector / app / controllers / records.js View on Github external
return this.model.filter(item => {
      // check filters
      if (filter && !get(item, `filterValues.${filter}`)) {
        return false;
      }

      // check search
      if (!isEmpty(search)) {
        let searchString = this.recordToString(item);
        return !!searchString.match(new RegExp(`.*${escapeRegExp(search.toLowerCase())}.*`));
      }
      return true;
    });
  }),
github emberjs / ember-inspector / app / models / promise.js View on Github external
matchesExactly(val) {
    return !!((this.get('label') || '').toLowerCase().match(new RegExp(`.*${escapeRegExp(val.toLowerCase())}.*`)));
  },
github emberjs / ember-inspector / app / controllers / render-tree.js View on Github external
escapedSearch: computed('search', function() {
    return escapeRegExp(this.search.toLowerCase());
  }),
github emberjs / ember-inspector / app / utils / search-match.js View on Github external
export default function(text, searchQuery) {
  if (isEmpty(searchQuery)) {
    return true;
  }
  let regExp = new RegExp(escapeRegExp(sanitize(searchQuery)));
  return !!sanitize(text).match(regExp);
}
github emberjs / ember-inspector / app / components / render-item.js View on Github external
searchMatch: computed('search', 'name', function() {
    let search = this.search;
    if (isEmpty(search)) {
      return true;
    }
    let name = this.get('model.name');
    let regExp = new RegExp(escapeRegExp(search.toLowerCase()));
    return !!name.toLowerCase().match(regExp);
  }),