atriusmaps-node-sdk 3.3.1008 → 3.3.1011
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/dist/cjs/package.json.js +1 -1
- package/dist/cjs/plugins/searchService/src/poiSearch.js +3 -1
- package/dist/cjs/plugins/searchService/src/searchTypeahead.js +3 -1
- package/dist/cjs/plugins/venueDataLoader/src/venueDataLoader.js +0 -1
- package/dist/package.json.js +1 -1
- package/dist/plugins/searchService/src/searchTypeahead.js +1 -1
- package/package.json +1 -1
package/dist/cjs/package.json.js
CHANGED
|
@@ -24,7 +24,9 @@ var R__namespace = /*#__PURE__*/_interopNamespaceDefault(R);
|
|
|
24
24
|
|
|
25
25
|
const DEFAULT_RESULTS_LIMIT = 5e3;
|
|
26
26
|
function promoteExactMatches(results, exactIdSet) {
|
|
27
|
-
if (!exactIdSet.size)
|
|
27
|
+
if (!exactIdSet.size) {
|
|
28
|
+
return results;
|
|
29
|
+
}
|
|
28
30
|
return results.map((poi, index) => {
|
|
29
31
|
const exact = exactIdSet.has(Number(poi.poiId));
|
|
30
32
|
return { poi: exact ? { ...poi, isExactNameMatch: true } : poi, index, exact };
|
|
@@ -74,7 +74,9 @@ function extractParentCategories(pois) {
|
|
|
74
74
|
}
|
|
75
75
|
function rankByExactMatch(results, query) {
|
|
76
76
|
const normalizedQuery = (query ?? "").toLowerCase();
|
|
77
|
-
if (!normalizedQuery)
|
|
77
|
+
if (!normalizedQuery) {
|
|
78
|
+
return results;
|
|
79
|
+
}
|
|
78
80
|
return results.map((keyword, index) => ({ keyword, index, tier: keyword.toLowerCase() === normalizedQuery ? 0 : 1 })).sort((a, b) => a.tier - b.tier || a.index - b.index).map((entry) => entry.keyword);
|
|
79
81
|
}
|
|
80
82
|
|
|
@@ -134,7 +134,6 @@ async function create(app, config) {
|
|
|
134
134
|
R__namespace.chain(R__namespace.keys),
|
|
135
135
|
// Generate list of level IDs plus the venue ID to fetch feature JSON for each
|
|
136
136
|
R__namespace.prepend(venueData.id),
|
|
137
|
-
// eslint-disable-next-line no-template-curly-in-string
|
|
138
137
|
R__namespace.map((geoJsonId) => venueData.files.geoJson.replace("${geoJsonId}", geoJsonId)),
|
|
139
138
|
R__namespace.map(venueData.fetchJson),
|
|
140
139
|
R__namespace.map(
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var a="3.3.
|
|
1
|
+
var a="3.3.1011",e={version:a};export{e as default,a as version};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pipe as e,values as t,chain as r,prop as n,filter as o,pluck as a}from"ramda";import{getFlexSearchInstance as i}from"./utils.js";function s(e,t,r){const n=function(e,t){let r=e,{keywords:n,index:o}=d(e,t);const a=e=>{r=e;const a=d(e,t);n=a.keywords,o=a.index};return{search:e=>function(e,t){const r=(t??"").toLowerCase();return
|
|
1
|
+
import{pipe as e,values as t,chain as r,prop as n,filter as o,pluck as a}from"ramda";import{getFlexSearchInstance as i}from"./utils.js";function s(e,t,r){const n=function(e,t){let r=e,{keywords:n,index:o}=d(e,t);const a=e=>{r=e;const a=d(e,t);n=a.keywords,o=a.index};return{search:e=>function(e,t){const r=(t??"").toLowerCase();if(!r)return e;return e.map((e,t)=>({keyword:e,index:t,tier:e.toLowerCase()===r?0:1})).sort((e,t)=>e.tier-t.tier||e.index-t.index).map(e=>e.keyword)}(o.search(e).map(e=>n[e]),e.query),add:e=>{n.push(e),o.add(n.length-1,e)},update:a,getAllPois:()=>r}}(e,r);return{query:(e,r)=>{const o=n.search({query:e,limit:r}),a=!(e.length<3)&&o.length,i=r-o.length,s=a?function(e,r){const n=t({query:e,limit:r}),o=t({query:e,suggest:!0,limit:r}),a=n.map(e=>e.poiId),i=o.filter(e=>-1===a.indexOf(e.poiId));return n.concat(i)}(e,i):[];return{keywords:o,pois:s}},addKeyword:e=>{n.add(e)},updatePOIs:e=>{const t={...n.getAllPois()};for(const r of e)t[r.poiId]=r;n.update(t)}}}function d(s,d){const c=function(e){return Object.values(e).map(e=>e.category).map(e=>e.split(".")).map(e=>e[0])}(s),u=[...c,...e(t,r(n("keywords")),o(n("isUserSearchable")),a("name"))(s),...e(t,a("name"))(s),...e(t,o(e=>e.staticName&&e.staticName!==e.name),a("staticName"))(s)],m=Array.from(new Set([...u])),l=i({lang:d});return m.forEach((e,t)=>l.add(t,e)),{keywords:m,index:l}}export{s as default};
|
package/package.json
CHANGED