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) • 793 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=l(t)),n||""===n)){const e=t.split(n);return this.filter?o(e,this.filter):e}return t}const e=/[\p{Z}\p{S}\p{P}\p{C}]+/u,n=/[\u0300-\u036f'-]/gu;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 u(t){return new RegExp(t,"g")}function l(t){let e="",n="";for(let r,i=0,u=t.length;i<u;i++)(r=t[i])!==n&&(e+=n=r);return e}function o(t,e){const n=t.length,r=[];for(let i=0,u=0;i<n;i++){const n=t[i];n&&!e[n]&&(r[u++]=n)}return r}export{l as collapse,o as filter,r as normalize,t as pipeline,u as regex,e as regex_whitespace,i as replace};