atriusmaps-node-sdk
Version:
This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information
2 lines (1 loc) • 790 B
JavaScript
function t(t,e,n,r){if(t&&(e&&(t=i(t,e)),this.matcher&&(t=i(t,this.matcher)),this.stemmer&&t.length>1&&(t=i(t,this.stemmer)),r&&t.length>1&&(t=o(t)),n||""===n)){const e=t.split(n);return this.filter?u(e,this.filter):e}return t}const e=/[\p{Z}\p{S}\p{P}\p{C}]+/u,n=/[\u0300-\u036f]/g;function r(t){return t.normalize&&(t=t.normalize("NFD").replace(n,"")),t}function i(t,e){for(let n=0,r=e.length;n<r&&(t=t.replace(e[n],e[n+1]));n+=2);return t}function l(t){return new RegExp(t,"g")}function o(t){let e="",n="";for(let r,i=0,l=t.length;i<l;i++)(r=t[i])!==n&&(e+=n=r);return e}function u(t,e){const n=t.length,r=[];for(let i=0,l=0;i<n;i++){const n=t[i];n&&!e[n]&&(r[l++]=n)}return r}export{o as collapse,u as filter,r as normalize,t as pipeline,l as regex,e as regex_whitespace,i as replace};