@unchainedshop/mongodb 2.10.6 → 2.11.0
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/lib/email-regex-operator.d.ts +3 -0
- package/lib/email-regex-operator.js +8 -0
- package/lib/email-regex-operator.js.map +1 -0
- package/lib/mongodb-index.d.ts +1 -0
- package/lib/mongodb-index.js +1 -0
- package/lib/mongodb-index.js.map +1 -1
- package/package.json +4 -4
- package/src/email-regex-operator.ts +7 -0
- package/src/mongodb-index.ts +1 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function emailRegexOperator(string) {
|
|
2
|
+
if (typeof string !== 'string') {
|
|
3
|
+
throw new TypeError('Expected a string');
|
|
4
|
+
}
|
|
5
|
+
const escappedEmail = string.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d');
|
|
6
|
+
return { $regex: new RegExp(`/${escappedEmail}$/`, 'i') };
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=email-regex-operator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-regex-operator.js","sourceRoot":"","sources":["../src/email-regex-operator.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,kBAAkB,CAAC,MAAM;IACvC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,SAAS,CAAC,mBAAmB,CAAC,CAAC;IAC3C,CAAC;IACD,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3F,OAAO,EAAE,MAAM,EAAE,IAAI,MAAM,CAAC,IAAI,aAAa,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;AAC5D,CAAC"}
|
package/lib/mongodb-index.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export { buildDbIndexes } from './build-db-indexes.js';
|
|
|
8
8
|
export { findPreservingIds } from './find-preserving-ids.js';
|
|
9
9
|
export { buildSortOptions } from './build-sort-option.js';
|
|
10
10
|
export { findLocalizedText } from './find-localized-text.js';
|
|
11
|
+
export { emailRegexOperator } from './email-regex-operator.js';
|
|
11
12
|
export { mongodb };
|
package/lib/mongodb-index.js
CHANGED
|
@@ -11,5 +11,6 @@ export { buildDbIndexes } from './build-db-indexes.js';
|
|
|
11
11
|
export { findPreservingIds } from './find-preserving-ids.js';
|
|
12
12
|
export { buildSortOptions } from './build-sort-option.js';
|
|
13
13
|
export { findLocalizedText } from './find-localized-text.js';
|
|
14
|
+
export { emailRegexOperator } from './email-regex-operator.js';
|
|
14
15
|
export { mongodb };
|
|
15
16
|
//# sourceMappingURL=mongodb-index.js.map
|
package/lib/mongodb-index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mongodb-index.js","sourceRoot":"","sources":["../src/mongodb-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEtD;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"mongodb-index.js","sourceRoot":"","sources":["../src/mongodb-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEtD;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/mongodb",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"description": "MongoDB provider for unchained platform",
|
|
5
5
|
"main": "lib/mongodb-index.js",
|
|
6
6
|
"exports": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@unchainedshop/utils": "^2.
|
|
34
|
+
"@unchainedshop/utils": "^2.11.0",
|
|
35
35
|
"lru-cache": "^10.2.2"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"mongodb-memory-server": "^9.3.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@types/node": "^20.14.
|
|
46
|
-
"@unchainedshop/types": "^2.
|
|
45
|
+
"@types/node": "^20.14.8",
|
|
46
|
+
"@unchainedshop/types": "^2.11.0",
|
|
47
47
|
"jest": "^29.7.0",
|
|
48
48
|
"typescript": "^5.4.5"
|
|
49
49
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function emailRegexOperator(string) {
|
|
2
|
+
if (typeof string !== 'string') {
|
|
3
|
+
throw new TypeError('Expected a string');
|
|
4
|
+
}
|
|
5
|
+
const escappedEmail = string.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d');
|
|
6
|
+
return { $regex: new RegExp(`/${escappedEmail}$/`, 'i') };
|
|
7
|
+
}
|
package/src/mongodb-index.ts
CHANGED
|
@@ -14,5 +14,6 @@ export { buildDbIndexes } from './build-db-indexes.js';
|
|
|
14
14
|
export { findPreservingIds } from './find-preserving-ids.js';
|
|
15
15
|
export { buildSortOptions } from './build-sort-option.js';
|
|
16
16
|
export { findLocalizedText } from './find-localized-text.js';
|
|
17
|
+
export { emailRegexOperator } from './email-regex-operator.js';
|
|
17
18
|
|
|
18
19
|
export { mongodb };
|