@eeplatform/core 1.8.3 → 1.8.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 +6 -0
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -7216,8 +7216,17 @@ function usePSGCRepo() {
|
|
|
7216
7216
|
}
|
|
7217
7217
|
}
|
|
7218
7218
|
async function getByName({ name, prefix = "", type = "" } = {}) {
|
|
7219
|
-
const
|
|
7220
|
-
const
|
|
7219
|
+
const stopWords = /* @__PURE__ */ new Set(["of", "the"]);
|
|
7220
|
+
const words = name.trim().split(/\s+/).filter((w) => w.length > 2 && !stopWords.has(w.toLowerCase())).map((w) => w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
7221
|
+
const regex = words.map((w) => `(?=.*${w})`).join("");
|
|
7222
|
+
const query = {
|
|
7223
|
+
name: { $regex: regex, $options: "i" }
|
|
7224
|
+
};
|
|
7225
|
+
const cacheKeyOptions = { type };
|
|
7226
|
+
if (type) {
|
|
7227
|
+
query.type = type;
|
|
7228
|
+
cacheKeyOptions.type = type;
|
|
7229
|
+
}
|
|
7221
7230
|
const _types = ["City", "Mun"];
|
|
7222
7231
|
if (_types.includes(type)) {
|
|
7223
7232
|
query.type = { $in: _types };
|