@bedrockio/model 0.7.3 → 0.7.4

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/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ ## 0.7.0
2
+
3
+ - Handling null fields in search queries.
4
+
5
+ ## 0.6.0
6
+
7
+ - Added upsert module with `findOrCreate`.
8
+ - Added mechanism to sync cached fields when referenced document is saved.
9
+ - Renamed `syncSearchFields` to `syncCacheFields`.
10
+ - Simplified cache fields and search definition.
11
+
12
+ ## 0.5.0
13
+
14
+ - Refactored include module to use ^ operator for exclusion.
15
+
16
+ ## 0.4.0
17
+
18
+ - Added `hydrate` patch method.
@@ -192,7 +192,7 @@ function buildRegexQuery(keyword, fields) {
192
192
  const regexKeyword = (0, _lodash.escapeRegExp)(keyword);
193
193
  return {
194
194
  [field]: {
195
- $regex: `${regexKeyword}`,
195
+ $regex: regexKeyword,
196
196
  $options: 'i'
197
197
  }
198
198
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrockio/model",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "Bedrock utilities for model creation.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -9,7 +9,8 @@
9
9
  "lint": "eslint",
10
10
  "build": "scripts/build",
11
11
  "eject": "scripts/eject.js",
12
- "prepublishOnly": "yarn build && yarn types"
12
+ "prepublish": "yarn build && yarn types",
13
+ "postpublish": "scripts/tag"
13
14
  },
14
15
  "main": "dist/cjs/index.js",
15
16
  "module": "src/index.js",
package/src/search.js CHANGED
@@ -196,7 +196,7 @@ function buildRegexQuery(keyword, fields) {
196
196
  const regexKeyword = escapeRegExp(keyword);
197
197
  return {
198
198
  [field]: {
199
- $regex: `${regexKeyword}`,
199
+ $regex: regexKeyword,
200
200
  $options: 'i',
201
201
  },
202
202
  };