forms-angular 0.12.0-beta.277 → 0.12.0-beta.278

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -470,7 +470,7 @@ class FormsAngular {
470
470
  resultObject.matched = resultObject.matched || [];
471
471
  // record the index of string that matched, so we don't count it against another field
472
472
  for (let i = 0; i < searchStrings.length; i++) {
473
- if (aDoc[item.field].toLowerCase().indexOf(searchStrings[i]) === 0) {
473
+ if (aDoc[item.field]?.toLowerCase().indexOf(searchStrings[i]) === 0) {
474
474
  resultObject.matched.push(i);
475
475
  break;
476
476
  }
@@ -497,7 +497,7 @@ class FormsAngular {
497
497
  if (multiMatchPossible) {
498
498
  // record the index of string that matched, so we don't count it against another field
499
499
  for (let i = 0; i < searchStrings.length; i++) {
500
- if (!resultObject.matched.includes(i) && aDoc[item.field].toLowerCase().indexOf(searchStrings[i]) === 0) {
500
+ if (!resultObject.matched.includes(i) && aDoc[item.field]?.toLowerCase().indexOf(searchStrings[i]) === 0) {
501
501
  resultObject.matched.push(i);
502
502
  resultObject.addHits = Math.max((resultObject.addHits || 9) - 1, 0);
503
503
  // remove it from current position
@@ -515,7 +515,7 @@ class FormsAngular {
515
515
  let addHits;
516
516
  if (multiMatchPossible) {
517
517
  // If they match the whole search phrase in one index they get smaller addHits (so they sort higher)
518
- if (aDoc[item.field].toLowerCase().indexOf(searchFor) === 0) {
518
+ if (aDoc[item.field]?.toLowerCase().indexOf(searchFor) === 0) {
519
519
  addHits = 7;
520
520
  }
521
521
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "author": "Mark Chapman <support@forms-angular.org>",
4
4
  "description": "A form builder that sits on top of Angular.js, Twitter Bootstrap, jQuery UI, Angular-UI, Express and Mongoose. Opinionated or what?",
5
5
  "homepage": "http://forms-angular.org",
6
- "version": "0.12.0-beta.277",
6
+ "version": "0.12.0-beta.278",
7
7
  "engines": {
8
8
  "node": ">=8.x",
9
9
  "npm": ">=5.x"