UNPKG

@stdlib/esm

Version:

ES module distribution for Stdlib, a standard library for JavaScript and Node.js.

3 lines 1.09 kB
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 import r from"./../assert/is-string-array.js";import i from"./uppercase.js";import e from"./../assert/is-boolean.js";import t from"./../assert/is-string.js";import n from"./../nlp/tokenize.js";var o=r,a=i,s=e.isPrimitive,m=t.isPrimitive,f=n;function u(r,i,e){var t,n,u,p,l,g,h,v;if(!m(r))throw new TypeError("invalid argument. First argument must be a string primitive. Value: `"+r+"`.");if(!o(i))throw new TypeError("invalid argument. Second argument must be an array of strings. Value: `"+i+"`.");if(arguments.length>2&&!s(e))throw new TypeError("invalid argument. Third argument must be a boolean primitive. Value: `"+e+"`.");if(t=f(r,!0),g=i.length,l=[],e){for(u=i.slice(),h=0;h<g;h++)u[h]=a(u[h]);for(h=0;h<t.length;h++){for(p=!0,n=a(t[h]),v=0;v<g;v++)if(u[v]===n){p=!1;break}p&&l.push(t[h])}return l.join("")}for(h=0;h<t.length;h++){for(n=t[h],p=!0,v=0;v<g;v++)if(i[v]===n){p=!1;break}p&&l.push(n)}return l.join("")}var p=u;export default p; //# sourceMappingURL=remove-words.js.map