@salesforcedevs/dw-components 1.17.7 → 1.17.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dw-components",
3
- "version": "1.17.7",
3
+ "version": "1.17.8",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -26,5 +26,5 @@
26
26
  "@types/setimmediate": "1.0.4",
27
27
  "setimmediate": "1.0.5"
28
28
  },
29
- "gitHead": "db30a6d981a6c175ffbf875d8aab522361d35809"
29
+ "gitHead": "d54bfc720c13ba1a7991da4b1cdef9aa9f66a5d4"
30
30
  }
@@ -6,6 +6,7 @@ import uniqBy from "lodash.uniqby";
6
6
  import orderBy from "lodash.orderby";
7
7
  import { isGivenLanguageSupported } from "dxUtils/language";
8
8
  import { track } from "dxUtils/analytics";
9
+ import { escapeRegExp } from "dxUtils/regexps";
9
10
 
10
11
  const DSC_API_URL = {
11
12
  "en-us": "/docs/get_index/en-us/000.0/false/All%20Services/all",
@@ -476,7 +477,9 @@ export default class DocsGrid extends LightningElement {
476
477
  }
477
478
 
478
479
  findWithRegex(baseString: string, searchWord: string) {
479
- const regex = new RegExp(searchWord.replace(/\s/, ".*"));
480
+ // Escape special regex characters to prevent invalid regex patterns
481
+ const escapedSearchWord = escapeRegExp(searchWord);
482
+ const regex = new RegExp(escapedSearchWord.replace(/\s/, ".*"));
480
483
  return !!baseString.match(regex);
481
484
  }
482
485