UNPKG

@forbespro/lead-agent

Version:
2 lines (1 loc) 783 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=/[\0\t\n\r]/g;function g(){let i=1,c="",f=!0,r;return p;function p(e,l,a){const t=[];let o,h,n,s,d;for(e=c+(typeof e=="string"?e.toString():new TextDecoder(l||void 0).decode(e)),n=0,c="",f&&(e.charCodeAt(0)===65279&&n++,f=void 0);n<e.length;){if(u.lastIndex=n,o=u.exec(e),s=o&&o.index!==void 0?o.index:e.length,d=e.charCodeAt(s),!o){c=e.slice(n);break}if(d===10&&n===s&&r)t.push(-3),r=void 0;else switch(r&&(t.push(-5),r=void 0),n<s&&(t.push(e.slice(n,s)),i+=s-n),d){case 0:{t.push(65533),i++;break}case 9:{for(h=Math.ceil(i/4)*4,t.push(-2);i++<h;)t.push(-1);break}case 10:{t.push(-4),i=1;break}default:r=!0,i=1}n=s+1}return a&&(r&&t.push(-5),c&&t.push(c),t.push(null)),t}}exports.preprocess=g;